30template <
typename EventType>
36template <
typename EventType>
39 auto ev =
new EventType();
43template <
typename TComponent>
45 TComponent *& requiredComponentStorage,
bool throwExceptionIfNotExist)
49 if (requiredComponentStorage ==
nullptr && throwExceptionIfNotExist)
52 this->
getLogger(), std::string(
"Required component ") +
54 " not found. Available components:");
56 std::vector<std::shared_ptr<ISmaccComponent>> components;
59 for (
auto c : components)
61 RCLCPP_DEBUG(this->
getLogger(),
"- Component %s", c->getName().c_str());
64 throw std::runtime_error(
65 std::string(
"Component ") +
demangleSymbol(
typeid(TComponent).name()) +
" not found");
69template <
typename TComponent>
71 std::string name, TComponent *& requiredComponentStorage,
bool throwExceptionIfNotExist)
75 if (requiredComponentStorage ==
nullptr && throwExceptionIfNotExist)
78 this->
getLogger(), std::string(
"Required component with name: '") + name +
"'" +
80 " not found. Available components:");
82 std::vector<std::shared_ptr<ISmaccComponent>> components;
85 for (
auto c : components)
87 RCLCPP_DEBUG(this->
getLogger(),
" - Component %s", c->getName().c_str());
90 throw std::runtime_error(
91 std::string(
"Component ") +
demangleSymbol(
typeid(TComponent).name()) +
92 std::string(
" not found"));
96template <
typename TClient>
102template <
typename SmaccComponentType,
typename TOrthogonal,
typename TClient,
typename... TArgs>
108template <
typename SmaccComponentType,
typename TOrthogonal,
typename TClient,
typename... TArgs>
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)
SmaccComponentType * createComponent(TArgs... targs)
void requiresClient(SmaccClientType *&storage)
void getComponents(std::vector< std::shared_ptr< ISmaccComponent > > &components)
TComponent * getComponent()
void requiresComponent(TComponent *&requiredComponentStorage, bool throwExceptionIfNotExist=false)
void requiresClient(TClient *&requiredClientStorage)
SmaccComponentType * createSiblingComponent(TArgs... targs)
SmaccComponentType * createSiblingNamedComponent(std::string name, TArgs... targs)
rclcpp::Logger getLogger() const
ISmaccStateMachine * stateMachine_
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)
std::string demangleSymbol()