C++ Interface

Defines

CISINTERFACE_HPP_

Flag for checking if CisInterface.hpp has already been included.

class CisInput
#include <CisInterface.hpp>

C++ interface to cisInput_t functionality.

The CisInput class is a basic wrapper around the C cisInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic input via an IPC queue.

Subclassed by CisAsciiFileInput

Public Functions

CisInput(const char *name)

Constructor for CisInput.

Parameters
  • name: constant character pointer to name of input queue. This should be the argument to an input driver in the yaml specification file.

CisInput(cisInput_t x)

Empty constructor for inheritance.

CisInput(const char *name, const char *fmt)

Constructor for CisInput with format.

Parameters
  • name: constant character pointer to name of input queue. This should be the argument to an input driver in the yaml specification file.
  • fmt: character pointer to format string for parsing messages.

void _destroy_pi()

Alias to allow freeing of underlying C struct at the class level.

~CisInput()

Destructor for CisInput. See cis_free in CisInterface.h for details.

cisInput_t pi()

Return the cisInput_t structure.

Return
cisInput_t structure underlying the class.

int recv(char *data, const size_t len)

Receive a message shorter than CIS_MSG_MAX from the input queue. See cis_recv in CisInterface.h for additional details.

Return
int -1 if message could not be received. Length of the received message if message was received.
Parameters
  • data: character pointer to allocated buffer where the message should be saved.
  • len: size_t length of the allocated message buffer in bytes.

int recv(const int nargs, ...)

Receive and parse a message shorter than CIS_MSG_MAX from the input queue. See cisRecv from CisInterface.h for details.

Return
integer specifying if the receive was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: mixed arguments that should be assigned parameters extracted using the format string. Since these will be assigned, they should be pointers to memory that has already been allocated.

int recv_nolimit(char **data, const size_t len)

Receive a message larger than CIS_MSG_MAX from the input queue. See cis_recv_nolimit in CisInterface.h for additional details.

Return
int -1 if message could not be received. Length of the received message if message was received.
Parameters
  • data: character pointer to allocated buffer where the message should be saved.
  • len: size_t length of the allocated message buffer in bytes.

int recv_nolimit(const int nargs, ...)

Receive and parse a message larger than CIS_MSG_MAX from the input queue. See cisRecv_nolimit from CisInterface.h for details.

Return
integer specifying if the receive was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: mixed arguments that should be assigned parameters extracted using the format string. Since these will be assigned, they should be pointers to memory that has already been allocated.

Private Members

cisInput_t _pi
class CisOutput
#include <CisInterface.hpp>

C++ interface to cisOutput_t functionality.

The CisOutput class is a basic wrapper around the C cisOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic output via an IPC queue.

Subclassed by CisAsciiFileOutput

Public Functions

CisOutput(const char *name)

Constructor for CisOutput.

Parameters
  • name: constant character pointer to name of output queue. This should be the argument to an output driver in the yaml specification file.

CisOutput(const char *name, const char *fmt)

Constructor for CisOutput with format.

Parameters
  • name: constant character pointer to name of output queue. This should be the argument to an output driver in the yaml specification file.
  • fmt: character pointer to format string for formatting variables.

CisOutput(cisOutput_t x)

Empty constructor for inheritance.

void _destroy_pi()

Alias to allow freeing of underlying C struct at the class level.

~CisOutput()

Destructor for CisOutput. See cis_free in CisInterface.h for details.

cisOutput_t pi()

Return the cisOutput_t structure.

Return
cisOutput_t structure underlying the class.

int send(const char *data, const size_t len)

Send a message smaller than CIS_MSG_MAX to the output queue. If the message is larger than CIS_MSG_MAX an error code will be returned. See cis_send in CisInterface.h for details.

Return
int 0 if send succesfull, -1 if send unsuccessful.
Parameters
  • data: character pointer to message that should be sent.
  • len: size_t length of message to be sent.

int send(const int nargs, ...)

Format and send a message smaller than CIS_MSG_MAX to the output queue. See cisSend from CisInterface.h for details.

Return
integer specifying if the send was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: arguments for formatting.

int send_nolimit(const char *data, const size_t len)

Send a message larger than CIS_MSG_MAX to the output queue. See cis_send_nolimit in CisInterface.h for details.

Return
int 0 if send succesfull, -1 if send unsuccessful.
Parameters
  • data: character pointer to message that should be sent.
  • len: size_t length of message to be sent.

int send_nolimit(const int nargs, ...)

Format and send a message larger than CIS_MSG_MAX to the output queue. See cisSend from CisInterface.h for details.

Return
integer specifying if the send was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: arguments for formatting.

int send_eof()

Send EOF message to output file, closing it.

Return
int 0 if send was succesfull. All other values indicate errors.

Private Members

cisOutput_t _pi
class CisRpc
#include <CisInterface.hpp>

C++ interface to cisRpc_t functionality.

The CisRpc class is a basic wrapper around the C cisRpc_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic RPC messaging via IPC queues.

Subclassed by CisRpcClient, CisRpcServer

Public Functions

CisRpc(const char *name, const char *outFormat, const char *inFormat)

Constructor for CisRpc.

Parameters
  • name: constant character pointer name of the output queue.
  • outFormat: character pointer to format that should be used for formatting output.
  • inFormat: character pointer to format that should be used for parsing input.

CisRpc(cisRpc_t x)

Empty constructor for inheritance.

void _destroy_pi()

Alias to allow freeing of underlying C struct at the class level.

~CisRpc()

Destructor for CisRpc. See cis_free in CisInterface.h for details.

cisRpc_t pi()

Return the cisRpc_t structure.

Return
cisRpc_t structure underlying the class.

int send(const int nargs, ...)

Format and send a message to an RPC output queue. See rpcSend from CisInterface.h for details.

Return
integer specifying if the send was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: arguments for formatting.

int recv(const int nargs, ...)

Receive and parse a message from an RPC input queue. See rpcRecv from CisInterface.h for details.

Return
integer specifying if the receive was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: mixed arguments that should be assigned parameters extracted using the format string. Since these will be assigned, they should be pointers to memory that has already been allocated.

Private Members

cisRpc_t _pi
class CisRpcServer
#include <CisInterface.hpp>

C++ interface to cisRpc_t server-side functionality. The CisRpcServer class is a basic wrapper around the C cisRpc_t structure and associated server-side functions from the CisInterface.h header. It provides the user with C++ style access to basic RPC server operations.

Inherits from CisRpc

Public Functions

CisRpcServer(const char *name, const char *inFormat, const char *outFormat)

Constructor for CisRpcServer.

Parameters
  • name: constant character pointer name used for input and output queues.
  • inFormat: character pointer to format that should be used for parsing input.
  • outFormat: character pointer to format that should be used for formatting output.

~CisRpcServer()

Destructor for CisRpcServer. See cis_free in CisInterface.h for details.

class CisRpcClient
#include <CisInterface.hpp>

C++ interface to cisRpc_t client-side functionality. The CisRpcClient class is a basic wrapper around the C cisRpc_t structure and associated client-side functions from the CisInterface.h header. It provides the user with C++ style access to basic RPC client operations.

Inherits from CisRpc

Public Functions

CisRpcClient(const char *name, const char *outFormat, const char *inFormat)

Constructor for CisRpcClient.

Parameters
  • name: constant character pointer name used for input and output queues.
  • outFormat: character pointer to format that should be used for formatting output.
  • inFormat: character pointer to format that should be used for parsing input.

~CisRpcClient()

Destructor for CisRpcClient. See cis_free in CisInterface.h for details.

int call(const int nargs, ...)

Send request to an RPC server from the client and wait for a response. See rpcCall in CisInterface.h for details.

Return
integer specifying if the receive was succesful. Values >= 0 indicate success.
Parameters
  • nargs: int Number of arguments being passed.
  • ...: mixed arguments that include those that should be formatted using the output format string, followed by those that should be assigned parameters extracted using the input format string. These that will be assigned should be pointers to memory that has already been allocated.

class CisAsciiFileOutput
#include <CisInterface.hpp>

C++ interface to cisAsciiFileOutput_t functionality. The CisAsciiFileOutput class is a basic wrapper around the C cisAsciiFileOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII file output operations.

Inherits from CisOutput

Subclassed by CisAsciiArrayOutput, CisAsciiArrayOutput_local, CisAsciiFileOutput_local, CisAsciiTableOutput, CisAsciiTableOutput_local

Public Functions

CisAsciiFileOutput(const char *name)

Constructor for CisAsciiFileOutput.

Parameters
  • name: constant character pointer to the name of an output channel.

CisAsciiFileOutput(cisOutput_t x)

Empty constructor for inheritance.

int send_line(const char *line)

Send a single line to a file or queue.

Return
int 0 if send was succesfull. All other values indicate errors.
Parameters
  • line: character pointer to line that should be sent.

class CisAsciiFileOutput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiFileOutput_t functionality for local files. The CisAsciiFileOutput_local class is a basic wrapper around the C cisAsciiFileOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII file output operations.

Inherits from CisAsciiFileOutput

Public Functions

CisAsciiFileOutput_local(const char *name)

Constructor for CisAsciiFileOutput.

Parameters
  • name: constant character pointer to path of local file.

class CisAsciiFileInput
#include <CisInterface.hpp>

C++ interface to cisAsciiFileInput_t functionality. The CisAsciiFileInput class is a basic wrapper around the C cisAsciiFileInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII file input operations.

Inherits from CisInput

Subclassed by CisAsciiArrayInput, CisAsciiArrayInput_local, CisAsciiFileInput_local, CisAsciiTableInput, CisAsciiTableInput_local

Public Functions

CisAsciiFileInput(const char *name)

Constructor for CisAsciiFileInput.

Parameters
  • name: constant character pointer to the name of an input channel.

CisAsciiFileInput(cisInput_t x)

Empty constructor for inheritance.

int recv_line(char *line, const size_t n)

Receive a single line from an associated file or queue. See af_recv_line in CisInterface.h for details.

Return
int Number of bytes read/received. Negative values indicate that there was either an error or the EOF message was received.
Parameters
  • line: character pointer to allocate memory where the received line should be stored.
  • n: size_t Size of the allocated memory block in bytes.

class CisAsciiFileInput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiFileInput_t functionality for local files. The CisAsciiFileInput_local class is a basic wrapper around the C cisAsciiFileInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII file input operations.

Inherits from CisAsciiFileInput

Public Functions

CisAsciiFileInput_local(const char *name)

Constructor for CisAsciiFileInput_local.

Parameters
  • name: constant character pointer to path of local file.

class CisAsciiTableOutput
#include <CisInterface.hpp>

C++ interface to cisAsciiTableOutput_t functionality.

The CisAsciiTableOutput class is a basic wrapper around the C cisAsciiTableOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table output operations.

Inherits from CisAsciiFileOutput

Public Functions

CisAsciiTableOutput(const char *name, const char *format_str)

Constructor for CisAsciiTableOutput.

Parameters
  • name: constant character pointer to the name of an output channel.
  • format_str: character pointer to format string that should be used to format rows into table lines.

class CisAsciiTableOutput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiTableOutput_t functionality for local files.

The CisAsciiTableOutput class is a basic wrapper around the C cisAsciiTableOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table output operations.

Inherits from CisAsciiFileOutput

Public Functions

CisAsciiTableOutput_local(const char *name, const char *format_str)

Constructor for CisAsciiTableOutput for local files.

Parameters
  • name: constant character pointer to path of local table.
  • format_str: character pointer to format string that should be used to format rows into table lines.

class CisAsciiArrayOutput
#include <CisInterface.hpp>

C++ interface to cisAsciiTableOutput_t functionality with arrays.

The CisAsciiArrayOutput class is a basic wrapper around the C cisAsciiTableOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table output operations.

Inherits from CisAsciiFileOutput

Public Functions

CisAsciiArrayOutput(const char *name, const char *format_str)

Constructor for CisAsciiArrayOutput.

Parameters
  • name: constant character pointer to the name of an output channel.
  • format_str: character pointer to format string that should be used to format arrays into a table.

class CisAsciiArrayOutput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiTableOutput_t functionality for local files.

The CisAsciiArrayOutput class is a basic wrapper around the C cisAsciiTableOutput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table output operations.

Inherits from CisAsciiFileOutput

Public Functions

CisAsciiArrayOutput_local(const char *name, const char *format_str)

Constructor for CisAsciiArrayOutput for local files.

Parameters
  • name: constant character pointer to path of local table.
  • format_str: character pointer to format string that should be used to format arrays into table columns.

class CisAsciiTableInput
#include <CisInterface.hpp>

C++ interface to cisAsciiTableInput_t functionality.

The CisAsciiTableInput class is a basic wrapper around the C cisAsciiTableInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table input operations.

Inherits from CisAsciiFileInput

Public Functions

CisAsciiTableInput(const char *name)

Constructor for CisAsciiTableInput. Due to issues with the C++ version of vsscanf, flags and precision indicators for floating point format specifiers (e.g. e, f), must be removed so that table input can be properly parsed.

Parameters
  • name: constant character pointer to the name of an input channel.

class CisAsciiTableInput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiTableInput_t functionality for local files.

The CisAsciiTableInput class is a basic wrapper around the C cisAsciiTableInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table input operations.

Inherits from CisAsciiFileInput

Public Functions

CisAsciiTableInput_local(const char *name)

Constructor for CisAsciiTableInput_local. Due to issues with the C++ version of vsscanf, flags and precision indicators for floating point format specifiers (e.g. e, f), must be removed so that table input can be properly parsed.

Parameters
  • name: constant character pointer to path of local table.

class CisAsciiArrayInput
#include <CisInterface.hpp>

C++ interface to cisAsciiTableInput_t functionality for arrays.

The CisAsciiArrayInput class is a basic wrapper around the C cisAsciiTableInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table input operations.

Inherits from CisAsciiFileInput

Public Functions

CisAsciiArrayInput(const char *name)

Constructor for CisAsciiArrayInput. Due to issues with the C++ version of vsscanf, flags and precision indicators for floating point format specifiers (e.g. e, f), must be removed so that table input can be properly parsed.

Parameters
  • name: constant character pointer to the name of an input channel.

class CisAsciiArrayInput_local
#include <CisInterface.hpp>

C++ interface to cisAsciiTableInput_t functionality for local files as arrays.

The CisAsciiArrayInput class is a basic wrapper around the C cisAsciiTableInput_t structure and associated functions from the CisInterface.h header. It provides the user with C++ style access to basic ASCII table input operations.

Inherits from CisAsciiFileInput

Public Functions

CisAsciiArrayInput_local(const char *name)

Constructor for CisAsciiArrayInput_local. Due to issues with the C++ version of vsscanf, flags and precision indicators for floating point format specifiers (e.g. e, f), must be removed so that table input can be properly parsed.

Parameters
  • name: constant character pointer to path of local table.