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

A StateSnapshot keeper for DetectorGraph TopicStates. More...

Collaboration diagram for DetectorGraph::GraphStateStore:

Public Member Functions

 GraphStateStore ()
 Constructs an empty graph store. More...
 
 ~GraphStateStore ()
 Default Destructor. More...
 
void TakeNewSnapshot (const std::list< ptr::shared_ptr< const TopicState > > &arTopicStates)
 Takes a new state snapshot and appends it to the look back queue. More...
 
ptr::shared_ptr< const StateSnapshotGetLastState () const
 Returns a safe shared pointer to the latest complete StateSnapshot. More...
 

Detailed Description

A StateSnapshot keeper for DetectorGraph TopicStates.

This class is responsible for maintaining a look back queue of previous graph states (in the form of StateSnapshots) in a no-duplication and safe-sharing fashion.

Definition at line 36 of file graphstatestore.hpp.

Constructor & Destructor Documentation

◆ GraphStateStore()

DetectorGraph::GraphStateStore::GraphStateStore ( )

Constructs an empty graph store.

Definition at line 20 of file graphstatestore.cpp.

◆ ~GraphStateStore()

DetectorGraph::GraphStateStore::~GraphStateStore ( )

Default Destructor.

Note that this destructor doesn't explicitly delete any of the StateSnapshots in mStatesLookbackQueue since that's implicitly handled by the ptr::shared_ptrs.

Definition at line 26 of file graphstatestore.cpp.

Member Function Documentation

◆ GetLastState()

ptr::shared_ptr< const StateSnapshot > DetectorGraph::GraphStateStore::GetLastState ( ) const

Returns a safe shared pointer to the latest complete StateSnapshot.

Always returns a valid ptr::shared_ptr even though the StateSnapshot might be empty.

Definition at line 47 of file graphstatestore.cpp.

◆ TakeNewSnapshot()

void DetectorGraph::GraphStateStore::TakeNewSnapshot ( const std::list< ptr::shared_ptr< const TopicState > > &  arTopicStates)

Takes a new state snapshot and appends it to the look back queue.

This method takes a graph output list and combines it with the previous StateSnapshot (if existent) to generate a new StateSnapshot.

Definition at line 30 of file graphstatestore.cpp.


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