Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Attributes | List of all members
apollo::cyber::ReaderBase Class Referenceabstract

Base Class for Reader Reader is identified by one apollo::cyber::proto::RoleAttribute, it contains the channel_name, channel_id that we subscribe, and host_name, process_id and node that we are located, and qos that describes our transportation quality. More...

#include <reader_base.h>

Inheritance diagram for apollo::cyber::ReaderBase:
Inheritance graph
Collaboration diagram for apollo::cyber::ReaderBase:
Collaboration graph

Public Member Functions

 ReaderBase (const proto::RoleAttributes &role_attr)
 
virtual ~ReaderBase ()
 
virtual bool Init ()=0
 Init the Reader object. More...
 
virtual void Shutdown ()=0
 Shutdown the Reader object. More...
 
virtual void ClearData ()=0
 Clear local data. More...
 
virtual void Observe ()=0
 Get stored data. More...
 
virtual bool Empty () const =0
 Query whether the Reader has data to be handled. More...
 
virtual bool HasReceived () const =0
 Query whether we have received data since last clear. More...
 
virtual double GetDelaySec () const =0
 Get time interval of since last receive message. More...
 
virtual uint32_t PendingQueueSize () const =0
 Get the value of pending queue size. More...
 
virtual bool HasWriter ()
 Query is there any writer that publish the subscribed channel. More...
 
virtual void GetWriters (std::vector< proto::RoleAttributes > *writers)
 Get all writers pushlish the channel we subscribes. More...
 
const std::string & GetChannelName () const
 Get Reader's Channel name. More...
 
uint64_t ChannelId () const
 Get Reader's Channel id. More...
 
const proto::QosProfile & QosProfile () const
 Get qos profile. You can see qos description. More...
 
bool IsInit () const
 Query whether the Reader is initialized. More...
 

Protected Attributes

proto::RoleAttributes role_attr_
 
std::atomic< bool > init_
 

Detailed Description

Base Class for Reader Reader is identified by one apollo::cyber::proto::RoleAttribute, it contains the channel_name, channel_id that we subscribe, and host_name, process_id and node that we are located, and qos that describes our transportation quality.

Constructor & Destructor Documentation

◆ ReaderBase()

apollo::cyber::ReaderBase::ReaderBase ( const proto::RoleAttributes &  role_attr)
inlineexplicit

◆ ~ReaderBase()

virtual apollo::cyber::ReaderBase::~ReaderBase ( )
inlinevirtual

Member Function Documentation

◆ ChannelId()

uint64_t apollo::cyber::ReaderBase::ChannelId ( ) const
inline

Get Reader's Channel id.

Returns
uint64_t channel id

◆ ClearData()

virtual void apollo::cyber::ReaderBase::ClearData ( )
pure virtual

◆ Empty()

virtual bool apollo::cyber::ReaderBase::Empty ( ) const
pure virtual

Query whether the Reader has data to be handled.

Returns
true if data container is empty
false if data container has data

Implemented in apollo::cyber::Reader< MessageT >, and apollo::cyber::blocker::IntraReader< MessageT >.

◆ GetChannelName()

const std::string& apollo::cyber::ReaderBase::GetChannelName ( ) const
inline

Get Reader's Channel name.

Returns
const std::string& channel name

◆ GetDelaySec()

virtual double apollo::cyber::ReaderBase::GetDelaySec ( ) const
pure virtual

Get time interval of since last receive message.

Returns
double seconds delay

Implemented in apollo::cyber::Reader< MessageT >.

◆ GetWriters()

virtual void apollo::cyber::ReaderBase::GetWriters ( std::vector< proto::RoleAttributes > *  writers)
inlinevirtual

Get all writers pushlish the channel we subscribes.

Parameters
writersresult RoleAttributes vector

Reimplemented in apollo::cyber::Reader< MessageT >.

◆ HasReceived()

virtual bool apollo::cyber::ReaderBase::HasReceived ( ) const
pure virtual

Query whether we have received data since last clear.

Returns
true if the reader has received data
false if the reader has not received data

Implemented in apollo::cyber::Reader< MessageT >, and apollo::cyber::blocker::IntraReader< MessageT >.

◆ HasWriter()

virtual bool apollo::cyber::ReaderBase::HasWriter ( )
inlinevirtual

Query is there any writer that publish the subscribed channel.

Returns
true if there is at least one Writer publish the channel
false if there is no Writer publish the channel

Reimplemented in apollo::cyber::Reader< MessageT >.

◆ Init()

virtual bool apollo::cyber::ReaderBase::Init ( )
pure virtual

Init the Reader object.

Returns
true if init successfully
false if init failed

Implemented in apollo::cyber::Reader< MessageT >, and apollo::cyber::blocker::IntraReader< MessageT >.

◆ IsInit()

bool apollo::cyber::ReaderBase::IsInit ( ) const
inline

Query whether the Reader is initialized.

Returns
true if the Reader has been inited
false if the Reader has not been inited

◆ Observe()

virtual void apollo::cyber::ReaderBase::Observe ( )
pure virtual

◆ PendingQueueSize()

virtual uint32_t apollo::cyber::ReaderBase::PendingQueueSize ( ) const
pure virtual

Get the value of pending queue size.

Returns
uint32_t result value

Implemented in apollo::cyber::Reader< MessageT >.

◆ QosProfile()

const proto::QosProfile& apollo::cyber::ReaderBase::QosProfile ( ) const
inline

Get qos profile. You can see qos description.

Returns
const proto::QosProfile& result qos

◆ Shutdown()

virtual void apollo::cyber::ReaderBase::Shutdown ( )
pure virtual

Member Data Documentation

◆ init_

std::atomic<bool> apollo::cyber::ReaderBase::init_
protected

◆ role_attr_

proto::RoleAttributes apollo::cyber::ReaderBase::role_attr_
protected

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