C++ Interface

class CisInput
#include <CisInterface.hpp>

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

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, CisObjInput, CisPlyInput

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 recvRealloc(const int nargs, ...)

Receive and parse a message from the input queue, allowing destination variables to be reallocated. The pointers passed must be on heap.

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 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, CisObjOutput, CisPlyOutput

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(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.

int recvRealloc(const int nargs, ...)

Receive and parse a message from an RPC input queue, allowing destination memory to be reallocated as necessary. 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 and reallocated if they are not large enough, they should be references to pointer for heap memory that may or may not have already been allocated.

Private Members

cisRpc_t _pi
class CisRpcServer : public CisRpc
#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.

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 : public CisRpc
#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.

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, preserving the current sizes of memory at the provided output variable references. 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.

int callRealloc(const int nargs, ...)

Send request to an RPC server from the client and wait for a response, allowing the memory pointed to by the pointers that the output variables reference to be reallocated. 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 references to pointers for heap memory that may or may not have already been allocated. These will be reallocated if they are not large enough to receive data from the incoming message.

class CisAsciiFileOutput : public CisOutput
#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.

Subclassed by CisAsciiArrayOutput, CisAsciiTableOutput

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 CisAsciiFileInput : public CisInput
#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.

Subclassed by CisAsciiArrayInput, CisAsciiTableInput

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 CisAsciiTableOutput : public CisAsciiFileOutput
#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.

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 CisAsciiArrayOutput : public CisAsciiFileOutput
#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.

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 CisAsciiTableInput : public CisAsciiFileInput
#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.

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 CisAsciiArrayInput : public CisAsciiFileInput
#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.

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 CisPlyOutput : public CisOutput
#include <CisInterface.hpp>

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

Public Functions

CisPlyOutput(const char *name)

Constructor for CisPlyOutput.

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

CisPlyOutput(cisOutput_t x)

Empty constructor for inheritance.

class CisPlyInput : public CisInput
#include <CisInterface.hpp>

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

Public Functions

CisPlyInput(const char *name)

Constructor for CisPlyInput.

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

CisPlyInput(cisInput_t x)

Empty constructor for inheritance.

class CisObjOutput : public CisOutput
#include <CisInterface.hpp>

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

Public Functions

CisObjOutput(const char *name)

Constructor for CisObjOutput.

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

CisObjOutput(cisOutput_t x)

Empty constructor for inheritance.

class CisObjInput : public CisInput
#include <CisInterface.hpp>

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

Public Functions

CisObjInput(const char *name)

Constructor for CisObjInput.

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

CisObjInput(cisInput_t x)

Empty constructor for inheritance.