Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::cyber::Component< M0, M1, M2, M3 > Class Template Referenceabstract

The Component can process up to four channels of messages. The message type is specified when the component is created. The Component is inherited from ComponentBase. Your component can inherit from Component, and implement Init() & Proc(...), They are picked up by the CyberRT. There are 4 specialization implementations. More...

#include <component.h>

Inheritance diagram for apollo::cyber::Component< M0, M1, M2, M3 >:
Inheritance graph
Collaboration diagram for apollo::cyber::Component< M0, M1, M2, M3 >:
Collaboration graph

Public Member Functions

 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object. More...
 
bool Process (const std::shared_ptr< M0 > &msg0, const std::shared_ptr< M1 > &msg1, const std::shared_ptr< M2 > &msg2, const std::shared_ptr< M3 > &msg3)
 
- Public Member Functions inherited from apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

Additional Inherited Members

- Public Types inherited from apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected Member Functions inherited from apollo::cyber::ComponentBase
virtual bool Init ()=0
 
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected Attributes inherited from apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

Detailed Description

template<typename M0 = NullType, typename M1 = NullType, typename M2 = NullType, typename M3 = NullType>
class apollo::cyber::Component< M0, M1, M2, M3 >

The Component can process up to four channels of messages. The message type is specified when the component is created. The Component is inherited from ComponentBase. Your component can inherit from Component, and implement Init() & Proc(...), They are picked up by the CyberRT. There are 4 specialization implementations.

Template Parameters
M0the first message.
M1the second message.
M2the third message.
M3the fourth message.
Warning
The Init & Proc functions need to be overloaded, but don't want to be called. They are called by the CyberRT Frame.

Constructor & Destructor Documentation

◆ Component()

template<typename M0 = NullType, typename M1 = NullType, typename M2 = NullType, typename M3 = NullType>
apollo::cyber::Component< M0, M1, M2, M3 >::Component ( )
inline

◆ ~Component()

template<typename M0 = NullType, typename M1 = NullType, typename M2 = NullType, typename M3 = NullType>
apollo::cyber::Component< M0, M1, M2, M3 >::~Component ( )
inlineoverride

Member Function Documentation

◆ Initialize()

template<typename M0 , typename M1 , typename M2 , typename M3 >
bool apollo::cyber::Component< M0, M1, M2, M3 >::Initialize ( const ComponentConfig &  config)
inlineoverridevirtual

init the component by protobuf object.

Parameters
configwhich is defined in 'cyber/proto/component_conf.proto'
Returns
returns true if successful, otherwise returns false

Reimplemented from apollo::cyber::ComponentBase.

◆ Process()

template<typename M0, typename M1, typename M2, typename M3>
bool apollo::cyber::Component< M0, M1, M2, M3 >::Process ( const std::shared_ptr< M0 > &  msg0,
const std::shared_ptr< M1 > &  msg1,
const std::shared_ptr< M2 > &  msg2,
const std::shared_ptr< M3 > &  msg3 
)

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