DetectorGraph  2.0
Public Member Functions | List of all members
DetectorGraph::StateSnapshot Class Reference

The collection of TopicStates that represents the graph state so far. More...

Collaboration diagram for DetectorGraph::StateSnapshot:

Public Member Functions

 StateSnapshot ()
 T=0 Constructor. More...
 
 StateSnapshot (const std::list< ptr::shared_ptr< const TopicState > > &arTopicStates)
 T=0 Priming Constructor. More...
 
 StateSnapshot (const StateSnapshot &arPreviousState, const std::list< ptr::shared_ptr< const TopicState > > &arTopicStates)
 T>0 Constructor. More...
 
 ~StateSnapshot ()
 Destructor. More...
 
ptr::shared_ptr< const TopicStateGetState (TopicStateIdType aId) const
 Returns a TopicState for a given Id. More...
 
template<class T >
ptr::shared_ptr< const T > GetState () const
 Returns the specific TopicState for a given its type. More...
 
size_t GetMapSize () const
 Returns the number of TopicStates in the Snapshot. More...
 
unsigned int GetStateVersion () const
 Returns the version of this snapshot. More...
 
void GetTopicStates (std::list< ptr::shared_ptr< const TopicState > > &aOutTopicStateList) const
 Gets TopicStates stored in this snapshot. More...
 

Detailed Description

The collection of TopicStates that represents the graph state so far.

Responsible for conveying and composing a complete state set in the form of a collection of TopicState shared_ptrs.

Definition at line 34 of file statesnapshot.hpp.

Constructor & Destructor Documentation

◆ StateSnapshot() [1/3]

DetectorGraph::StateSnapshot::StateSnapshot ( )

T=0 Constructor.

Builds an initial and empty StateSnapshot.

Definition at line 23 of file statesnapshot.cpp.

◆ StateSnapshot() [2/3]

DetectorGraph::StateSnapshot::StateSnapshot ( const std::list< ptr::shared_ptr< const TopicState > > &  arTopicStates)

T=0 Priming Constructor.

Builds a prime StateSnapshot from a TopicState list.

Definition at line 29 of file statesnapshot.cpp.

◆ StateSnapshot() [3/3]

DetectorGraph::StateSnapshot::StateSnapshot ( const StateSnapshot arPreviousState,
const std::list< ptr::shared_ptr< const TopicState > > &  arTopicStates 
)

T>0 Constructor.

Builds a StateSnapshot from a previous StateSnapshot and an output list.

Definition at line 36 of file statesnapshot.cpp.

◆ ~StateSnapshot()

DetectorGraph::StateSnapshot::~StateSnapshot ( )

Destructor.

Note that the shared ptrs held by a snapshot are implicitly released by normal shared_ptr destructors.

Definition at line 86 of file statesnapshot.cpp.

Member Function Documentation

◆ GetMapSize()

size_t DetectorGraph::StateSnapshot::GetMapSize ( ) const

Returns the number of TopicStates in the Snapshot.

Definition at line 111 of file statesnapshot.cpp.

◆ GetState() [1/2]

ptr::shared_ptr< const TopicState > DetectorGraph::StateSnapshot::GetState ( TopicStateIdType  aId) const

Returns a TopicState for a given Id.

Or an empty shared_ptr in case no state with that Id exists.

Definition at line 90 of file statesnapshot.cpp.

◆ GetState() [2/2]

template<class T >
ptr::shared_ptr<const T> DetectorGraph::StateSnapshot::GetState ( ) const
inline

Returns the specific TopicState for a given its type.

Or an empty shared_ptr in case no state with that Id exists.

Definition at line 79 of file statesnapshot.hpp.

◆ GetStateVersion()

unsigned int DetectorGraph::StateSnapshot::GetStateVersion ( ) const

Returns the version of this snapshot.

A Snapshot version is a unique positive integer that is incremented at every new Snapshot creation.

Definition at line 116 of file statesnapshot.cpp.

◆ GetTopicStates()

void DetectorGraph::StateSnapshot::GetTopicStates ( std::list< ptr::shared_ptr< const TopicState > > &  aOutTopicStateList) const

Gets TopicStates stored in this snapshot.

Fills aOutTopicStateList with all public TopicStates stored in this Snapshot. This can be useful for merging the contents of this snapshot into another.

Definition at line 100 of file statesnapshot.cpp.


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