OpenMS
Loading...
Searching...
No Matches
OpenSwathOSWWriter::OSWValue Struct Reference

Typed OSW cell value used for direct SQLite binding. More...

#include <OpenMS/ANALYSIS/OPENSWATH/OpenSwathOSWWriter.h>

Collaboration diagram for OpenSwathOSWWriter::OSWValue:
[legend]

Classes

union  Storage
 

Public Types

enum class  Type : unsigned char { Null , Int64 , Double , Text }
 

Public Member Functions

 OSWValue ()
 
 ~OSWValue ()
 
 OSWValue (std::nullptr_t)
 
 OSWValue (const char *value)
 
 OSWValue (const std::string &value)
 
 OSWValue (Int64 value)
 
 OSWValue (UInt64 value)
 
 OSWValue (int value)
 
 OSWValue (double value)
 
 OSWValue (const OSWValue &rhs)
 
 OSWValue (OSWValue &&rhs) noexcept
 
OSWValueoperator= (const OSWValue &rhs)
 
OSWValueoperator= (OSWValue &&rhs) noexcept
 
bool isNull () const
 Returns true if the cell should be inserted as SQL NULL.
 
Int64 asInt () const
 Returns the integer payload. Only valid when type == Type::Int64.
 
double asDouble () const
 Returns the double payload. Only valid when type == Type::Double.
 
const std::string & asText () const
 Returns the text payload. Only valid when type == Type::Text.
 

Static Public Member Functions

static OSWValue null ()
 Returns a NULL OSW cell.
 
static OSWValue text (const std::string &value)
 Returns a TEXT OSW cell without numeric/null parsing.
 

Public Attributes

Type type
 
Storage storage
 

Private Member Functions

void destroyText_ ()
 
void copyFrom_ (const OSWValue &rhs)
 
void moveFrom_ (OSWValue &&rhs)
 

Detailed Description

Typed OSW cell value used for direct SQLite binding.

Member Enumeration Documentation

◆ Type

enum class Type : unsigned char
strong
Enumerator
Null 
Int64 
Double 
Text 

Constructor & Destructor Documentation

◆ OSWValue() [1/10]

OSWValue ( )

◆ ~OSWValue()

~OSWValue ( )

◆ OSWValue() [2/10]

OSWValue ( std::nullptr_t  )

◆ OSWValue() [3/10]

OSWValue ( const char *  value)

◆ OSWValue() [4/10]

OSWValue ( const std::string &  value)

◆ OSWValue() [5/10]

OSWValue ( Int64  value)

◆ OSWValue() [6/10]

OSWValue ( UInt64  value)

◆ OSWValue() [7/10]

OSWValue ( int  value)

◆ OSWValue() [8/10]

OSWValue ( double  value)

◆ OSWValue() [9/10]

OSWValue ( const OSWValue rhs)

◆ OSWValue() [10/10]

OSWValue ( OSWValue &&  rhs)
noexcept

Member Function Documentation

◆ asDouble()

double asDouble ( ) const

Returns the double payload. Only valid when type == Type::Double.

◆ asInt()

Int64 asInt ( ) const

Returns the integer payload. Only valid when type == Type::Int64.

◆ asText()

const std::string & asText ( ) const

Returns the text payload. Only valid when type == Type::Text.

◆ copyFrom_()

void copyFrom_ ( const OSWValue rhs)
private

◆ destroyText_()

void destroyText_ ( )
private

◆ isNull()

bool isNull ( ) const

Returns true if the cell should be inserted as SQL NULL.

◆ moveFrom_()

void moveFrom_ ( OSWValue &&  rhs)
private

◆ null()

static OSWValue null ( )
static

Returns a NULL OSW cell.

◆ operator=() [1/2]

OSWValue & operator= ( const OSWValue rhs)

◆ operator=() [2/2]

OSWValue & operator= ( OSWValue &&  rhs)
noexcept

◆ text()

static OSWValue text ( const std::string &  value)
static

Returns a TEXT OSW cell without numeric/null parsing.

Member Data Documentation

◆ storage

Storage storage

◆ type

Type type