tdaq-develop-2025-02-12
ots::FEProducerVInterface Class Reference

#include <otsdaq/FECore/FEProducerVInterface.h>

Inheritance diagram for ots::FEProducerVInterface:
ots::FEVInterface ots::DataProducerBase ots::WorkLoop ots::Configurable ots::VStateMachine ots::DataProcessor

Public Member Functions

 FEProducerVInterface (const std::string &interfaceUID, const ConfigurationTree &theXDAQContextConfigTree, const std::string &interfaceConfigurationPath)
 
virtual void startProcessingData (std::string)
 
virtual void stopProcessingData (void)
 
virtual void copyToNextBuffer (const std::string &dataToWrite)
 
virtual std::string * getNextBuffer (void)
 
virtual void writeCurrentBuffer (void)
 
- Public Member Functions inherited from ots::FEVInterface
 FEVInterface (const std::string &interfaceUID, const ConfigurationTree &theXDAQContextConfigTree, const std::string &configurationPath)
 
const std::string & getInterfaceUID (void) const
 
const std::string & getInterfaceType (void) const
 
virtual void universalRead (char *address, char *returnValue)=0
 throw std::runtime_error exception on error/timeout
 
virtual void universalWrite (char *address, char *writeValue)=0
 
const unsigned int & getUniversalAddressSize (void)
 
const unsigned int & getUniversalDataSize (void)
 
virtual void universalBlockRead (char *address, char *returnValue, unsigned int numberOfBytes)
 
virtual void universalBlockWrite (char *address, char *writeValue, unsigned int numberOfBytes)
 
void runSequenceOfCommands (const std::string &treeLinkName)
 
virtual void configure (void)
 
virtual void start (std::string)
 
virtual void stop (void)
 
virtual void halt (void)
 
virtual void pause (void)
 
virtual void resume (void)
 
virtual bool running (void)
 
virtual void configureSlowControls (void)
 end State Machine handlers More...
 
void addSlowControlsChannels (ConfigurationTree slowControlsGroupLink, std::map< std::string, FESlowControlsChannel > *mapOfSlowControlsChannels)
 
virtual void resetSlowControlsChannelIterator (void)
 virtual in case channels are handled in multiple maps, for example
 
virtual FESlowControlsChannelgetNextSlowControlsChannel (void)
 virtual in case channels are handled in multiple maps, for example
 
virtual unsigned int getSlowControlsChannelCount (void)
 virtual in case channels are handled in multiple maps, for example
 
bool slowControlsRunning (void)
 slow controls workloop calls this
 
void startSlowControlsWorkLoop (void)
 
void stopSlowControlsWorkLoop (void)
 
const std::map< std::string, frontEndMacroStruct_t > & getMapOfFEMacroFunctions (void)
 
void runSelfFrontEndMacro (const std::string &feMacroName, const std::vector< FEVInterface::frontEndMacroArg_t > &inputArgs, std::vector< FEVInterface::frontEndMacroArg_t > &outputArgs)
 
template<class T >
void sendToFrontEnd (const std::string &targetInterfaceID, const T &value) const
 end FE Macros More...
 
void runFrontEndMacro (const std::string &targetInterfaceID, const std::string &feMacroName, const std::vector< FEVInterface::frontEndMacroArg_t > &inputArgs, std::vector< FEVInterface::frontEndMacroArg_t > &outputArgs) const
 
template<class T >
void receiveFromFrontEnd (const std::string &requester, T &retValue, unsigned int timeoutInSeconds=1) const
 
void receiveFromFrontEnd (const std::string &requester, std::string &retValue, unsigned int timeoutInSeconds=1) const
 specialized template function for T=std::string More...
 
template<class T >
receiveFromFrontEnd (const std::string &requester="*", unsigned int timeoutInSeconds=1) const
 
std::string receiveFromFrontEnd (const std::string &requester="*", unsigned int timeoutInSeconds=1) const
 specialized template function for T=std::string More...
 
- Public Member Functions inherited from ots::WorkLoop
 WorkLoop (const std::string &name)
 
void startWorkLoop (void)
 
bool stopWorkLoop (void)
 
bool isActive (void) const
 
- Public Member Functions inherited from ots::Configurable
 Configurable (const ConfigurationTree &theXDAQContextConfigTree, const std::string &theConfigurationPath)
 
ConfigurationTree getSelfNode () const
 
const ConfigurationManagergetConfigurationManager () const
 
const std::string & getContextUID () const
 
const std::string & getApplicationUID () const
 
unsigned int getApplicationLID () const
 
std::string getContextAddress () const
 
unsigned int getContextPort () const
 
- Public Member Functions inherited from ots::VStateMachine
 VStateMachine (const std::string &name)
 
virtual void paused (void)
 
virtual void halted (void)
 
virtual void configured (void)
 
virtual void initial (void)
 
virtual void inError (void)
 
virtual std::string getStatusProgressDetail (void)
 Status. More...
 
void setTransitionName (const std::string &transitionName)
 
const std::string & getTransitionName (void)
 
void setIterationIndex (unsigned int i)
 
void setSubIterationIndex (unsigned int i)
 
unsigned int getIterationIndex (void)
 
unsigned int getSubIterationIndex (void)
 
void indicateIterationWork (void)
 
void clearIterationWork (void)
 
bool getIterationWork (void)
 
void indicateSubIterationWork (void)
 
void clearSubIterationWork (void)
 
bool getSubIterationWork (void)
 
- Public Member Functions inherited from ots::DataProducerBase
 DataProducerBase (const std::string &supervisorApplicationUID, const std::string &bufferUID, const std::string &processorUID, unsigned int bufferSize=100)
 
virtual void registerToBuffer (void)
 mirror DataConsumer::registerToBuffer
 
template<class D , class H >
int attachToEmptySubBuffer (D *&data, H *&header)
 
template<class D , class H >
int setWrittenSubBuffer (void)
 
template<class D , class H >
int write (const D &buffer)
 
template<class D , class H >
int write (const D &buffer, const H &header)
 
unsigned int getBufferSize (void) const
 
- Public Member Functions inherited from ots::DataProcessor
 DataProcessor (std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID)
 
virtual void configure (void)=0
 
virtual void pauseProcessingData (void)
 
virtual void resumeProcessingData (void)
 
const std::string & getProcessorID (void) const
 Getters.
 
void setCircularBuffer (CircularBufferBase *circularBuffer)
 

Protected Attributes

std::string * dataP_
 
std::map< std::string, std::string > * headerP_
 
- Protected Attributes inherited from ots::FEVInterface
std::map< std::string, FESlowControlsChannelmapOfSlowControlsChannels_
 Slow Controls members.
 
std::map< std::string, FESlowControlsChannel >::iterator slowControlsChannelsIterator_
 
FESlowControlsWorkLoop slowControlsWorkLoop_
 
std::string interfaceUID_
 
std::string interfaceType_
 
std::string mfSubject_
 for GEN_COUT decorations which would be safe in destructors, e.g. mirror interfaceUID_
 
unsigned int universalAddressSize_ = 0
 
unsigned int universalDataSize_ = 0
 
std::map< std::string, frontEndMacroStruct_tmapOfFEMacroFunctions_
 Map of FE Macro functions members. More...
 
- Protected Attributes inherited from ots::WorkLoop
volatile bool continueWorkLoop_
 
- Protected Attributes inherited from ots::Configurable
const ConfigurationTree theXDAQContextConfigTree_
 
const std::string theConfigurationPath_
 
const std::string theConfigurationRecordName_
 
- Protected Attributes inherited from ots::VStateMachine
std::map< std::string, std::map< unsigned int, std::string > > iterationAliasMap_
 
std::map< std::string, std::map< unsigned int, std::string > > subIterationAliasMap_
 
- Protected Attributes inherited from ots::DataProcessor
const std::string supervisorApplicationUID_
 
const std::string bufferUID_
 
const std::string processorUID_
 
CircularBufferBasetheCircularBuffer_
 

Additional Inherited Members

- Public Types inherited from ots::FEVInterface
using frontEndMacroArg_t = std::pair< const std::string, std::string >
 end Slow Controls More...
 
using frontEndMacroArgs_t = std::vector< frontEndMacroArg_t > &
 
using frontEndMacroConstArgs_t = const std::vector< frontEndMacroArg_t > &
 
using frontEndMacroFunction_t = void(ots::FEVInterface::*)(const frontEndMacroStruct_t &feMacroStruct, FEVInterface::frontEndMacroConstArgs_t argsIn, FEVInterface::frontEndMacroArgs_t argsOut)
 void function (vector-of-inputs, vector-of-outputs)
 
