SOIL C++
C++ Unified Device Interface
SOIL Namespace Reference

Type definitions. More...

Classes

class  Container
 Data Container. More...
 
class  Container< T, -1, -1 >
 Template specialization for Scalars. More...
 
class  Container< T, x, -1 >
 Template specialization for 1D-Arrays/Vectors. More...
 
class  Element
 SOIL Base Element. More...
 
class  Enum
 SOIL Enum Datatype. More...
 
class  Figure
 Intermediate class for Variable and Parameter that derives from Element. More...
 
class  Function
 Function Class. More...
 
class  Object
 Object Class. More...
 
class  Parameter
 Parameter Class. More...
 
class  Range
 Range Helper Class. More...
 
class  Range< ENUM >
 Enum Range. More...
 
class  Range< std::string >
 String Range. More...
 
class  Time
 SOIL Time. More...
 
class  Variable
 Variable Class. More...
 

Typedefs

typedef int64_t INT
 SOIL Integer. More...
 
typedef double DOUBLE
 SOIL Double. More...
 
typedef bool BOOL
 SOIL Boolean. More...
 
typedef std::string STRING
 SOIL String. More...
 
typedef Enum ENUM
 SOIL Enum. More...
 
typedef Time TIME
 SOIL Time. More...
 
typedef std::vector< unsigned int > DIMENSION
 SOIL Dimension. More...
 

Functions

void null_deleter (SOIL::Element *ptr)
 Null deleter. More...
 
template<typename T >
HTTP::Json datatype (void)
 HTTP JSON datatype. More...
 
template<>
DLL HTTP::Json datatype< double > (void)
 
template<>
DLL HTTP::Json datatype< bool > (void)
 
template<>
DLL HTTP::Json datatype< std::string > (void)
 
template<>
DLL HTTP::Json datatype< int64_t > (void)
 
template<>
DLL HTTP::Json datatype< int > (void)
 
template<>
DLL HTTP::Json datatype< SOIL::TIME > (void)
 
template<>
DLL HTTP::Json datatype< SOIL::ENUM > (void)
 
template<typename T >
DLL web::json::value to_json (const T &value)
 Value to JSON. More...
 
template<typename T >
DLL T to_value (web::json::value json)
 JSON to Value. More...
 
template<>
DLL web::json::value to_json< double > (const double &value)
 
template<>
DLL web::json::value to_json< int64_t > (const int64_t &value)
 
template<>
DLL web::json::value to_json< int > (const int &value)
 
template<>
DLL web::json::value to_json< std::string > (const std::string &value)
 
template<>
DLL web::json::value to_json< SOIL::TIME > (const SOIL::TIME &value)
 
template<>
DLL web::json::value to_json< SOIL::ENUM > (const SOIL::ENUM &value)
 
template<>
DLL web::json::value to_json< SOIL::BOOL > (const bool &value)
 
template<>
DLL double to_value< double > (web::json::value value)
 
template<>
DLL int to_value< int > (web::json::value value)
 
template<>
DLL int64_t to_value< int64_t > (web::json::value value)
 
template<>
DLL std::string to_value< std::string > (web::json::value json)
 
template<>
DLL SOIL::TIME to_value< SOIL::TIME > (web::json::value json)
 
template<>
DLL SOIL::ENUM to_value< SOIL::ENUM > (web::json::value json)
 
template<>
DLL bool to_value< bool > (web::json::value json)
 
DLL bool operator>= (const Time &t1, const Time &t2)
 GEQ Time Operator. More...
 
DLL bool operator<= (const Time &t1, const Time &t2)
 LEQ Time Operator. More...
 

Detailed Description

Set of type definitions to make sure the user can name SOIL specific types without knowing the explicit underlying C++ type.

Typedef Documentation

◆ BOOL

typedef bool SOIL::BOOL

Type definition for boolean type used in SOIL.

Definition at line 33 of file Types.h.

◆ DIMENSION

typedef std::vector<unsigned int> SOIL::DIMENSION

Type definition for the underlying datatype that is used to manage dimensions in SOIL

Definition at line 61 of file Types.h.

◆ DOUBLE

typedef double SOIL::DOUBLE

Type definition for double type used in SOIL. Double is the preferred floating point type in SOIL.

Definition at line 26 of file Types.h.

◆ ENUM

typedef Enum SOIL::ENUM

Type definition for the custom defined Enum in SOIL for consistency.

Definition at line 47 of file Types.h.

◆ INT

typedef int64_t SOIL::INT

Type definition for integer type used in SOIL.

Definition at line 18 of file Types.h.

◆ STRING

typedef std::string SOIL::STRING

Type definition for string type used in SOIL.

Definition at line 40 of file Types.h.

◆ TIME

typedef Time SOIL::TIME

Type definition for the custom defined Time in SOIL for consistency.

Definition at line 54 of file Types.h.

Function Documentation

◆ datatype()

template<typename T >
HTTP::Json SOIL::datatype ( void  )

Returns the datatype part of the SOIL-conformant JSON-representation of the figure, expressed as string. This function is declared in its specializations as it needs to be implemented expclicitiy for each datatype.

