helics  3.3.0
Public Member Functions | List of all members
helicscpp::DataBuffer Class Reference

Public Member Functions

 DataBuffer (int capacity)
 
void toBytes (double val)
 
void toBytes (int64_t val)
 
void toBytes (const std::string &val)
 
void toBytes (const std::vector< double > &val)
 
void toBytes (const std::complex< double > val)
 
void toBytes (const double *vals, int size)
 
void toBytes (const std::string &name, double val)
 
void toBytes (bool val)
 
void toBytes (char val)
 
int size ()
 
int capacity ()
 
int stringSize ()
 
std::string toString ()
 
void toString (std::string &str)
 
void toNamedPoint (std::string &name, double *val)
 
int64_t toInt ()
 
bool toBoolean ()
 
double toDouble ()
 
std::complex< double > toComplex ()
 
int toVector (double *data, int maxlen)
 
void toVector (std::vector< double > &data)
 
int toComplexVector (double *data, int maxlen)
 

Member Function Documentation

◆ capacity()

int helicscpp::DataBuffer::capacity ( )
inline

get the size of the raw value

◆ size()

int helicscpp::DataBuffer::size ( )
inline

get the size of the raw value

Referenced by toNamedPoint(), and toString().

◆ stringSize()

int helicscpp::DataBuffer::stringSize ( )
inline

get the size of the value as a string

Referenced by toString().

◆ toBoolean()

bool helicscpp::DataBuffer::toBoolean ( )
inline

get the value as a boolean

References HELICS_TRUE.

◆ toComplex()

std::complex<double> helicscpp::DataBuffer::toComplex ( )
inline

get the value as a complex number

◆ toComplexVector()

int helicscpp::DataBuffer::toComplexVector ( double *  data,
int  maxlen 
)
inline

get the current value as a vector of doubles in alternating real and imaginary

Parameters
datapointer to space to store the current values
maxlenthe maximum size of the allowed vector
Returns
the actual size of the vector stored

◆ toDouble()

double helicscpp::DataBuffer::toDouble ( )
inline

get the value as a double

◆ toInt()

int64_t helicscpp::DataBuffer::toInt ( )
inline

get the current value as a 64 bit integer

◆ toNamedPoint()

void helicscpp::DataBuffer::toNamedPoint ( std::string &  name,
double *  val 
)
inline

get the current value as a named point

References size().

◆ toString() [1/2]

std::string helicscpp::DataBuffer::toString ( )
inline

get the current value as a string

References size(), and stringSize().

◆ toString() [2/2]

void helicscpp::DataBuffer::toString ( std::string &  str)
inline

get the current value as a string

References size(), and stringSize().

◆ toVector() [1/2]

int helicscpp::DataBuffer::toVector ( double *  data,
int  maxlen 
)
inline

get the current value as a vector of doubles

Parameters
datapointer to space to store the current values
maxlenthe maximum size of the allowed vector
Returns
the actual size of the vector stored

◆ toVector() [2/2]

void helicscpp::DataBuffer::toVector ( std::vector< double > &  data)
inline

get the current value and store it in a std::vector<double>


The documentation for this class was generated from the following file: