helics  2.8.1
Functions
GetValue functions

Functions

int helicsInputGetRawValueSize (helics_input ipt)
 
void helicsInputGetRawValue (helics_input ipt, void *data, int maxDataLength, int *actualSize, helics_error *err)
 
int helicsInputGetStringSize (helics_input ipt)
 
void helicsInputGetString (helics_input ipt, char *outputString, int maxStringLength, int *actualLength, helics_error *err)
 
int64_t helicsInputGetInteger (helics_input ipt, helics_error *err)
 
helics_bool helicsInputGetBoolean (helics_input ipt, helics_error *err)
 
double helicsInputGetDouble (helics_input ipt, helics_error *err)
 
helics_time helicsInputGetTime (helics_input ipt, helics_error *err)
 
char helicsInputGetChar (helics_input ipt, helics_error *err)
 
helics_complex helicsInputGetComplexObject (helics_input ipt, helics_error *err)
 
void helicsInputGetComplex (helics_input ipt, double *real, double *imag, helics_error *err)
 
int helicsInputGetVectorSize (helics_input ipt)
 
void helicsInputGetVector (helics_input ipt, double data[], int maxLength, int *actualSize, helics_error *err)
 
void helicsInputGetNamedPoint (helics_input ipt, char *outputString, int maxStringLength, int *actualLength, double *val, helics_error *err)
 

Detailed Description

Data can be returned in a number of formats, for instance if data is published as a double it can be returned as a string and vice versa, not all translations make that much sense but they do work.

Function Documentation

◆ helicsInputGetBoolean()

helics_bool helicsInputGetBoolean ( helics_input  ipt,
helics_error err 
)

Get a boolean value from a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
A boolean value of current input value.

References helics_false, and helics_true.

Referenced by helicscpp::Input::getBoolean().

◆ helicsInputGetChar()

char helicsInputGetChar ( helics_input  ipt,
helics_error err 
)

Get a single character value from an input.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
The resulting character value. @forcpponly NAK (negative acknowledgment) symbol returned on error @endforcpponly

◆ helicsInputGetComplex()

void helicsInputGetComplex ( helics_input  ipt,
double *  real,
double *  imag,
helics_error err 
)

Get a pair of double forming a complex number from a subscriptions.

Parameters
iptThe input to get the data for. @forcpponly
[out]realMemory location to place the real part of a value.
[out]imagMemory location to place the imaginary part of a value.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function. On error the values will not be altered. @endforcpponly

@beginPythonOnly

Returns
a pair of floating point values that represent the real and imag values @endPythonOnly

◆ helicsInputGetComplexObject()

helics_complex helicsInputGetComplexObject ( helics_input  ipt,
helics_error err 
)

Get a complex object from an input object.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA helics error object, if the object is not empty the function is bypassed otherwise it is filled in if there is an error. @endforcpponly
Returns
A helics_complex structure with the value.

References helics_time_invalid.

Referenced by helicscpp::Input::getComplex().

◆ helicsInputGetDouble()

double helicsInputGetDouble ( helics_input  ipt,
helics_error err 
)

Get a double value from a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
The double value of the input.

References helics_time_invalid.

Referenced by helicscpp::Input::getDouble().

◆ helicsInputGetInteger()

int64_t helicsInputGetInteger ( helics_input  ipt,
helics_error err 
)

Get an integer value from a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
An int64_t value with the current value of the input.

Referenced by helicscpp::Input::getInteger().

◆ helicsInputGetNamedPoint()

void helicsInputGetNamedPoint ( helics_input  ipt,
char *  outputString,
int  maxStringLength,
int *  actualLength,
double *  val,
helics_error err 
)

Get a named point from a subscription.

Parameters
iptThe input to get the result for. @forcpponly
[out]outputStringStorage for copying a null terminated string.
maxStringLengthThe maximum size of information that str can hold.
[out]actualLengthThe actual length of the string
[out]valThe double value for the named point.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly

@beginPythonOnly

Returns
a string and a double value for the named point @endPythonOnly

References helics::NamedPoint::name, and helics::NamedPoint::value.

Referenced by helicscpp::Input::getNamedPoint().

◆ helicsInputGetRawValue()

void helicsInputGetRawValue ( helics_input  ipt,
void *  data,
int  maxDataLength,
int *  actualSize,
helics_error err 
)

Get the raw data for the latest value of a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[out]dataThe memory location of the data
maxDataLengthThe maximum size of information that data can hold.
[out]actualSizeThe actual length of data copied to data.
[in,out]errA pointer to an error object for catching errors. @endforcpponly

@beginPythonOnly

Returns
Raw string data. @endPythonOnly

References data.

Referenced by helicscpp::Input::getRawValue().

◆ helicsInputGetRawValueSize()

int helicsInputGetRawValueSize ( helics_input  ipt)

Get the size of the raw value for subscription.

Returns
The size of the raw data/string in bytes.

Referenced by helicscpp::Input::getRawValue(), and helicscpp::Input::getRawValueSize().

◆ helicsInputGetString()

void helicsInputGetString ( helics_input  ipt,
char *  outputString,
int  maxStringLength,
int *  actualLength,
helics_error err 
)

Get a string value from a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[out]outputStringStorage for copying a null terminated string.
maxStringLengthThe maximum size of information that str can hold.
[out]actualLengthThe actual length of the string.
[in,out]errError term for capturing errors. @endforcpponly

@beginPythonOnly

Returns
A string data @endPythonOnly

Referenced by helicscpp::Input::getString().

◆ helicsInputGetStringSize()

int helicsInputGetStringSize ( helics_input  ipt)

Get the size of a value for subscription assuming return as a string.

Returns
The size of the string.

Referenced by helicscpp::Input::getNamedPoint(), and helicscpp::Input::getString().

◆ helicsInputGetTime()

helics_time helicsInputGetTime ( helics_input  ipt,
helics_error err 
)

Get a time value from a subscription.

Parameters
iptThe input to get the data for. @forcpponly
[in,out]errA pointer to an error object for catching errors. @endforcpponly
Returns
The resulting time value.

References helics_time_invalid.

◆ helicsInputGetVector()

void helicsInputGetVector ( helics_input  ipt,
double  data[],
int  maxLength,
int *  actualSize,
helics_error err 
)

Get a vector from a subscription.

Parameters
iptThe input to get the result for. @forcpponly
[out]dataThe location to store the data.
maxLengthThe maximum size of the vector.
[out]actualSizeLocation to place the actual length of the resulting vector.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly

@beginPythonOnly

Returns
a list of floating point values @endPythonOnly

References data.

Referenced by helicscpp::Input::getVector().

◆ helicsInputGetVectorSize()

int helicsInputGetVectorSize ( helics_input  ipt)

Get the size of a value for subscription assuming return as an array of doubles.

Returns
The number of doubles in a returned vector.

Referenced by helicscpp::Input::getVector().