@@ -167,7 +167,7 @@ std::string toStr(const T& value)
167167{
168168 if constexpr (IsConvertibleToString<T>())
169169 {
170- return value;
170+ return static_cast <std::string>( value) ;
171171 }
172172 else if constexpr (!std::is_arithmetic_v<T>)
173173 {
@@ -440,7 +440,7 @@ inline std::pair<std::string, PortInfo> InputPort(StringView name,
440440 static_assert (std::is_same_v<T, DefaultT> ||
441441 IsConvertibleToString<DefaultT>() ||
442442 std::is_convertible_v<DefaultT, T>,
443- " The default value must be either the same of the port or BlackboardKey " );
443+ " The default value must be either the same of the port or a string " );
444444
445445 auto out = CreatePort<T>(PortDirection::INPUT, name, description);
446446 out.second .setDefaultValue (default_value);
@@ -462,7 +462,7 @@ inline std::pair<std::string, PortInfo> BidirectionalPort(StringView name,
462462 static_assert (std::is_same_v<T, DefaultT> ||
463463 IsConvertibleToString<DefaultT>() ||
464464 std::is_convertible_v<DefaultT, T>,
465- " The default value must be either the same of the port or BlackboardKey " );
465+ " The default value must be either the same of the port or a string " );
466466
467467 auto out = CreatePort<T>(PortDirection::INOUT, name, description);
468468 out.second .setDefaultValue (default_value);
@@ -492,64 +492,6 @@ inline std::pair<std::string, PortInfo> OutputPort(StringView name,
492492
493493// ----------
494494
495- // /** Syntactic sugar to invoke CreatePort<T>(PortDirection::INPUT,...)
496- // * It also sets the default value to the blackboard entry specified
497- // * in "default_key"
498- // *
499- // * @param name the name of the port
500- // * @param default_key the key of an entry in the blackbard
501- // * @param description optional human-readable description
502- // */
503- // template <typename T> [[nodiscard]]
504- // inline std::pair<std::string, PortInfo> InputPort(
505- // StringView name,
506- // BlackboardKey default_key,
507- // StringView description)
508- // {
509- // auto out = CreatePort<T>(PortDirection::INPUT, name, description);
510- // out.second.setDefaultValue(default_key);
511- // return out;
512- // }
513-
514- // /** Syntactic sugar to invoke CreatePort<T>(PortDirection::INOUT,...)
515- // * It also sets the default value to the blackboard entry specified
516- // * in "default_key"
517- // *
518- // * @param name the name of the port
519- // * @param default_key the key of an entry in the blackbard
520- // * @param description optional human-readable description
521- // */
522- // template <typename T> [[nodiscard]]
523- // inline std::pair<std::string, PortInfo> BidirectionalPort(
524- // StringView name,
525- // BlackboardKey default_key,
526- // StringView description)
527- // {
528- // auto out = CreatePort<T>(PortDirection::INOUT, name, description);
529- // out.second.setDefaultValue(default_key);
530- // return out;
531- // }
532-
533- // /** Syntactic sugar to invoke CreatePort<T>(PortDirection::OUTPUT,...)
534- // * It also sets the default value to the blackboard entry specified
535- // * in "default_key"
536- // *
537- // * @param name the name of the port
538- // * @param default_key the key of an entry in the blackbard
539- // * @param description optional human-readable description
540- // */
541- // template <typename T> [[nodiscard]]
542- // inline std::pair<std::string, PortInfo> OutputPort(
543- // StringView name,
544- // BlackboardKey default_key,
545- // StringView description)
546- // {
547- // auto out = CreatePort<T>(PortDirection::OUTPUT, name, description);
548- // out.second.setDefaultValue(default_key);
549- // return out;
550- // }
551- // ----------
552-
553495using PortsList = std::unordered_map<std::string, PortInfo>;
554496
555497template <typename T, typename = void >
0 commit comments