Ignition Gazebo

API Reference

1.0.2

Base class for all components. More...

#include <Component.hh>

Public Member Functions

 BaseComponent ()=default
 Default constructor. More...
 
virtual ~BaseComponent ()=default
 Default destructor. More...
 
virtual ComponentTypeId TypeId () const =0
 Returns the unique ID for the component's type. The ID is derived from the name that is manually chosen during the Factory registration and is guaranteed to be the same across compilers and runs. More...
 

Protected Member Functions

virtual void Deserialize (std::istream &)
 Fills a component based on a stream with a serialized data. By default, it will do nothing. Derived classes should override this function to support deserialization. More...
 
virtual void Serialize (std::ostream &) const
 Fills a stream with a serialized version of the component. By default, it will leave the stream empty. Derived classes should override this function to support serialization. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const BaseComponent &_component)
 Stream insertion operator. It exposes the component's serialized state which can be recreated by operator>>. More...
 
std::istream & operator>> (std::istream &_in, BaseComponent &_component)
 Stream extraction operator. It parses the component's serialized state which is created by operator<<. More...
 

Detailed Description

Base class for all components.

Constructor & Destructor Documentation

◆ BaseComponent()

BaseComponent ( )
default

Default constructor.

◆ ~BaseComponent()

virtual ~BaseComponent ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ Deserialize()

virtual void Deserialize ( std::istream &  )
inlineprotectedvirtual

Fills a component based on a stream with a serialized data. By default, it will do nothing. Derived classes should override this function to support deserialization.

Reimplemented in Component< DataType, Identifier >, and LevelEntityNames.

◆ Serialize()

virtual void Serialize ( std::ostream &  ) const
inlineprotectedvirtual

Fills a stream with a serialized version of the component. By default, it will leave the stream empty. Derived classes should override this function to support serialization.

Reimplemented in Component< DataType, Identifier >, and LevelEntityNames.

◆ TypeId()

virtual ComponentTypeId TypeId ( ) const
pure virtual

Returns the unique ID for the component's type. The ID is derived from the name that is manually chosen during the Factory registration and is guaranteed to be the same across compilers and runs.

Implemented in Component< NoData, Identifier >, and Component< DataType, Identifier >.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  _out,
const BaseComponent _component 
)
friend

Stream insertion operator. It exposes the component's serialized state which can be recreated by operator>>.

◆ operator>>

std::istream& operator>> ( std::istream &  _in,
BaseComponent _component 
)
friend

Stream extraction operator. It parses the component's serialized state which is created by operator<<.


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