@@ -167,7 +167,7 @@ std::string toStr(const T& value)
167
167
{
168
168
if constexpr (IsConvertibleToString<T>())
169
169
{
170
- return value;
170
+ return static_cast <std::string>( value) ;
171
171
}
172
172
else if constexpr (!std::is_arithmetic_v<T>)
173
173
{
@@ -440,7 +440,7 @@ inline std::pair<std::string, PortInfo> InputPort(StringView name,
440
440
static_assert (std::is_same_v<T, DefaultT> ||
441
441
IsConvertibleToString<DefaultT>() ||
442
442
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 " );
444
444
445
445
auto out = CreatePort<T>(PortDirection::INPUT, name, description);
446
446
out.second .setDefaultValue (default_value);
@@ -462,7 +462,7 @@ inline std::pair<std::string, PortInfo> BidirectionalPort(StringView name,
462
462
static_assert (std::is_same_v<T, DefaultT> ||
463
463
IsConvertibleToString<DefaultT>() ||
464
464
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 " );
466
466
467
467
auto out = CreatePort<T>(PortDirection::INOUT, name, description);
468
468
out.second .setDefaultValue (default_value);
@@ -492,64 +492,6 @@ inline std::pair<std::string, PortInfo> OutputPort(StringView name,
492
492
493
493
// ----------
494
494
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
-
553
495
using PortsList = std::unordered_map<std::string, PortInfo>;
554
496
555
497
template <typename T, typename = void >
0 commit comments