IFEM  90A354
Public Member Functions | Private Attributes | List of all members
ControlFIFO Class Reference

This class enables simple application control over a FIFO. More...

#include <ControlFIFO.h>

Collaboration diagram for ControlFIFO:
Collaboration graph
[legend]

Public Member Functions

 ControlFIFO ()
 Default constructor.
 
 ~ControlFIFO ()
 The destructor tears down the opened fifo and removes the file.
 
void registerCallback (ControlCallback &callback)
 Registers a callback handler. More...
 
bool open (const char *name="ifem-control")
 Opens the fifo and prepares for receiving. More...
 
void poll ()
 Polls for new data in the fifo.
 

Private Attributes

std::string fifo_name
 Name of filesystem entry of our fifo.
 
int fifo
 fifo handle
 
std::map< std::string, ControlCallback * > callbacks
 Registered callbacks.
 

Detailed Description

This class enables simple application control over a FIFO.

A fifo is opened, and users can write instructions to the fifo in XML format. These are then processed between time steps.

Member Function Documentation

◆ open()

bool ControlFIFO::open ( const char *  name = "ifem-control")

Opens the fifo and prepares for receiving.

Parameters
[in]nameThe name of the filesystem entry for the fifo

References fifo, and fifo_name.

Referenced by IFEM::Init().

◆ registerCallback()

void ControlFIFO::registerCallback ( ControlCallback callback)

Registers a callback handler.

Parameters
[in]callbackThe callback handler to register

References callbacks, and ControlCallback::GetContext().

Referenced by IFEM::registerCallback().


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