SMACC2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
smacc2::ISmaccComponent Class Reference

#include <component.hpp>

Inheritance diagram for smacc2::ISmaccComponent:
Inheritance graph
Collaboration diagram for smacc2::ISmaccComponent:
Collaboration graph

Public Member Functions

 ISmaccComponent ()
 
virtual ~ISmaccComponent ()
 
virtual std::string getName () const
 

Protected Member Functions

virtual void onInitialize ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
template<typename TComponent >
void requiresComponent (TComponent *&requiredComponentStorage)
 
template<typename TClient >
void requiresClient (TClient *&requiredClientStorage)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createSiblingComponent (TArgs... targs)
 
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * createSiblingNamedComponent (std::string name, TArgs... targs)
 
rclcpp::Node::SharedPtr getNode ()
 
rclcpp::Logger getLogger ()
 
ISmaccStateMachinegetStateMachine ()
 

Protected Attributes

ISmaccStateMachinestateMachine_
 
ISmaccClientowner_
 

Private Member Functions

void initialize (ISmaccClient *owner)
 
void setStateMachine (ISmaccStateMachine *stateMachine)
 

Friends

class ISmaccOrthogonal
 
class ISmaccClient
 

Detailed Description

Definition at line 29 of file component.hpp.

Constructor & Destructor Documentation

◆ ISmaccComponent()

smacc2::ISmaccComponent::ISmaccComponent ( )

Definition at line 27 of file smacc_component.cpp.

27: owner_(nullptr) {}
ISmaccClient * owner_
Definition: component.hpp:77

◆ ~ISmaccComponent()

smacc2::ISmaccComponent::~ISmaccComponent ( )
virtual

Definition at line 25 of file smacc_component.cpp.

25{}

Member Function Documentation

◆ createSiblingComponent()

template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * smacc2::ISmaccComponent::createSiblingComponent ( TArgs...  targs)
protected

Definition at line 49 of file smacc_component_impl.hpp.

50{
51 return this->owner_->createComponent<SmaccComponentType, TOrthogonal, TClient>(targs...);
52}
SmaccComponentType * createComponent(TArgs... targs)

References smacc2::ISmaccClient::createComponent(), and owner_.

Here is the call graph for this function:

◆ createSiblingNamedComponent()

template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs>
SmaccComponentType * smacc2::ISmaccComponent::createSiblingNamedComponent ( std::string  name,
TArgs...  targs 
)
protected

Definition at line 55 of file smacc_component_impl.hpp.

56{
57 return this->owner_->createNamedComponent<SmaccComponentType, TOrthogonal, TClient>(
58 name, targs...);
59}
SmaccComponentType * createNamedComponent(std::string name, TArgs... targs)

References smacc2::ISmaccClient::createNamedComponent(), and owner_.

Here is the call graph for this function:

◆ getLogger()

rclcpp::Logger smacc2::ISmaccComponent::getLogger ( )
protected

Definition at line 44 of file smacc_component.cpp.

44{ return owner_->getLogger(); }
rclcpp::Logger getLogger()

References smacc2::ISmaccClient::getLogger(), and owner_.

Referenced by smacc2::components::CpTopicSubscriber< MessageType >::onInitialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getName()

std::string smacc2::ISmaccComponent::getName ( ) const
virtual

Definition at line 46 of file smacc_component.cpp.

47{
48 std::string keyname = demangleSymbol(typeid(*this).name());
49 return keyname;
50}
std::string demangleSymbol()

References smacc2::introspection::demangleSymbol().

Referenced by smacc2::components::CpTopicSubscriber< MessageType >::onInitialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNode()

rclcpp::Node::SharedPtr smacc2::ISmaccComponent::getNode ( )
protected

Definition at line 42 of file smacc_component.cpp.

42{ return owner_->getNode(); }
rclcpp::Node::SharedPtr getNode()
Definition: client.cpp:60

References smacc2::ISmaccClient::getNode(), and owner_.

Referenced by smacc2::components::CpTopicSubscriber< MessageType >::onInitialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStateMachine()

ISmaccStateMachine * smacc2::ISmaccComponent::getStateMachine ( )
protected

Definition at line 52 of file smacc_component.cpp.

52{ return this->stateMachine_; }
ISmaccStateMachine * stateMachine_
Definition: component.hpp:75

References stateMachine_.

Referenced by smacc2::components::CpTopicSubscriber< MessageType >::onFirstMessageReceived(), and smacc2::components::CpTopicSubscriber< MessageType >::onMessageReceived().

Here is the caller graph for this function:

◆ initialize()

void smacc2::ISmaccComponent::initialize ( ISmaccClient owner)
private

Definition at line 29 of file smacc_component.cpp.

30{
31 owner_ = owner;
32 this->onInitialize();
33}

References onInitialize(), and owner_.

Here is the call graph for this function:

◆ onInitialize()

void smacc2::ISmaccComponent::onInitialize ( )
protectedvirtual

Reimplemented in smacc2::components::CpTopicPublisher< MessageType >, and smacc2::components::CpTopicSubscriber< MessageType >.

Definition at line 35 of file smacc_component.cpp.

35{}

Referenced by initialize().

Here is the caller graph for this function:

◆ onOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void smacc2::ISmaccComponent::onOrthogonalAllocation ( )
inlineprotected

Definition at line 51 of file component.hpp.

52 {
53 }

◆ postEvent() [1/2]

template<typename EventType >
void smacc2::ISmaccComponent::postEvent ( )
protected

Referenced by smacc2::components::CpTopicSubscriber< MessageType >::onOrthogonalAllocation().

Here is the caller graph for this function:

◆ postEvent() [2/2]

template<typename EventType >
void smacc2::ISmaccComponent::postEvent ( const EventType &  ev)
protected

Definition at line 31 of file smacc_component_impl.hpp.

32{
34}
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)

References smacc2::ISmaccStateMachine::postEvent(), and stateMachine_.

Here is the call graph for this function:

◆ requiresClient()

template<typename TClient >
void smacc2::ISmaccComponent::requiresClient ( TClient *&  requiredClientStorage)
protected

Definition at line 43 of file smacc_component_impl.hpp.

44{
45 this->owner_->requiresClient(requiredClientStorage);
46}
void requiresClient(SmaccClientType *&storage)

References owner_, and smacc2::ISmaccClient::requiresClient().

Here is the call graph for this function:

◆ requiresComponent()

template<typename TComponent >
void smacc2::ISmaccComponent::requiresComponent ( TComponent *&  requiredComponentStorage)
protected

Definition at line 37 of file smacc_component_impl.hpp.

38{
39 requiredComponentStorage = this->owner_->getComponent<TComponent>();
40}
TComponent * getComponent()

References smacc2::ISmaccClient::getComponent(), and owner_.

Here is the call graph for this function:

◆ setStateMachine()

void smacc2::ISmaccComponent::setStateMachine ( ISmaccStateMachine stateMachine)
private

Definition at line 37 of file smacc_component.cpp.

38{
39 stateMachine_ = stateMachine;
40}

References stateMachine_.

Friends And Related Function Documentation

◆ ISmaccClient

friend class ISmaccClient
friend

Definition at line 88 of file component.hpp.

◆ ISmaccOrthogonal

friend class ISmaccOrthogonal
friend

Definition at line 87 of file component.hpp.

Member Data Documentation

◆ owner_

ISmaccClient* smacc2::ISmaccComponent::owner_
protected

◆ stateMachine_

ISmaccStateMachine* smacc2::ISmaccComponent::stateMachine_
protected

Definition at line 75 of file component.hpp.

Referenced by getStateMachine(), postEvent(), and setStateMachine().


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