14 #ifndef CONTROL_FIFO_H_
15 #define CONTROL_FIFO_H_
20 namespace tinyxml2 {
class XMLElement; }
31 virtual void OnControl(
const tinyxml2::XMLElement* context) = 0;
59 bool open(
const char* name =
"ifem-control");
Callback for FIFO option handling.
Definition: ControlFIFO.h:28
virtual void OnControl(const tinyxml2::XMLElement *context)=0
Callback on receiving a XML control block.
virtual std::string GetContext() const =0
Returns context name for callback.
This class enables simple application control over a FIFO.
Definition: ControlFIFO.h:45
int fifo
fifo handle
Definition: ControlFIFO.h:66
ControlFIFO()
Default constructor.
Definition: ControlFIFO.h:48
~ControlFIFO()
The destructor tears down the opened fifo and removes the file.
Definition: ControlFIFO.C:24
void registerCallback(ControlCallback &callback)
Registers a callback handler.
Definition: ControlFIFO.C:80
void poll()
Polls for new data in the fifo.
Definition: ControlFIFO.C:51
std::string fifo_name
Name of filesystem entry of our fifo.
Definition: ControlFIFO.h:65
bool open(const char *name="ifem-control")
Opens the fifo and prepares for receiving.
Definition: ControlFIFO.C:34
std::map< std::string, ControlCallback * > callbacks
Registered callbacks.
Definition: ControlFIFO.h:68