SMACC
Loading...
Searching...
No Matches
Public Member Functions | List of all members
smacc::Orthogonal< TOrthogonal > Class Template Reference

#include <smacc_orthogonal_impl.h>

Inheritance diagram for smacc::Orthogonal< TOrthogonal >:
Inheritance graph
Collaboration diagram for smacc::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 smacc::ISmaccOrthogonal
void setStateMachine (ISmaccStateMachine *value)
 
ISmaccStateMachinegetStateMachine ()
 
void initState (ISmaccState *state)
 
void addClientBehavior (std::shared_ptr< smacc::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< smacc::ISmaccClient > > & getClients ()
 
const std::vector< std::vector< std::shared_ptr< smacc::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 ()
 

Additional Inherited Members

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

Detailed Description

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

Definition at line 141 of file smacc_orthogonal_impl.h.

Member Function Documentation

◆ createClient()

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

Definition at line 145 of file smacc_orthogonal_impl.h.

146 {
147 //static_assert(std::is_base_of<ISmaccOrthogonal, TOrthogonal>::value, "The object Tag must be the orthogonal type where the client was created");
148 // if (typeid(*this) != typeid(TOrthogonal))
149 // {
150 // ROS_ERROR_STREAM("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");
151 // return nullptr;
152 // }
153
154 ROS_INFO("[%s] creates a client of type '%s' and object tag '%s'",
155 demangleType(typeid(*this)).c_str(),
156 demangledTypeName<TClient>().c_str(),
157 demangledTypeName<TOrthogonal>().c_str()
158 );
159
160 auto client = std::make_shared<ClientHandler<TOrthogonal, TClient>>(args...);
161 this->template assignClientToOrthogonal<TOrthogonal, TClient>(client.get());
162
163 // it is stored the client (not the client handler)
164 clients_.push_back(client);
165
166 return client;
167 }
std::vector< std::shared_ptr< smacc::ISmaccClient > > clients_
std::string demangleType(const std::type_info *tinfo)
Definition: introspection.h:86

References smacc::ISmaccOrthogonal::clients_, and smacc::introspection::demangleType().

Here is the call graph for this function:

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