Parfis  v0.0.7
Functions
API

Exported C Functions of the main class Parfis. More...

Functions

const PARFIS_EXPORT char * parfis::api::info ()
 Returns info about the program settings. More...
 
const PARFIS_EXPORT char * parfis::api::parfisInfo (uint32_t id)
 Returns info about the Parfis object. More...
 
const PARFIS_EXPORT char * parfis::api::getLogFileName (uint32_t id)
 Gets the name of the log file as a const char*. More...
 
const PARFIS_EXPORT char * parfis::api::getLogStr (uint32_t id)
 Returns the current log string from the Parfis object. More...
 
const PARFIS_EXPORT char * parfis::api::version ()
 Returns version string. More...
 
PARFIS_EXPORT uint32_t parfis::api::newParfis (const char *cfgStr="", uint32_t writeLogFile=0)
 Creates new Parfis object and returns its id. More...
 
PARFIS_EXPORT int parfis::api::setConfig (uint32_t id, const char *str)
 Configures the Parfis object with the given id. More...
 
PARFIS_EXPORT int parfis::api::setConfigFromFile (uint32_t id, const char *str)
 Configures the Parfis object with the given id from a file. More...
 
PARFIS_EXPORT int parfis::api::loadCfgData (uint32_t id)
 Wrapper for calling member function with the same name from the Parfis object. More...
 
PARFIS_EXPORT int parfis::api::loadSimData (uint32_t id)
 
PARFIS_EXPORT int parfis::api::setPyCfgData (uint32_t id)
 Loads the PyCfgData. More...
 
PARFIS_EXPORT int parfis::api::setPySimData (uint32_t id)
 Loads the PySimData. More...
 
const PARFIS_EXPORT char * parfis::api::defaultConfiguration ()
 Returns the default configuration hardcoded in DEFAULT_INITIALIZATION_STRING. More...
 
const PARFIS_EXPORT char * parfis::api::getConfig (uint32_t id)
 Returns configuration of Parfis object. More...
 
const PARFIS_EXPORT char * parfis::api::getConfigParam (uint32_t id, const char *key)
 Returns value for a single configuration parameter of Parfis object. More...
 
const PARFIS_EXPORT CfgDataparfis::api::getCfgData (uint32_t id)
 Returns pointer to the CfgData of the Parfis object given by id. More...
 
const PARFIS_EXPORT PyCfgDataparfis::api::getPyCfgData (uint32_t id)
 Returns pointer to the PyCfgData of the Parfis object given by id. More...
 
const PARFIS_EXPORT SimDataparfis::api::getSimData (uint32_t id)
 Returns pointer to the SimData of the Parfis object given by id. More...
 
const PARFIS_EXPORT PySimDataparfis::api::getPySimData (uint32_t id)
 Returns pointer to the PySimData of the Parfis object given by id. More...
 
PARFIS_EXPORT int parfis::api::deleteParfis (uint32_t id)
 Deletes the Parfis object given by the id. More...
 
PARFIS_EXPORT int parfis::api::deleteAll ()
 Deletes all Parfis objects. More...
 
const PARFIS_EXPORT std::vector< uint32_t > & parfis::api::getParfisIdVec ()
 Get the Parfis vector of ids from s_parfisMap. More...
 
PARFIS_EXPORT int parfis::api::runCommandChain (uint32_t id, const char *key)
 Run command chain given by id an name of the command chain. More...
 
const PARFIS_EXPORT char * parfis::api::toStringDouble (double num)
 Expose the custom Global::to_string conversion from double. More...
 
const PARFIS_EXPORT char * parfis::api::toStringFloat (float num)
 Expose the custom Global::to_string conversion from float. More...
 

Detailed Description

Exported C Functions of the main class Parfis.

Functions are compiled with the extern "C" thus forbiding C++ to mangle the function names. This is essential for using these functions with python ctypes. This functions are the only way to access library functionality from outside.

Function Documentation

◆ defaultConfiguration()

const PARFIS_EXPORT char * parfis::api::defaultConfiguration ( )

Returns the default configuration hardcoded in DEFAULT_INITIALIZATION_STRING.

Returns
The default configuration

◆ deleteAll()

PARFIS_EXPORT int parfis::api::deleteAll ( )

Deletes all Parfis objects.

Returns
Zero on success

◆ deleteParfis()

PARFIS_EXPORT int parfis::api::deleteParfis ( uint32_t  id)

Deletes the Parfis object given by the id.

Parameters
idof the Parfis object
Returns
Zero on success

◆ getCfgData()

const PARFIS_EXPORT parfis::CfgData * parfis::api::getCfgData ( uint32_t  id)

Returns pointer to the CfgData of the Parfis object given by id.

Parameters
idof the Parfis object

