lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
lintel::db::Argument Class Reference

#include <Arguments.h>

Public Member Functions

 Argument (std::string value, std::string name)
 
const std::string & getValue () const
 
const std::string & getName () const
 
void setConnectionType (ConnectionType connectionType)
 
template<typename TYPE >
TYPE getValue () const
 

Friends

std::ostream & operator<< (std::ostream &os, const db::Argument &argument)
 

Detailed Description

Represents a single named argument with a value and associated connection type.

Constructor & Destructor Documentation

◆ Argument()

lintel::db::Argument::Argument ( std::string  value,
std::string  name 
)

Constructs an argument.

Parameters
valuethe argument value as a string
namethe argument name

Member Function Documentation

◆ getName()

const std::string & lintel::db::Argument::getName ( ) const
Returns
the argument name

◆ getValue() [1/2]

const std::string & lintel::db::Argument::getValue ( ) const
Returns
the raw string value

◆ getValue() [2/2]

template<typename TYPE >
TYPE lintel::db::Argument::getValue ( ) const
inline

Deserializes the value to the requested type based on the connection type.

Template Parameters
TYPEthe target type
Returns
the deserialized value
Exceptions
db::SQLExceptionif the connection type is not a known enumerator

◆ setConnectionType()

void lintel::db::Argument::setConnectionType ( ConnectionType  connectionType)

Sets the connection type for typed deserialization.

Parameters
connectionTypethe database connection type

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const db::Argument &  argument 
)
friend

Streams the argument value and name.


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