Template Parameters
TDataype under consideration
Returns
HTTP JSON representaion as HTTP::Json::string

◆ datatype< bool >()

template<>
HTTP::Json SOIL::datatype< bool > ( void  )

Definition at line 10 of file Figure.cpp.

◆ datatype< double >()

template<>
HTTP::Json SOIL::datatype< double > ( void  )

Definition at line 4 of file Figure.cpp.

◆ datatype< int >()

template<>
HTTP::Json SOIL::datatype< int > ( void  )

Definition at line 31 of file Figure.cpp.

◆ datatype< int64_t >()

template<>
HTTP::Json SOIL::datatype< int64_t > ( void  )

Definition at line 24 of file Figure.cpp.

◆ datatype< SOIL::ENUM >()

template<>
DLL HTTP::Json SOIL::datatype< SOIL::ENUM > ( void  )

◆ datatype< SOIL::TIME >()

template<>
DLL HTTP::Json SOIL::datatype< SOIL::TIME > ( void  )

◆ datatype< std::string >()

template<>
DLL HTTP::Json SOIL::datatype< std::string > ( void  )

◆ null_deleter()

void SOIL::null_deleter ( SOIL::Element ptr)
inline

A function that essentially does nothing which is required as argument in the constructor of Element to avoid that delete is implicitly called a second time in the destructor when the member shared pointer to the object itself is deleted and the internal shared pointer is the last reference to the object. This situation occurs for root objects.

Parameters
[in]ptrPointer on which to do nothing

Definition at line 278 of file Element.h.

◆ operator<=()

bool SOIL::operator<= ( const Time t1,
const Time t2 
)

Friend Operator <=.

Lower or equal operation for two Time objects, which is needed for the correct implementation of the Range class.

Returns true if t1 <= t2, otherwise false. If one of the Time objects is set to null, the operation returns false.

Parameters
t1Left hand side time
t2Right hand side time
Returns
Comparison result as boolean

Definition at line 128 of file Time.cpp.

◆ operator>=()

bool SOIL::operator>= ( const Time t1,
const Time t2 
)

Friend Operator >=.

Greater or equal operation for two Time objects, which is needed for the correct implementation of the Range class.

Returns true if t1 >= t2, otherwise false. If one of the Time objects is set to null, the operation returns false.

Parameters
t1Left hand side time
t2Right hand side time
Returns
Comparison result as boolean

Definition at line 116 of file Time.cpp.

◆ to_json()

template<typename T >
DLL web::json::value SOIL::to_json ( const T &  value)

Helper function to convert a value to its correct JSON value (RHS of key in document). This is a template function that is specialized for every datatype.

Template Parameters
TDatatype under consideration
Parameters
[in]valueValue to convert
Returns
JSON value

◆ to_json< double >()

template<>
web::json::value SOIL::to_json< double > ( const double &  value)

Definition at line 11 of file json_helpers.cpp.

◆ to_json< int >()

template<>
web::json::value SOIL::to_json< int > ( const int &  value)

Definition at line 23 of file json_helpers.cpp.

◆ to_json< int64_t >()

template<>
web::json::value SOIL::to_json< int64_t > ( const int64_t &  value)

Definition at line 17 of file json_helpers.cpp.

◆ to_json< SOIL::BOOL >()

template<>
DLL web::json::value SOIL::to_json< SOIL::BOOL > ( const bool &  value)

◆ to_json< SOIL::ENUM >()

template<>
DLL web::json::value SOIL::to_json< SOIL::ENUM > ( const SOIL::ENUM value)

◆ to_json< SOIL::TIME >()

template<>
DLL web::json::value SOIL::to_json< SOIL::TIME > ( const SOIL::TIME value)

◆ to_json< std::string >()

template<>
DLL web::json::value SOIL::to_json< std::string > ( const std::string &  value)

◆ to_value()

template<typename T >
DLL T SOIL::to_value ( web::json::value  json)

Helper function to convert a value from a JSON object to its equivalent internal SOIL datatype. This is a template function that is specialized for every datatype.

Template Parameters
TDatatype under consideration
Parameters
[in]jsonJSON object to convert
Returns
Value in native datatype

◆ to_value< bool >()

template<>
bool SOIL::to_value< bool > ( web::json::value  json)

Definition at line 92 of file json_helpers.cpp.

◆ to_value< double >()

template<>
double SOIL::to_value< double > ( web::json::value  value)

Definition at line 55 of file json_helpers.cpp.

◆ to_value< int >()

template<>
int SOIL::to_value< int > ( web::json::value  value)

Definition at line 62 of file json_helpers.cpp.

◆ to_value< int64_t >()

template<>
int64_t SOIL::to_value< int64_t > ( web::json::value  value)

Definition at line 68 of file json_helpers.cpp.

◆ to_value< SOIL::ENUM >()

template<>
DLL SOIL::ENUM SOIL::to_value< SOIL::ENUM > ( web::json::value  json)

◆ to_value< SOIL::TIME >()

template<>
DLL SOIL::TIME SOIL::to_value< SOIL::TIME > ( web::json::value  json)

◆ to_value< std::string >()

template<>
DLL std::string SOIL::to_value< std::string > ( web::json::value  json)