Public Member Functions

TRTK::Timestamp::ObjectInfo Class Reference

This class is a helper class for the Timestamp class and holds various information of an object like the timestamp, its dependencies etc. More...

#include <Timestamp.hpp>

Collaboration diagram for TRTK::Timestamp::ObjectInfo:

List of all members.

Public Member Functions

 ObjectInfo ()
 Do not use it; it will cause an assertion to fire!
 ObjectInfo (Timestamp &parent_collection)
virtual ~ObjectInfo ()
void addDependency (const std::string &object_name)
 Adds dependencies to the given object.
void removeDependency (const std::string &object_name)
 Removes dependencies from a given object.
bool dependenciesHaveChanged () const
 Check timestamp of all dependencies.
bool dependencyHasChanged (const std::string &other_object) const
 Check timestamp of a single dependency.
bool isMoreRecentThan (const std::string &object, bool dependencies=true) const
void update ()
 Updates the timestamp of the object.

Detailed Description

This class is a helper class for the Timestamp class and holds various information of an object like the timestamp, its dependencies etc.

Author:
Christoph Haenisch

Definition at line 215 of file Timestamp.hpp.


Constructor & Destructor Documentation

TRTK::Timestamp::ObjectInfo::ObjectInfo (  )

Do not use it; it will cause an assertion to fire!

Constructs an invalid ObjectInfo object.

This constructor must be defined to allow the use of ObjectInfo objects in certain associative containers of the STL. Nevertheless add only otherwise initialized objects...

Definition at line 96 of file Timestamp.cpp.

TRTK::Timestamp::ObjectInfo::ObjectInfo ( Timestamp parent_collection )

Constructs an ObjectInfo object.

Definition at line 107 of file Timestamp.cpp.

TRTK::Timestamp::ObjectInfo::~ObjectInfo (  ) [virtual]

Destroys an ObjectInfo object.

Definition at line 116 of file Timestamp.cpp.


Member Function Documentation

void TRTK::Timestamp::ObjectInfo::addDependency ( const std::string &  object_name )

Adds dependencies to the given object.

Parameters:
[in]object_namename of the object to be processed

This allows you to check if some required objects were already set up or up-to-date (providing you use the timestamp mechanism consistently).

See also:
removeDependency()

Definition at line 131 of file Timestamp.cpp.

bool TRTK::Timestamp::ObjectInfo::dependenciesHaveChanged (  ) const

Check timestamp of all dependencies.

Check if the timestamps of all dependencies are further back in time than the timestamp of this object.

Returns:
true if one or more dependencies were not set up so far or if they are outdated
See also:
dependencyHasChanged()

Definition at line 148 of file Timestamp.cpp.

bool TRTK::Timestamp::ObjectInfo::dependencyHasChanged ( const std::string &  other_object ) const

Check timestamp of a single dependency.

Check if the timestamp of a single dependency is further back in time than the timestamp of this object (checking is done recursively, though).

Returns:
true if the dependency was not set up so far or if it is outdated
See also:
dependenciesHaveChanged()

Definition at line 177 of file Timestamp.cpp.

bool TRTK::Timestamp::ObjectInfo::isMoreRecentThan ( const std::string &  object,
bool  dependencies = true 
) const

Checks if the timestamp of the given object is further back in time than the one of *this.

If dependencies is set to true, dependencies of object are regarded as well, i.e. if any dependency is more recent than *this then false is returned.

Parameters:
[in]other_objectobject to check against
[in]dependenciesspecifies if dependencies shall be checked as well
Returns:
boolean

Definition at line 240 of file Timestamp.cpp.

void TRTK::Timestamp::ObjectInfo::removeDependency ( const std::string &  object_name )

Removes dependencies from a given object.

Parameters:
[in]object_namename of the object to be processed
See also:
addDependency()

Definition at line 286 of file Timestamp.cpp.

void TRTK::Timestamp::ObjectInfo::update (  )

Updates the timestamp of the object.

Parameters:
[in]object_namename of the object to be processed

Definition at line 297 of file Timestamp.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines