SMACC2
Loading...
Searching...
No Matches
smacc2::Orthogonal< TOrthogonal > Class Template Reference

#include <smacc_orthogonal_impl.hpp>

Inheritance diagram for smacc2::Orthogonal< TOrthogonal >:
Inheritance graph
Collaboration diagram for smacc2::Orthogonal< TOrthogonal >:
Collaboration graph

Public Member Functions

template<typename TClient , typename... TArgs>
std::shared_ptr< ClientHandler< TOrthogonal, TClient > > createClient (TArgs... args)
 
- Public Member Functions inherited from smacc2::ISmaccOrthogonal
void setStateMachine (ISmaccStateMachine *value)
 
ISmaccStateMachinegetStateMachine ()
 
void initState (ISmaccState *state)
 
void addClientBehavior (std::shared_ptr< smacc2::ISmaccClientBehavior > clientBehavior)
 
void runtimeConfigure ()
 
void onEntry ()
 
void onExit ()
 
void onDispose ()
 
virtual std::string getName () const
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
template<typename SmaccClientType >
bool requiresClient (SmaccClientType *&storage)
 
const std::vector< std::shared_ptr< smacc2::ISmaccClient > > & getClients ()
 
const std::vector< std::vector< std::shared_ptr< smacc2::ISmaccClientBehavior > > > & getClientBehaviors () const
 
template<typename T >
void setGlobalSMData (std::string name, T value)
 
template<typename T >
bool getGlobalSMData (std::string name, T &ret)
 
template<typename TClientBehavior >
TClientBehavior * getClientBehavior (int index=0)
 
rclcpp::Node::SharedPtr getNode ()
 
rclcpp::Logger getLogger ()
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccOrthogonal
virtual void onInitialize ()
 
void initializeClients ()
 
template<typename TOrthogonal , typename TClient >
void assignClientToOrthogonal (TClient *client)
 
- Protected Attributes inherited from smacc2::ISmaccOrthogonal
std::vector< std::shared_ptr< smacc2::ISmaccClient > > clients_
 

Detailed Description

template<typename TOrthogonal>
class smacc2::Orthogonal< TOrthogonal >

Definition at line 168 of file smacc_orthogonal_impl.hpp.

Member Function Documentation

◆ createClient()

template<typename TOrthogonal >
template<typename TClient , typename... TArgs>
std::shared_ptr< ClientHandler< TOrthogonal, TClient > > smacc2::Orthogonal< TOrthogonal >::createClient ( TArgs... args)
inline

Definition at line 172 of file smacc_orthogonal_impl.hpp.

173 {
174 //static_assert(std::is_base_of<ISmaccOrthogonal, TOrthogonal>::value, "The object Tag must be the orthogonal type where the client was created");
175 // if (typeid(*this) != typeid(TOrthogonal))
176 // {
177 // RCLCPP_ERROR_STREAM(getLogger(),"Error creating client. The object Tag must be the type of the orthogonal where the client was created:" << demangleType(typeid(*this)) << ". The object creation was skipped and a nullptr was returned");
178 // return nullptr;
179 // }
180
181 RCLCPP_INFO(
182 getLogger(), "[%s] Creating client object, type:'%s' object tag: '%s'",
183 demangleType(typeid(*this)).c_str(), demangledTypeName<TClient>().c_str(),
185
186 auto client = std::make_shared<ClientHandler<TOrthogonal, TClient>>(args...);
187 this->template assignClientToOrthogonal<TOrthogonal, TClient>(client.get());
188
189 // Call the component initialization hook
190 TClient * clientPtr = static_cast<TClient *>(client.get());
191 clientPtr->template onComponentInitialization<TOrthogonal, TClient>();
192
193 // it is stored the client (not the client handler)
194 this->clients_.push_back(client);
195
196 return client;
197 }
std::vector< std::shared_ptr< smacc2::ISmaccClient > > clients_
void assignClientToOrthogonal(TClient *client)
std::string demangledTypeName()
std::string demangleType(const std::type_info *tinfo)

References smacc2::ISmaccOrthogonal::assignClientToOrthogonal(), smacc2::ISmaccOrthogonal::clients_, smacc2::introspection::demangledTypeName(), smacc2::introspection::demangleType(), and smacc2::ISmaccOrthogonal::getLogger().

Here is the call graph for this function:

The documentation for this class was generated from the following file: