KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
KVSQLite::column Class Reference

Definition at line 113 of file SQLiteDB.h.

Public Member Functions

virtual ~column ()
 
template<typename T >
Tbinary_data () const
 
const KVNamedParameterdata () const
 
bool foreign_key () const
 
template<typename T >
T get_data () const
 
const char * get_declaration () const
 return declaration for column, including type & constraint More...
 
int index () const
 
bool is_null () const
 
const char * name () const
 
template<typename T >
const columnoperator= (const T &x)
 
bool primary_key () const
 
void print () const
 
template<typename T >
void set_binary_data (T &x)
 
template<typename T >
void set_binary_data (T *x)
 
void set_constraint (const TString &c)
 
template<>
void set_data (const KVNamedParameter &x)
 
template<typename T >
void set_data (const T &x)
 
void set_data_from_statement (TSQLStatement *s, int idx=-1)
 
void set_data_in_statement (TSQLStatement *, int idx=-1) const
 
void set_foreign_key (const table &_table, const column &_column)
 
void set_foreign_key (const TString &_table, const TString &_column)
 
void set_null ()
 
KVSQLite_column_type type () const
 
const char * type_name () const
 

Private Member Functions

 column (int idx, const TString &name, KVSQLite_column_type type)
 
const char * _type ()
 
void init_type_map ()
 

Private Attributes

voidfBlob
 
Long_t fBlobSize
 binary data More...
 
TString fConstraint
 
KVNamedParameter fData
 
TString fFKcolumn
 
TString fFKtable
 
bool fForeignKey
 
int fIndex
 
bool fIsNull
 
std::pair< TString, KVSQLite_column_typefNameType
 
bool fPrimaryKey
 

Static Private Attributes

static std::map< KVSQLite::column_type::types, TStringinv_type_map
 

Friends

class table
 

#include <SQLiteDB.h>

Constructor & Destructor Documentation

◆ column()

KVSQLite::column::column ( int  idx,
const TString name,
KVSQLite_column_type  type 
)
inlineprivate

Definition at line 133 of file SQLiteDB.h.

◆ ~column()

virtual KVSQLite::column::~column ( )
inlinevirtual

clean up binary data

Definition at line 142 of file SQLiteDB.h.

Member Function Documentation

◆ _type()

const char * KVSQLite::column::_type ( )
private

Definition at line 885 of file SQLiteDB.cpp.

◆ binary_data()

template<typename T >
T* KVSQLite::column::binary_data ( ) const
inline

Definition at line 244 of file SQLiteDB.h.

◆ data()

const KVNamedParameter& KVSQLite::column::data ( ) const
inline

Definition at line 234 of file SQLiteDB.h.

◆ foreign_key()

bool KVSQLite::column::foreign_key ( ) const
inline

Definition at line 230 of file SQLiteDB.h.

◆ get_data()

template<typename T >
T KVSQLite::column::get_data ( ) const
inline

Definition at line 239 of file SQLiteDB.h.

◆ get_declaration()

const char * KVSQLite::column::get_declaration ( ) const

return declaration for column, including type & constraint

Definition at line 334 of file SQLiteDB.cpp.

◆ index()

int KVSQLite::column::index ( ) const
inline

Definition at line 162 of file SQLiteDB.h.

◆ init_type_map()

void KVSQLite::column::init_type_map ( )
private

Definition at line 873 of file SQLiteDB.cpp.

◆ is_null()

bool KVSQLite::column::is_null ( ) const
inline

Definition at line 189 of file SQLiteDB.h.

◆ name()

const char* KVSQLite::column::name ( ) const
inline

Definition at line 148 of file SQLiteDB.h.

◆ operator=()

template<typename T >
const column& KVSQLite::column::operator= ( const T x)
inline

set data in column

Definition at line 178 of file SQLiteDB.h.

◆ primary_key()

bool KVSQLite::column::primary_key ( ) const
inline

Definition at line 226 of file SQLiteDB.h.

◆ print()

void KVSQLite::column::print ( ) const
inline

Definition at line 167 of file SQLiteDB.h.

◆ set_binary_data() [1/2]

template<typename T >
void KVSQLite::column::set_binary_data ( T x)
inline

Definition at line 195 of file SQLiteDB.h.

◆ set_binary_data() [2/2]

template<typename T >
void KVSQLite::column::set_binary_data ( T x)
inline

Definition at line 202 of file SQLiteDB.h.

◆ set_constraint()

void KVSQLite::column::set_constraint ( const TString c)
inline

set constraint for column, one of:

PRIMARY KEY
UNIQUE
NOT NULL
#define CHECK(A, MIN, MAX)

Definition at line 211 of file SQLiteDB.h.

◆ set_data() [1/2]

template<>
void KVSQLite::column::set_data ( const KVNamedParameter x)

Definition at line 894 of file SQLiteDB.cpp.

◆ set_data() [2/2]

template<typename T >
void KVSQLite::column::set_data ( const T x)
inline

Definition at line 172 of file SQLiteDB.h.

◆ set_data_from_statement()

void KVSQLite::column::set_data_from_statement ( TSQLStatement s,
int  idx = -1 
)

set value of column according to value of parameter in statement

any column which has a NULL value will be given value 0, 0.0 or "" (for INTEGER, REAL or TEXT type, respectively): use column::is_null() to check if this corresponds to a null column value.

Parameters
idxif given, use it as the statement parameter index instead of the column's index in the table (case where not all columns are treated in the statement)

Definition at line 951 of file SQLiteDB.cpp.

◆ set_data_in_statement()

void KVSQLite::column::set_data_in_statement ( TSQLStatement s,
int  idx = -1 
) const

set value of parameter in SQLite statement corresponding to this column

Parameters
idxif given, use it as the statement parameter index instead of the column's index in the table (case where not all columns are treated in the statement)

Definition at line 908 of file SQLiteDB.cpp.

◆ set_foreign_key() [1/2]

void KVSQLite::column::set_foreign_key ( const table _table,
const column _column 
)

declare this column to be a foreign key i.e. linked to the given _column name in another _table

Definition at line 1010 of file SQLiteDB.cpp.

◆ set_foreign_key() [2/2]

void KVSQLite::column::set_foreign_key ( const TString _table,
const TString _column 
)

declare this column to be a foreign key i.e. linked to the given _column name in another _table

Definition at line 995 of file SQLiteDB.cpp.

◆ set_null()

void KVSQLite::column::set_null ( )
inline

Definition at line 185 of file SQLiteDB.h.

◆ type()

KVSQLite_column_type KVSQLite::column::type ( ) const
inline

Definition at line 152 of file SQLiteDB.h.

◆ type_name()

const char* KVSQLite::column::type_name ( ) const
inline

Definition at line 156 of file SQLiteDB.h.

Friends And Related Function Documentation

◆ table

friend class table
friend

Definition at line 115 of file SQLiteDB.h.

Member Data Documentation

◆ fBlob

void* KVSQLite::column::fBlob
private

Definition at line 122 of file SQLiteDB.h.

◆ fBlobSize

Long_t KVSQLite::column::fBlobSize
private

binary data

Definition at line 123 of file SQLiteDB.h.

◆ fConstraint

TString KVSQLite::column::fConstraint
private

Definition at line 118 of file SQLiteDB.h.

◆ fData

KVNamedParameter KVSQLite::column::fData
private

Definition at line 121 of file SQLiteDB.h.

◆ fFKcolumn

TString KVSQLite::column::fFKcolumn
private

Definition at line 127 of file SQLiteDB.h.

◆ fFKtable

TString KVSQLite::column::fFKtable
private

Definition at line 126 of file SQLiteDB.h.

◆ fForeignKey

bool KVSQLite::column::fForeignKey
private

Definition at line 125 of file SQLiteDB.h.

◆ fIndex

int KVSQLite::column::fIndex
private

Definition at line 119 of file SQLiteDB.h.

◆ fIsNull

bool KVSQLite::column::fIsNull
mutableprivate

Definition at line 128 of file SQLiteDB.h.

◆ fNameType

std::pair<TString, KVSQLite_column_type> KVSQLite::column::fNameType
private

Definition at line 117 of file SQLiteDB.h.

◆ fPrimaryKey

bool KVSQLite::column::fPrimaryKey
private

Definition at line 124 of file SQLiteDB.h.

◆ inv_type_map

std::map< KVSQLite::column_type::types, TString > KVSQLite::column::inv_type_map
staticprivate

Definition at line 120 of file SQLiteDB.h.


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