helics  3.5.2
Functions
GetValue functions

Functions

int helicsInputGetByteCount (HelicsInput ipt)
 
void helicsInputGetBytes (HelicsInput ipt, void *data, int maxDataLength, int *actualSize, HelicsError *err)
 
HelicsDataBuffer helicsInputGetDataBuffer (HelicsInput inp, HelicsError *err)
 
int helicsInputGetStringSize (HelicsInput ipt)
 
void helicsInputGetString (HelicsInput ipt, char *outputString, int maxStringLength, int *actualLength, HelicsError *err)
 
int64_t helicsInputGetInteger (HelicsInput ipt, HelicsError *err)
 
HelicsBool helicsInputGetBoolean (HelicsInput ipt, HelicsError *err)
 
double helicsInputGetDouble (HelicsInput ipt, HelicsError *err)
 
HelicsTime helicsInputGetTime (HelicsInput ipt, HelicsError *err)
 
char helicsInputGetChar (HelicsInput ipt, HelicsError *err)
 
HelicsComplex helicsInputGetComplexObject (HelicsInput ipt, HelicsError *err)
 
void helicsInputGetComplex (HelicsInput ipt, double *real, double *imag, HelicsError *err)
 
int helicsInputGetVectorSize (HelicsInput ipt)
 
void helicsInputGetVector (HelicsInput ipt, double data[], int maxLength, int *actualSize, HelicsError *err)
 
void helicsInputGetComplexVector (HelicsInput ipt, double data[], int maxLength, int *actualSize, HelicsError *err)
 
void helicsInputGetNamedPoint (HelicsInput ipt, char *outputString, int maxStringLength, int *actualLength, double *val, HelicsError *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()

HelicsBool helicsInputGetBoolean ( HelicsInput  ipt,
HelicsError err 
)

Get a boolean value from an input.

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

References HELICS_FALSE, and HELICS_TRUE.

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

◆ helicsInputGetByteCount()

int helicsInputGetByteCount ( HelicsInput  ipt)

Get the size of the raw value for an input.

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

Referenced by helicscpp::Input::getByteCount(), and helicscpp::Input::getBytes().

◆ helicsInputGetBytes()

void helicsInputGetBytes ( HelicsInput  ipt,
void *  data,
int  maxDataLength,
int *  actualSize,
HelicsError err 
)

Get the raw data for the latest value of an input.

Parameters
iptThe input to get the data for.
[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.

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

◆ helicsInputGetChar()

char helicsInputGetChar ( HelicsInput  ipt,
HelicsError err 
)

Get a single character value from an input.

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

◆ helicsInputGetComplex()

void helicsInputGetComplex ( HelicsInput  ipt,
double *  real,
double *  imag,
HelicsError err 
)

Get a pair of double forming a complex number from an input.

Parameters
iptThe input to get the data for.
[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.

◆ helicsInputGetComplexObject()

HelicsComplex helicsInputGetComplexObject ( HelicsInput  ipt,
HelicsError err 
)

Get a complex object from an input object.

Parameters
iptThe input to get the data for.
[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.
Returns
A HelicsComplex structure with the value.

References HELICS_TIME_INVALID.

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

◆ helicsInputGetComplexVector()

void helicsInputGetComplexVector ( HelicsInput  ipt,
double  data[],
int  maxLength,
int *  actualSize,
HelicsError err 
)

Get a complex vector from an input.

Parameters
iptThe input to get the result for.
[out]dataThe location to store the data. The data will be stored in alternating real and imaginary values.
maxLengthThe maximum number of values data can hold.
[out]actualSizeLocation to place the actual length of the resulting complex vector (will be 1/2 the number of values assigned).
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

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

◆ helicsInputGetDataBuffer()

HelicsDataBuffer helicsInputGetDataBuffer ( HelicsInput  inp,
HelicsError err 
)

Get a copy of the raw data in a HelicsDataBuffer

Parameters
inpThe input to get the data for.
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsDataBuffer object containing the data

References helics::data_view::string_view().

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

◆ helicsInputGetDouble()

double helicsInputGetDouble ( HelicsInput  ipt,
HelicsError err 
)

Get a double value from an input.

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

References HELICS_TIME_INVALID.

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

◆ helicsInputGetInteger()

int64_t helicsInputGetInteger ( HelicsInput  ipt,
HelicsError err 
)

Get an integer value from an input.

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

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

◆ helicsInputGetNamedPoint()

void helicsInputGetNamedPoint ( HelicsInput  ipt,
char *  outputString,
int  maxStringLength,
int *  actualLength,
double *  val,
HelicsError err 
)

Get a named point from an input.

Parameters
iptThe input to get the result for.
[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.

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

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

◆ helicsInputGetString()

void helicsInputGetString ( HelicsInput  ipt,
char *  outputString,
int  maxStringLength,
int *  actualLength,
HelicsError err 
)

Get a string value from an input.

Parameters
iptThe input to get the data for.
[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.

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

◆ helicsInputGetStringSize()

int helicsInputGetStringSize ( HelicsInput  ipt)

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

Returns
The size of the string.

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

◆ helicsInputGetTime()

HelicsTime helicsInputGetTime ( HelicsInput  ipt,
HelicsError err 
)

Get a time value from an input.

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

References HELICS_TIME_INVALID.

◆ helicsInputGetVector()

void helicsInputGetVector ( HelicsInput  ipt,
double  data[],
int  maxLength,
int *  actualSize,
HelicsError err 
)

Get a vector from an input.

Parameters
iptThe input to get the result for.
[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.

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

◆ helicsInputGetVectorSize()

int helicsInputGetVectorSize ( HelicsInput  ipt)

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

Returns
The number of doubles in a returned vector.

Referenced by helicscpp::Input::getComplexVector(), and helicscpp::Input::getVector().