DetectorGraph  2.0
Public Types | Public Member Functions | List of all members
DetectorGraph::Topic< T > Class Template Reference

Manage data and its handler. More...

Collaboration diagram for DetectorGraph::Topic< T >:

Public Types

typedef std::vector< T > ValuesContainer
 
- Public Types inherited from DetectorGraph::Vertex
enum  VertexSearchState { kVertexClear, kVertexProcessing, kVertexDone }
 Enum used for topological sort & traverse context keeping. More...
 
enum  VertexType { kTopicVertex, kDetectorVertex, kTestVertex }
 
typedef std::list< Vertex * > VertexPtrContainer
 

Public Member Functions

 Topic ()
 
void Publish (const T &arPayload)
 Append data to its vector. More...
 
virtual void ProcessVertex ()
 
void DispatchIntoSubscriber (SubscriberInterface< T > *aSubscriber)
 Pass pending data to its handler. More...
 
bool HasNewValue () const
 Returns true if the new Data is available. More...
 
const T & GetNewValue () const
 Returns reference to the new/latest value in the topic. More...
 
const ValuesContainerGetCurrentValues () const
 
virtual ~Topic ()
 
virtual TopicStateIdType GetId () const
 
virtual std::list< ptr::shared_ptr< const TopicState > > GetCurrentTopicStates () const
 
- Public Member Functions inherited from DetectorGraph::BaseTopic
virtual VertexType GetVertexType () const
 
- Public Member Functions inherited from DetectorGraph::Vertex
 Vertex ()
 
virtual ~Vertex ()
 
VertexSearchState GetState () const
 
void SetState (VertexSearchState aNewState)
 
void InsertEdge (Vertex *aVertex)
 
void RemoveEdge (Vertex *aVertex)
 
VertexPtrContainerGetOutEdges ()
 
void MarkFutureEdge (Vertex *aVertex)
 
VertexPtrContainerGetInEdges ()
 
VertexPtrContainerGetFutureOutEdges ()
 
VertexPtrContainerGetFutureInEdges ()
 
const char * GetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from DetectorGraph::BaseTopic
void MarkChildrenState (VertexSearchState aNewState)
 
- Protected Attributes inherited from DetectorGraph::Vertex
VertexSearchState mState
 
VertexPtrContainer mOutEdges
 
VertexPtrContainer mInEdges
 
VertexPtrContainer mFutureOutEdges
 
VertexPtrContainer mFutureInEdges
 

Detailed Description

template<class T>
class DetectorGraph::Topic< T >

Manage data and its handler.

It is a data transport system with publish / subscribe semantics.

Internals

std::vector<T> mCurrentValues is the holder for current values in the topic.

This vector is cleared once per evaluation at either:

The intended behavior is to have this vector always contain all the data for a single evaluation pass - or nothing if that's the case.

Definition at line 84 of file topic.hpp.

Member Typedef Documentation

◆ ValuesContainer

template<class T>
typedef std::vector<T> DetectorGraph::Topic< T >::ValuesContainer

Definition at line 96 of file topic.hpp.

Constructor & Destructor Documentation

◆ Topic()

template<class T>
DetectorGraph::Topic< T >::Topic ( )
inline

Definition at line 99 of file topic.hpp.

◆ ~Topic()

template<class T>
virtual DetectorGraph::Topic< T >::~Topic ( )
inlinevirtual

Definition at line 190 of file topic.hpp.

Member Function Documentation

◆ DispatchIntoSubscriber()

template<class T>
void DetectorGraph::Topic< T >::DispatchIntoSubscriber ( SubscriberInterface< T > *  aSubscriber)
inline

Pass pending data to its handler.

Definition at line 141 of file topic.hpp.

◆ GetCurrentTopicStates()

template<class T>
virtual std::list<ptr::shared_ptr<const TopicState> > DetectorGraph::Topic< T >::GetCurrentTopicStates ( ) const
inlinevirtual

Implements DetectorGraph::BaseTopic.

Definition at line 200 of file topic.hpp.

◆ GetCurrentValues()

template<class T>
const ValuesContainer& DetectorGraph::Topic< T >::GetCurrentValues ( ) const
inline

Definition at line 185 of file topic.hpp.

◆ GetId()

template<class T>
virtual TopicStateIdType DetectorGraph::Topic< T >::GetId ( ) const
inlinevirtual

Implements DetectorGraph::BaseTopic.

Definition at line 195 of file topic.hpp.

◆ GetNewValue()

template<class T>
const T& DetectorGraph::Topic< T >::GetNewValue ( ) const
inline

Returns reference to the new/latest value in the topic.

This method is a direct forwarding of the internal STL container and as such, calling GetNewValue on an empty Topic is undefined.

On debug builds, a DG_ASSERT will check that the Topic contains a value.

Definition at line 179 of file topic.hpp.

◆ HasNewValue()

template<class T>
bool DetectorGraph::Topic< T >::HasNewValue ( ) const
inline

Returns true if the new Data is available.

New data is signaled by the Topic having been Processed and containing in storage.

Definition at line 166 of file topic.hpp.

◆ ProcessVertex()

template<class T>
virtual void DetectorGraph::Topic< T >::ProcessVertex ( )
inlinevirtual

Implements DetectorGraph::Vertex.

Definition at line 121 of file topic.hpp.

◆ Publish()

template<class T>
void DetectorGraph::Topic< T >::Publish ( const T &  arPayload)
inline

Append data to its vector.

Definition at line 110 of file topic.hpp.


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