vulp  2.2.2
vulp::observation::Source Class Reference

Base class for sources. More...

#include <Source.h>

Public Member Functions

virtual ~Source ()
 Destructor is virtual to deallocate lists of observers properly. More...
 
virtual std::string prefix () const noexcept
 Prefix of output in the observation dictionary. More...
 
virtual void write (Dictionary &observation)
 Write output to a dictionary. More...
 

Detailed Description

Base class for sources.

Sources run before observers. They write their observations without reading other observations from the pipeline, although they may of course read data from other media (such as the file system).

Definition at line 20 of file Source.h.

Constructor & Destructor Documentation

◆ ~Source()

virtual vulp::observation::Source::~Source ( )
inlinevirtual

Destructor is virtual to deallocate lists of observers properly.

Definition at line 23 of file Source.h.

Member Function Documentation

◆ prefix()

virtual std::string vulp::observation::Source::prefix ( ) const
inlinevirtualnoexcept

Prefix of output in the observation dictionary.

This prefix is looked up by the spine to feed observation(prefix) to the write function.

Reimplemented in vulp::observation::sources::Keyboard, vulp::observation::sources::Joystick, and vulp::observation::sources::CpuTemperature.

Definition at line 30 of file Source.h.

◆ write()

virtual void vulp::observation::Source::write ( Dictionary &  observation)
inlinevirtual

Write output to a dictionary.

Parameters
[out]observationDictionary to write observations to.
Note
The base class writes nothing. We put an empty function here rather than making the class abstract to be able to instantiate vectors of it.

Reimplemented in vulp::observation::sources::Keyboard, vulp::observation::sources::Joystick, and vulp::observation::sources::CpuTemperature.

Definition at line 41 of file Source.h.


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