DetectorGraph  2.0
Public Member Functions | Protected Attributes | List of all members
DetectorGraph::Publisher< T > Class Template Reference

Base class that implements a Publisher behavior. More...

Collaboration diagram for DetectorGraph::Publisher< T >:

Public Member Functions

 Publisher ()
 
void SetGraph (Graph *aGraph)
 
void Publish (const T &data)
 Publish a new version of T to a Topic. More...
 

Protected Attributes

Topic< T > * mTopic
 

Detailed Description

template<class T>
class DetectorGraph::Publisher< T >

Base class that implements a Publisher behavior.

Detectors inherit from a number of versions of this class to implement their output set.

A class FooDetector acquires the "Publisher of BarTopicState" behavior by inheriting Publisher templated to BarTopicState.

class FooDetector :
public Detector,
public Publisher<BarTopicState>
{
// ...
}

This class serves a tiny purpose:

The enable the Publishing arc, detectors must call Detector::SetupPublishing:

class FooDetector :
public Detector,
public Publisher<BarTopicState>
{
FooDetector(Graph* graph) : Detector(graph)
{
SetupPublishing<BarTopicState>(this);
}
}

If you publish multiple items you will need to either qualify each Publish or include a using declaration in your header. See StackOverflow for more information

Definition at line 66 of file publisher.hpp.

Constructor & Destructor Documentation

◆ Publisher()

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

Definition at line 73 of file publisher.hpp.

Member Function Documentation

◆ Publish()

template<class T>
void DetectorGraph::Publisher< T >::Publish ( const T &  data)
inline

Publish a new version of T to a Topic.

Definition at line 85 of file publisher.hpp.

◆ SetGraph()

template<class T>
void DetectorGraph::Publisher< T >::SetGraph ( Graph aGraph)
inline

Definition at line 77 of file publisher.hpp.

Member Data Documentation

◆ mTopic

template<class T>
Topic<T>* DetectorGraph::Publisher< T >::mTopic
protected

Definition at line 69 of file publisher.hpp.


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