SMACC2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 166 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 170 of file smacc_orthogonal_impl.hpp.

171 {
172 //static_assert(std::is_base_of<ISmaccOrthogonal, TOrthogonal>::value, "The object Tag must be the orthogonal type where the client was created");
173 // if (typeid(*this) != typeid(TOrthogonal))
174 // {
175 // 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");
176 // return nullptr;
177 // }
178
179 RCLCPP_INFO(
180 getLogger(), "[%s] creating client object, type:'%s' object tag: '%s'",
181 demangleType(typeid(*this)).c_str(), demangledTypeName<TClient>().c_str(),
182 demangledTypeName<TOrthogonal>().c_str());
183
184 auto client = std::make_shared<ClientHandler<TOrthogonal, TClient>>(args...);
185 this->template assignClientToOrthogonal<TOrthogonal, TClient>(client.get());
186
187 // it is stored the client (not the client handler)
188 clients_.push_back(client);
189
190 return client;
191 }
std::vector< std::shared_ptr< smacc2::ISmaccClient > > clients_
std::string demangleType(const std::type_info *tinfo)

References smacc2::ISmaccOrthogonal::clients_, 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: