Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::InformationServer Class Referenceabstract

#include <InformationServer.h>

Inheritance diagram for sf::InformationServer:
Collaboration diagram for sf::InformationServer:

Public Types

enum  EState {
  issOff = 0 , issRun , issRecord , issPause ,
  issStop , issMaxState
}
 Enumerate for state of the info server. More...
 
enum  EClass { clA = 0 , clB , clC , clMaxClass }
 Variable/parameter class enumerator. More...
 
- Public Types inherited from sf::InformationTypes
typedef unsigned long long id_type
 Type used for the identifying integer (64-bits).
 
typedef int32_t flags_type
 Type used for the flag integer.
 
typedef size_t size_type
 Type used for size of vectors.
 
typedef ssize_t ssize_type
 Same as size_type but a signed version.
 
typedef uintptr_t data_type
 Type used for containing a single data element which is the largest integer.
 
typedef intptr_t sdata_type
 Type used for containing a single data element which is the largest signed integer.
 
typedef TVector< id_typeIdVector
 Vector for lists of information ID's.
 
typedef TVector< InformationBase * > Vector
 Vector for containing different information base derived classes.
 

Public Member Functions

 InformationServer ()
 Default constructor.
 
virtual ~InformationServer ()
 
void setup (const std::string &name, const std::string &namePrefix, long vid, long deviceMask, long serverMask)
 When device mask is non-zero, variables are added automatically on creation to this info server.
 
void flush ()
 Clears the instance. Also called from setup.
 
EState getState () const
 Gets the current state.
 
const char * getStateName (int state) const
 Gets the name of the passed state.
 
void setState (EState)
 Sets the current state.
 
bool isServerId (id_type id) const
 Determines if the passed id belongs to this info server.
 
void attachVariable (Variable *var, EClass cls)
 Adds a variable to the variables vector.
 
void detachVariable (Variable *var)
 Removes a variable from the variable vector.
 
void attachResult (ResultData *res)
 Adds a result to the result vector.
 
void detachResult (ResultData *res)
 Removes a result from the result vector.
 
bool isGeneratingResults ()
 Reports if this server generates results depending on its current state.
 
virtual void onStateChange (EState prevState, EState nextState)=0
 To be overloaded by a derived class to handle a state change if necessary.
 
virtual void clearValidations ()
 Clears the committed ranges of the attached results. This one can be overloaded by the derived class. When so this function must be called as well.
 

Additional Inherited Members

- Static Public Member Functions inherited from sf::InformationTypes
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)), data_typetoDataType (T value)
 Casts any type to a data_type value.
 
template<typename T >
static constexpr std::enable_if_t<(sizeof(T)<=sizeof(data_type)||std::is_reference_v< T >), T > fromDataType (data_type value)
 Casts a data_type value to a given type. Reference types are also possible since they are the same size as a pointer underwater.
 
- Static Public Attributes inherited from sf::InformationTypes
static constexpr size_t npos = std::numeric_limits<size_type>::max()
 Unsigned size value indicating not found or no index.
 

Member Enumeration Documentation

◆ EClass

Variable/parameter class enumerator.

Enumerator
clA 

Parameters of this class will always be writable.

clB 

Parameters of this class should be read-only during measurement.

clC 

Parameters of this class effect the result-geometry, and should be read-only during measurement and recording.

clMaxClass 

Number of classes.

◆ EState

Enumerate for state of the info server.

Enumerator
issOff 

Not generating results.

issRun 

Generating results, and flushing.

issRecord 

Generating results, no flushing.

issPause 

Not generating results, saving parameters.

issStop 

Not generating results, saving results.

issMaxState 

Max states count.

Constructor & Destructor Documentation

◆ InformationServer()

sf::InformationServer::InformationServer ( )

Default constructor.

◆ ~InformationServer()

virtual sf::InformationServer::~InformationServer ( )
virtual

Destructor

Member Function Documentation

◆ attachResult()

void sf::InformationServer::attachResult ( ResultData res)

Adds a result to the result vector.

◆ attachVariable()

void sf::InformationServer::attachVariable ( Variable var,
EClass  cls 
)

Adds a variable to the variables vector.

◆ clearValidations()

virtual void sf::InformationServer::clearValidations ( )
virtual

Clears the committed ranges of the attached results. This one can be overloaded by the derived class. When so this function must be called as well.

Reimplemented in sf::RsaServer.

◆ detachResult()

void sf::InformationServer::detachResult ( ResultData res)

Removes a result from the result vector.

◆ detachVariable()

void sf::InformationServer::detachVariable ( Variable var)

Removes a variable from the variable vector.

◆ flush()

void sf::InformationServer::flush ( )

Clears the instance. Also called from setup.

◆ getState()

EState sf::InformationServer::getState ( ) const

Gets the current state.

◆ getStateName()

const char * sf::InformationServer::getStateName ( int  state) const

Gets the name of the passed state.

◆ isGeneratingResults()

bool sf::InformationServer::isGeneratingResults ( )

Reports if this server generates results depending on its current state.

◆ isServerId()

bool sf::InformationServer::isServerId ( id_type  id) const

Determines if the passed id belongs to this info server.

◆ onStateChange()

virtual void sf::InformationServer::onStateChange ( EState  prevState,
EState  nextState 
)
pure virtual

To be overloaded by a derived class to handle a state change if necessary.

Implemented in sf::RsaServer.

◆ setState()

void sf::InformationServer::setState ( EState  )

Sets the current state.

◆ setup()

void sf::InformationServer::setup ( const std::string &  name,
const std::string &  namePrefix,
long  vid,
long  deviceMask,
long  serverMask 
)

When device mask is non-zero, variables are added automatically on creation to this info server.

Parameters
nameName of the server.
namePrefixPrefix of the name.
vidVariable id of state parameter.
deviceMaskDevice vid mask of this server.
serverMaskServer vid mask of this server.

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