◆ getConfig()

const PARFIS_EXPORT char * parfis::api::getConfig ( uint32_t  id)

Returns configuration of Parfis object.

The function serializes the Domain objects and its children.

Parameters
idObject id
Returns
The serialized configuration string

◆ getConfigParam()

const PARFIS_EXPORT char * parfis::api::getConfigParam ( uint32_t  id,
const char *  key 
)

Returns value for a single configuration parameter of Parfis object.

The function serializes the single children of the Domain object.

Parameters
idObject id
keyThe parameter key
Returns
The parameter value as string

◆ getLogFileName()

const PARFIS_EXPORT char * parfis::api::getLogFileName ( uint32_t  id)

Gets the name of the log file as a const char*.

Parameters
idId of the Parfis object
Returns
Pointer to the allocated string holding a name of the file.

◆ getLogStr()

const PARFIS_EXPORT char * parfis::api::getLogStr ( uint32_t  id)

Returns the current log string from the Parfis object.

Parameters
idId of the Parfis object
Returns
The object's log string

◆ getParfisIdVec()

const PARFIS_EXPORT std::vector< uint32_t > & parfis::api::getParfisIdVec ( )

Get the Parfis vector of ids from s_parfisMap.

Returns
vector of uint32_t

◆ getPyCfgData()

const PARFIS_EXPORT parfis::PyCfgData * parfis::api::getPyCfgData ( uint32_t  id)

Returns pointer to the PyCfgData of the Parfis object given by id.

Parameters
idof the Parfis object

◆ getPySimData()

const PARFIS_EXPORT parfis::PySimData * parfis::api::getPySimData ( uint32_t  id)

Returns pointer to the PySimData of the Parfis object given by id.

Parameters
idof the Parfis object

◆ getSimData()

const PARFIS_EXPORT parfis::SimData * parfis::api::getSimData ( uint32_t  id)

Returns pointer to the SimData of the Parfis object given by id.

Parameters
idof the Parfis object

◆ info()

const PARFIS_EXPORT char * parfis::api::info ( )

Returns info about the program settings.

Settings are the compilation definitions and values of the current runtime.

Returns
The info string

◆ loadCfgData()

PARFIS_EXPORT int parfis::api::loadCfgData ( uint32_t  id)

Wrapper for calling member function with the same name from the Parfis object.

Parameters
idId of the Parfis object
Returns
Zero on success.

◆ newParfis()

PARFIS_EXPORT uint32_t parfis::api::newParfis ( const char *  cfgStr = "",
uint32_t  writeLogFile = 0 
)

Creates new Parfis object and returns its id.

Parameters
cfgStrConfiguration string (default is "")
writeLogFileTurn on/off writing logs to file (default is 0 - off)
Returns
Id of the created object

◆ parfisInfo()

const PARFIS_EXPORT char * parfis::api::parfisInfo ( uint32_t  id)

Returns info about the Parfis object.

Parameters
idId of the Parfis object
Returns
The object's info string

◆ runCommandChain()

PARFIS_EXPORT int parfis::api::runCommandChain ( uint32_t  id,
const char *  key 
)

Run command chain given by id an name of the command chain.

Parameters
idof the Parfis object
keycommand chain name
Returns
Zero on success

◆ setConfig()

PARFIS_EXPORT int parfis::api::setConfig ( uint32_t  id,
const char *  str 
)

Configures the Parfis object with the given id.

Parameters
idId of the Parfis object to configure
strConfiguration string
Returns
Zero for success

◆ setConfigFromFile()

PARFIS_EXPORT int parfis::api::setConfigFromFile ( uint32_t  id,
const char *  str 
)

Configures the Parfis object with the given id from a file.

Parameters
idId of the Parfis object to configure
strConfiguration file path
Returns
Zero for success

◆ setPyCfgData()

PARFIS_EXPORT int parfis::api::setPyCfgData ( uint32_t  id)

Loads the PyCfgData.

Parameters
idof the Parfis object

◆ setPySimData()

PARFIS_EXPORT int parfis::api::setPySimData ( uint32_t  id)

Loads the PySimData.

Parameters
idof the Parfis object

◆ toStringDouble()

const PARFIS_EXPORT char * parfis::api::toStringDouble ( double  num)

Expose the custom Global::to_string conversion from double.


Parameters
numdouble number to be converted to string
Returns
const char* representation of the number

◆ toStringFloat()

const PARFIS_EXPORT char * parfis::api::toStringFloat ( float  num)

Expose the custom Global::to_string conversion from float.

Parameters
numfloat number to be converted to string
Returns
const char* representation of the number

◆ version()

const PARFIS_EXPORT char * parfis::api::version ( )

Returns version string.

Returns
The version string