- Static Public Member Functions inherited from ots::FEVInterface
static void sendAsyncExceptionToGateway (FEVInterface *fe, const std::string &errMsg, bool isPauseException, bool isStopException)
 
static const std::string & getFEMacroConstArgument (frontEndMacroConstArgs_t args, const std::string &argName)
 < for external specialized template access More...
 
static std::string & getFEMacroArgument (frontEndMacroArgs_t args, const std::string &argName)
 
- Public Attributes inherited from ots::FEVInterface
FEVInterfacesManagerparentInterfaceManager_
 
bool universalBlockReadImplementationConfirmed = false
 is confirmed by slow controls handling (for example) that universalBlockRead is implemented by the FE plugin
 
- Public Attributes inherited from ots::VStateMachine
CoreSupervisorBaseparentSupervisor_
 
- Static Public Attributes inherited from ots::FEVInterface
static const std::string UNKNOWN_TYPE = "UNKNOWN"
 
- Protected Member Functions inherited from ots::FEVInterface
void runMacro (FEVInterface::macroStruct_t &macro, std::map< std::string, uint64_t > &variableMap)
 runMacro
 
bool workLoopThread (toolbox::task::WorkLoop *workLoop)
 end FE Communication helpers ////// More...
 
void registerFEMacroFunction (const std::string &feMacroName, frontEndMacroFunction_t feMacroFunction, const std::vector< std::string > &namesOfInputArgs, const std::vector< std::string > &namesOfOutputArgs, uint8_t requiredUserPermissions=1, const std::string &allowedCallingFEs="*", const std::string &feMacroTooltip="")
 
void registerFEMacroFunction (const std::string &feMacroName, frontEndMacroFunction_t feMacroFunction, const std::vector< std::string > &namesOfInputArgs, const std::vector< std::string > &namesOfOutputArgs, const std::string &requiredUserPermissions=WebUsers::DEFAULT_USER_GROUP+":1", const std::string &allowedCallingFEs="*", const std::string &feMacroTooltip="")
 
template<class T >
std::string & setFEMacroArgumentValue (frontEndMacroArgs_t args, const std::string &argName, const T &value) const
 
template<class T >
std::string & emplaceFEMacroArgumentValue (frontEndMacroArgs_t args, const std::string &argName, const T &value) const
 
- Protected Member Functions inherited from ots::WorkLoop
const std::string & getWorkLoopName (void) const
 Getters.
 

Detailed Description

FEProducerVInterface This class is a virtual class defining the features of front-end interface plugin class. The features include configuration hooks, finite state machine handlers, Front-end Macros for web accessible C++ handlers, slow controls hooks, as well as universal write and read for Macro Maker compatibility.

Definition at line 19 of file FEProducerVInterface.h.

Member Function Documentation

◆ copyToNextBuffer()

void FEProducerVInterface::copyToNextBuffer ( const std::string &  dataToWrite)
virtual

copyToNextBuffer This function copies a data string into the next available buffer.

Here is example code for filling a data string to write

    unsigned long long value = 0xA5; //this is 8-bytes
    std::string buffer;
    buffer.resize(8); //NOTE: this is inexpensive according to

Lorenzo/documentation in C++11 (only increases size once and doesn't decrease size) memcpy((void *)&buffer /*dest*‍/,(void *)&value /*src*‍/, 8 /*numOfBytes*‍/);

Note: This is somewhat inefficient because it makes a copy of the data.
    It would be more efficient to call
        FEProducerVInterface::getNextBuffer()
        ... fill the retrieved data string
        FEProducerVInterface::writeCurrentBuffer()

If you are using the same dataToWrite string over and over.. it might not be that

inefficient to use this.

Definition at line 89 of file FEProducerVInterface.cc.

◆ getNextBuffer()

std::string * FEProducerVInterface::getNextBuffer ( void  )
virtual

getNextBuffer This function retrieves the next buffer data string.

Note: This is more efficient than FEProducerVInterface::writeToBuffer because it does NOT makes a copy of the data.

You need to now ... fill the retrieved data string FEProducerVInterface::writeCurrentBuffer()

Definition at line 136 of file FEProducerVInterface.cc.

◆ writeCurrentBuffer()

void FEProducerVInterface::writeCurrentBuffer ( void  )
virtual

writeCurrentBuffer This function writes the current buffer data string to the buffer.

Definition at line 154 of file FEProducerVInterface.cc.


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