DUNE: Uniform Navigational Environment  2019.02.1
DUNE::IMC::MessageList< Type > Class Template Reference

Detailed Description

template<typename Type>
class DUNE::IMC::MessageList< Type >

Message list.

Public Types

typedef std::vector< Type * >::const_iterator const_iterator
 

Public Member Functions

 MessageList (void)
 
 MessageList (const MessageList &other)
 
 ~MessageList (void)
 
void setParent (const Message *parent)
 
void clear (void)
 
size_t size (void) const
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
void push_back (const Type &msg)
 
void push_back (const Type *msg)
 
unsigned getSerializationSize (void) const
 
MessageListoperator= (const MessageList &other)
 
bool operator== (const MessageList &other) const
 
bool operator!= (const MessageList &other) const
 
uint16_t serialize (uint8_t *bfr) const
 
uint16_t deserialize (const uint8_t *bfr, uint16_t &bfr_len)
 
uint16_t reverseDeserialize (const uint8_t *bfr, uint16_t &bfr_len)
 
void toJSON (std::ostream &os, const char *label, unsigned nindent, char prefix= ',') const
 
void setTimeStamp (double value)
 
void setSource (uint16_t value)
 
void setSourceEntity (uint8_t value)
 
void setDestination (uint16_t value)
 
void setDestinationEntity (uint8_t value)
 

Member Typedef Documentation

template<typename Type>
typedef std::vector<Type*>::const_iterator DUNE::IMC::MessageList< Type >::const_iterator

Constructor & Destructor Documentation

template<typename Type>
DUNE::IMC::MessageList< Type >::MessageList ( void  )
inline

Default constructor.

template<typename Type>
DUNE::IMC::MessageList< Type >::MessageList ( const MessageList< Type > &  other)
inline

Copy constructor.

Copy the contents of other to this instance.

Parameters
[in]othermessage.
template<typename Type>
DUNE::IMC::MessageList< Type >::~MessageList ( void  )
inline

Default destructor.

Member Function Documentation

template<typename Type>
const_iterator DUNE::IMC::MessageList< Type >::begin ( void  ) const
inline

Return an iterator referring to the first element in the list container.

Returns
iterator.

Referenced by DUNE::Maneuvers::VehicleFormation::onUpdateParameters(), and DUNE::Maneuvers::FollowTrajectory::onUpdateParameters().

template<typename Type>
void DUNE::IMC::MessageList< Type >::clear ( void  )
inline

All the elements of the list are deleted: their destructors are called, and then they are removed from the vector container, leaving the container with a size of 0.

Referenced by DUNE::IMC::MessageList< DUNE::IMC::VehicleFormationParticipant >::setDestinationEntity(), and DUNE::IMC::MessageList< DUNE::IMC::VehicleFormationParticipant >::~MessageList().

template<typename Type>
uint16_t DUNE::IMC::MessageList< Type >::deserialize ( const uint8_t *  bfr,
uint16_t &  bfr_len 
)
inline

Deserialize message from byte buffer.

Parameters
[in]bfrbuffer.
[in]bfr_lenbuffer size.
Returns
amount of deserialized bytes.
template<typename Type>
const_iterator DUNE::IMC::MessageList< Type >::end ( void  ) const
inline

Returns an iterator referring to the past-the-end element in the list container.

Returns
iterator.

Referenced by DUNE::Navigation::UsblTools::Node::consume(), DUNE::Maneuvers::VehicleFormation::onUpdateParameters(), and DUNE::Maneuvers::FollowTrajectory::onUpdateParameters().

template<typename Type>
unsigned DUNE::IMC::MessageList< Type >::getSerializationSize ( void  ) const
inline

Retrieve the amount of bytes needed to serialize the object.

Returns
amount of bytes needed for serialization.

