29template <
typename SmaccClientType>
34 storage =
dynamic_cast<SmaccClientType *
>(client.get());
35 if (storage !=
nullptr)
return true;
42 <<
"] not found in current orthogonal. Searching in other orthogonals.");
46 for (
auto & client : orthoentry.second->getClients())
48 storage =
dynamic_cast<SmaccClientType *
>(client.get());
49 if (storage !=
nullptr)
53 "Required client [" << requiredClientName <<
"] found in other orthogonal.");
62 <<
"] not found even in other orthogonals. Returning null pointer. If the "
63 "requested client is used may result in a segmentation fault.");
67template <
typename SmaccComponentType>
74 "Cannot use the requiresComponent funcionality from an orthogonal before onInitialize");
82template <
typename TOrthogonal,
typename TClient>
86 client->setOrthogonal(
this);
88 client->template onOrthogonalAllocation<TOrthogonal, TClient>();
89 client->template onStateOrthogonalAllocation<TOrthogonal, TClient>();
92template <
typename TClientBehavior>
98 auto * ret =
dynamic_cast<TClientBehavior *
>(cb.get());
115inline const std::vector<std::vector<std::shared_ptr<smacc2::ISmaccClientBehavior>>> &
136template <
typename TOrthogonal,
typename TClient>
140 template <
typename... TArgs>
147 template <
typename SmaccComponentType,
typename... TArgs>
154 template <
typename SmaccComponentType,
typename... TArgs>
167template <
typename TOrthogonal>
171 template <
typename TClient,
typename... TArgs>
172 std::shared_ptr<ClientHandler<TOrthogonal, TClient>>
createClient(TArgs... args)
182 getLogger(),
"[%s] Creating client object, type:'%s' object tag: '%s'",
186 auto client = std::make_shared<ClientHandler<TOrthogonal, TClient>>(args...);
191 clientPtr->template onComponentInitialization<TOrthogonal, TClient>();
ClientHandler(TArgs... args)
smacc2::introspection::TypeInfo::Ptr getType() override
SmaccComponentType * createComponent(TArgs... targs)
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)
SmaccComponentType * createComponent(TArgs... targs)
ISmaccStateMachine * getStateMachine()
void setGlobalSMData(std::string name, T value)
bool getGlobalSMData(std::string name, T &ret)
rclcpp::Logger getLogger()
void requiresComponent(SmaccComponentType *&storage)
std::vector< std::shared_ptr< smacc2::ISmaccClient > > clients_
ISmaccStateMachine * stateMachine_
bool requiresClient(SmaccClientType *&storage)
void assignClientToOrthogonal(TClient *client)
std::vector< std::vector< std::shared_ptr< smacc2::ISmaccClientBehavior > > > clientBehaviors_
const std::vector< std::vector< std::shared_ptr< smacc2::ISmaccClientBehavior > > > & getClientBehaviors() const
TClientBehavior * getClientBehavior(int index=0)
const std::vector< std::shared_ptr< smacc2::ISmaccClient > > & getClients()
bool getGlobalSMData(std::string name, T &ret)
void setGlobalSMData(std::string name, T value)
void requiresComponent(SmaccComponentType *&storage, bool throwsExceptionIfNotExist=false)
std::shared_ptr< ClientHandler< TOrthogonal, TClient > > createClient(TArgs... args)
static TypeInfo::Ptr getTypeInfoFromType()
std::shared_ptr< TypeInfo > Ptr
std::string demangledTypeName()
std::string demangleType(const std::type_info *tinfo)