sptk2 logo
SPTK Home Page
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
sptk::BaseVariant Class Reference
Inheritance diagram for sptk::BaseVariant:
sptk::VariantAdaptors sptk::Variant sptk::Field sptk::QueryParameter sptk::DatabaseField

Public Member Functions

 BaseVariant ()=default
 Default constructor.
 
 BaseVariant (const BaseVariant &other)=default
 Copy constructor. More...
 
 BaseVariant (BaseVariant &&other) noexcept=default
 Move constructor. More...
 
virtual ~BaseVariant ()=default
 Destructor.
 
VariantDataType dataType () const
 
size_t dataSize () const
 
void dataSize (size_t newDataSize)
 
size_t bufferSize () const
 
bool isNull () const
 
template<typename T >
const T & get () const
 Direct and fast const access to variant data. More...
 
template<typename T >
T & get ()
 Direct and fast access to variant data. More...
 
virtual const MoneyDatagetMoney () const
 
virtual const char * getString () const
 
virtual const uint8_t * getExternalBuffer () const
 
virtual const char * getText () const
 
virtual const uint8_t * getImagePtr () const
 
virtual uint32_t getImageNdx () const
 

Static Public Member Functions

static String typeName (VariantDataType type)
 
static VariantDataType nameType (const char *name)
 

Protected Member Functions

void dataType (VariantType newDataType)
 
void dataType (VariantDataType newDataType)
 
bool isExternalBuffer () const
 
virtual String moneyDataToString () const
 

Protected Attributes

VariantData m_data
 Internal variant data storage.
 

Friends

class VariantAdaptors
 

Constructor & Destructor Documentation

◆ BaseVariant() [1/2]

sptk::BaseVariant::BaseVariant ( const BaseVariant other)
default

Copy constructor.

Parameters
otherThe other object

◆ BaseVariant() [2/2]

sptk::BaseVariant::BaseVariant ( BaseVariant &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other object

Member Function Documentation

◆ bufferSize()

size_t sptk::BaseVariant::bufferSize ( ) const

Returns the allocated buffer size

◆ dataSize() [1/2]

size_t sptk::BaseVariant::dataSize ( ) const

Returns the data size

◆ dataSize() [2/2]

void sptk::BaseVariant::dataSize ( size_t  newDataSize)

Sets the data size

Parameters
newDataSizeData size (in bytes).

◆ dataType() [1/3]

VariantDataType sptk::BaseVariant::dataType ( ) const

Returns the data type

◆ dataType() [2/3]

void sptk::BaseVariant::dataType ( VariantDataType  newDataType)
protected

Sets the data type

◆ dataType() [3/3]

void sptk::BaseVariant::dataType ( VariantType  newDataType)
protected

Sets the data type

◆ get() [1/2]

template<typename T >
T & sptk::BaseVariant::get ( )
inline

Direct and fast access to variant data.

Template Parameters
Tvariant data type
Returns
refernce to variant data

◆ get() [2/2]

template<typename T >
const T & sptk::BaseVariant::get ( ) const
inline

Direct and fast const access to variant data.

Template Parameters
Tvariant data type
Returns
const refernce to variant data

◆ getExternalBuffer()

virtual const uint8_t * sptk::BaseVariant::getExternalBuffer ( ) const
virtual

Directly reads the internal data

◆ getImageNdx()

virtual uint32_t sptk::BaseVariant::getImageNdx ( ) const
virtual

Directly reads the internal data

◆ getImagePtr()

virtual const uint8_t * sptk::BaseVariant::getImagePtr ( ) const
virtual

Directly reads the internal data

◆ getMoney()

virtual const MoneyData & sptk::BaseVariant::getMoney ( ) const
virtual

Directly reads the internal data

◆ getString()

virtual const char * sptk::BaseVariant::getString ( ) const
virtual

Directly reads the internal data

◆ getText()

virtual const char * sptk::BaseVariant::getText ( ) const
virtual

Directly reads the internal data

◆ isExternalBuffer()

bool sptk::BaseVariant::isExternalBuffer ( ) const
inlineprotected
Returns
True if current data type is external buffer

◆ isNull()

bool sptk::BaseVariant::isNull ( ) const

Null flag

Returns true if the NULL state is set

◆ moneyDataToString()

virtual String sptk::BaseVariant::moneyDataToString ( ) const
protectedvirtual

Return money data as string

Returns

◆ nameType()

static VariantDataType sptk::BaseVariant::nameType ( const char *  name)
static

Returns a type for a particular variant type name

Parameters
nameVariant type name

◆ typeName()

static String sptk::BaseVariant::typeName ( VariantDataType  type)
static

Returns a name for a particular variant type

Parameters
typeVariant type

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

Fri Oct 14 2022 09:58:32: SPTK 5.4.1