14 template <
typename EventType>
20 template <
typename EventType>
26 template <
typename TComponent>
29 return this->getComponent<TComponent>(std::string());
32 template <
typename TComponent>
37 if (component.first.name != name)
40 auto *tcomponent =
dynamic_cast<TComponent *
>(component.second.get());
41 if (tcomponent !=
nullptr)
56 template <
typename SmaccComponentType,
typename TOrthogonal,
typename TClient,
typename... TArgs>
59 ComponentKey componentkey(&
typeid(SmaccComponentType), name);
61 std::shared_ptr<SmaccComponentType> ret;
67 auto tname = demangledTypeName<SmaccComponentType>();
68 ROS_DEBUG(
"%s smacc component is required. Creating a new instance.", tname.c_str());
70 ret = std::shared_ptr<SmaccComponentType>(
new SmaccComponentType(targs...));
73 ret->initialize(
this);
76 ROS_DEBUG(
"%s resource is required. Done.", tname.c_str());
80 ROS_DEBUG(
"%s resource is required. Found resource in cache.", demangledTypeName<SmaccComponentType>().c_str());
81 ret = dynamic_pointer_cast<SmaccComponentType>(it->second);
84 ret->template onOrthogonalAllocation<TOrthogonal, TClient>();
89 template <
typename SmaccComponentType,
typename TOrthogonal,
typename TClient,
typename... TArgs>
92 return this->createNamedComponent<SmaccComponentType, TOrthogonal, TClient>(std::string(), targs...);
95 template <
typename TSmaccSignal,
typename T>
101 template <
typename SmaccClientType>
ISmaccOrthogonal * orthogonal_
SmaccComponentType * createComponent(TArgs... targs)
void requiresClient(SmaccClientType *&storage)
ISmaccStateMachine * stateMachine_
std::map< ComponentKey, std::shared_ptr< smacc::ISmaccComponent > > components_
void connectSignal(TSmaccSignal &signal, void(T::*callback)(), T *object)
TComponent * getComponent()
ISmaccStateMachine * getStateMachine()
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)
bool requiresClient(SmaccClientType *&storage)
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)