DUNE: Uniform Navigational Environment  2016.09.0
Plan::Engine::ComponentActiveTime Class Reference

Detailed Description

Class to handle each component's active time.

Public Types

typedef std::pair< const
std::string, float > 
ActiveTime
 
typedef std::map< std::string,
float > 
ATMap
 
typedef ATMap::const_iterator const_iterator
 

Public Member Functions

 ComponentActiveTime (void)
 
 ~ComponentActiveTime (void)
 
void addActiveTime (const std::string &id, float value)
 
void subtractActiveTime (const std::string &id, float value)
 
float getActiveTime (const std::string &id) const
 
void clear (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 

Member Typedef Documentation

typedef std::pair<const std::string, float> Plan::Engine::ComponentActiveTime::ActiveTime

Pair of string to float.

typedef std::map<std::string, float> Plan::Engine::ComponentActiveTime::ATMap

Map of strings to floats.

Const iterator.

Constructor & Destructor Documentation

Plan::Engine::ComponentActiveTime::ComponentActiveTime ( void  )
inline

Constructor.

Plan::Engine::ComponentActiveTime::~ComponentActiveTime ( void  )
inline

Destructor.

Member Function Documentation

void Plan::Engine::ComponentActiveTime::addActiveTime ( const std::string &  id,
float  value 
)
inline

Add a component's active time to the list.

Parameters
[in]idcomponent name
[in]valuetime active in seconds

Referenced by Plan::Engine::ActionSchedule::fillComponentActiveTime().

const_iterator Plan::Engine::ComponentActiveTime::begin ( void  ) const
inline

First position of the vector.

Returns
const iterator to begin()

Referenced by Plan::Engine::PreStatistics::fill().

void Plan::Engine::ComponentActiveTime::clear ( void  )
inline
const_iterator Plan::Engine::ComponentActiveTime::end ( void  ) const
inline

Last position of the vector.

Returns
const iterator to end()

Referenced by Plan::Engine::PreStatistics::fill().

float Plan::Engine::ComponentActiveTime::getActiveTime ( const std::string &  id) const
inline

Get component's active time.

Parameters
[in]idcomponent name
Returns
active time, -1.0 if cannot find id
void Plan::Engine::ComponentActiveTime::subtractActiveTime ( const std::string &  id,
float  value 
)
inline

Subtract active time from a component.

Parameters
[in]idcomponent name
[in]valuetime active to subtract in seconds

Referenced by Plan::Engine::ActionSchedule::fillComponentActiveTime().

Collaboration diagram for Plan::Engine::ComponentActiveTime:
Collaboration graph