Referenced by DUNE::IMC::MsgList::getVariableSerializationSize(), DUNE::IMC::LogBookControl::getVariableSerializationSize(), DUNE::IMC::VerticalProfile::getVariableSerializationSize(), DUNE::IMC::HistoricData::getVariableSerializationSize(), DUNE::IMC::LblConfig::getVariableSerializationSize(), DUNE::IMC::Distance::getVariableSerializationSize(), DUNE::IMC::SonarData::getVariableSerializationSize(), DUNE::IMC::FollowPath::getVariableSerializationSize(), DUNE::IMC::FollowTrajectory::getVariableSerializationSize(), DUNE::IMC::VehicleFormation::getVariableSerializationSize(), DUNE::IMC::CoverArea::getVariableSerializationSize(), DUNE::IMC::FormationParameters::getVariableSerializationSize(), DUNE::IMC::FormationMonitor::getVariableSerializationSize(), DUNE::IMC::Formation::getVariableSerializationSize(), DUNE::IMC::AutonomousSection::getVariableSerializationSize(), DUNE::IMC::PlanManeuver::getVariableSerializationSize(), DUNE::IMC::PlanTransition::getVariableSerializationSize(), DUNE::IMC::PlanSpecification::getVariableSerializationSize(), DUNE::IMC::PlanDBState::getVariableSerializationSize(), DUNE::IMC::MapFeature::getVariableSerializationSize(), DUNE::IMC::Map::getVariableSerializationSize(), DUNE::IMC::VehicleLinks::getVariableSerializationSize(), DUNE::IMC::TrexToken::getVariableSerializationSize(), DUNE::IMC::TrexPlan::getVariableSerializationSize(), DUNE::IMC::EntityParameters::getVariableSerializationSize(), DUNE::IMC::SetEntityParameters::getVariableSerializationSize(), DUNE::IMC::SoiPlan::getVariableSerializationSize(), DUNE::IMC::UsblConfig::getVariableSerializationSize(), and DUNE::IMC::MessageList< DUNE::IMC::VehicleFormationParticipant >::serialize().

template<typename Type>
bool DUNE::IMC::MessageList< Type >::operator!= ( const MessageList< Type > &  other) const
inline

Compare two instances for inequality.

Parameters
[in]otherobject to compare.
Returns
true if objects are not equal, false otherwise.
template<typename Type>
MessageList& DUNE::IMC::MessageList< Type >::operator= ( const MessageList< Type > &  other)
inline

Assignment operator.

Replace the contents of 'this' instance with the contents of 'other'.

Parameters
[in]othermessage.
Returns
reference to this object.
template<typename Type>
bool DUNE::IMC::MessageList< Type >::operator== ( const MessageList< Type > &  other) const
inline

Compare two instances for equality.

Parameters
[in]otherobject to compare.
Returns
true if objects are equal, false otherwise.
template<typename Type>
void DUNE::IMC::MessageList< Type >::push_back ( const Type &  msg)
inline

Add a new element at the end of the list, after its current last element.

The content of this new element is initialized to a copy of 'msg'.

Parameters
[in]msgmessage.

Referenced by DUNE::Parsers::PlanConfigParser::parse(), DUNE::Parsers::PlanConfigParser::parseActions(), and DUNE::IMC::MessageList< DUNE::IMC::VehicleFormationParticipant >::push_back().

template<typename Type>
void DUNE::IMC::MessageList< Type >::push_back ( const Type *  msg)
inline

Add a new element at the end of the list, after its current last element.

The content of this new element is initialized to 'msg'.

Parameters
[in]msgpointer to message.
template<typename Type>
uint16_t DUNE::IMC::MessageList< Type >::reverseDeserialize ( const uint8_t *  bfr,
uint16_t &  bfr_len 
)
inline
template<typename Type>
uint16_t DUNE::IMC::MessageList< Type >::serialize ( uint8_t *  bfr) const
inline

Serialize instance.

Parameters
[in]bfrbuffer.
Returns
amount of bytes used.
template<typename Type>
void DUNE::IMC::MessageList< Type >::setDestination ( uint16_t  value)
inline
template<typename Type>
void DUNE::IMC::MessageList< Type >::setDestinationEntity ( uint8_t  value)
inline
template<typename Type>
void DUNE::IMC::MessageList< Type >::setParent ( const Message parent)
inline

Set the parent of the message list.

This object will be used to synchronize the header fields of the messages in the list.

Parameters
[in]parentmessage list parent.
template<typename Type>
void DUNE::IMC::MessageList< Type >::setSource ( uint16_t  value)
inline
template<typename Type>
void DUNE::IMC::MessageList< Type >::setSourceEntity ( uint8_t  value)
inline
template<typename Type>
void DUNE::IMC::MessageList< Type >::setTimeStamp ( double  value)
inline
template<typename Type>
size_t DUNE::IMC::MessageList< Type >::size ( void  ) const
inline

Retrieve the number of elements in this list.

Returns
number of elements in the list.

Referenced by DUNE::IMC::MessageList< DUNE::IMC::VehicleFormationParticipant >::operator==().

template<typename Type>
void DUNE::IMC::MessageList< Type >::toJSON ( std::ostream &  os,
const char *  label,
unsigned  nindent,
char  prefix = ',' 
) const
inline
Collaboration diagram for DUNE::IMC::MessageList< Type >:
Collaboration graph