dxFeed Graal CXX API
Loading...
Searching...
No Matches
StringSymbol Struct Referencefinal

A helper wrapper class needed to pass heterogeneous string symbols using a container and convert them to internal Graal representation. More...

#include <StringSymbol.hpp>

Public Member Functions

 StringSymbol (const char *chars) noexcept
 Constructs StringSymbol from a char array.
 
 StringSymbol (std::string_view stringView) noexcept
 Constructs StringSymbol from a std::string_view.
 
void * toGraal () const
 Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).
 
std::string toString () const noexcept
 Returns a string representation of the current object.
 

Static Public Member Functions

static void freeGraal (void *graalNative)
 Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).
 
static StringSymbol fromGraal (void *graalNative)
 Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.
 

Detailed Description

A helper wrapper class needed to pass heterogeneous string symbols using a container and convert them to internal Graal representation.

The current implementation is suboptimal (by memory usage) and will be enhanced.

Constructor & Destructor Documentation

◆ StringSymbol() [1/2]

StringSymbol::StringSymbol ( const char * chars)
inlinenoexcept

Constructs StringSymbol from a char array.

Parameters
charsThe array of chars

◆ StringSymbol() [2/2]

StringSymbol::StringSymbol ( std::string_view stringView)
inlinenoexcept

Constructs StringSymbol from a std::string_view.

Parameters
stringViewThe string view

Member Function Documentation

◆ freeGraal()

void StringSymbol::freeGraal ( void * graalNative)
static

Releases the memory occupied by the dxFeed Graal SDK structure (recursively if necessary).

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.

Referenced by SymbolWrapper::freeGraal().

◆ fromGraal()

StringSymbol StringSymbol::fromGraal ( void * graalNative)
static

Creates an object of the current type and fills it with data from the the dxFeed Graal SDK structure.

Parameters
graalNativeThe pointer to the dxFeed Graal SDK structure.
Returns
The object of current type.
Exceptions
std::invalid_argument

Referenced by SymbolWrapper::fromGraal().

◆ toGraal()

void * StringSymbol::toGraal ( ) const

Allocates memory for the dxFeed Graal SDK structure (recursively if necessary).

Fills the dxFeed Graal SDK structure's fields by the data of the current entity (recursively if necessary). Returns the pointer to the filled structure.

Returns
The pointer to the filled dxFeed Graal SDK structure

◆ toString()

std::string StringSymbol::toString ( ) const
inlinenoexcept

Returns a string representation of the current object.

Returns
a string representation