SMACC2
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 addClientBehavior (std::shared_ptr< smacc2::ISmaccClientBehavior > clientBehavior)
 
void runtimeConfigure ()
 
void onEntry ()
 
void onExit ()
 
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::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 ()
 
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 163 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 167 of file smacc_orthogonal_impl.hpp.

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

References generate_debs::args, 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: