BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
rdbModel::Column Class Reference

#include <Column.h>

Public Types

enum  FROM {
  FROMdefault = 1 , FROMautoIncrement , FROMnow , FROMprogram ,
  FROMendUser , FROMdefault = 1 , FROMautoIncrement , FROMnow ,
  FROMprogram , FROMendUser , FROMdefault = 1 , FROMautoIncrement ,
  FROMnow , FROMprogram , FROMendUser
}
enum  CONTENTS {
  CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 , CONTENTSinsertTime = 3 ,
  CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 ,
  CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 ,
  CONTENTSusername = 2 , CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4
}
 Hints to program in case FROM field is FROMprogram. More...
enum  FROM {
  FROMdefault = 1 , FROMautoIncrement , FROMnow , FROMprogram ,
  FROMendUser , FROMdefault = 1 , FROMautoIncrement , FROMnow ,
  FROMprogram , FROMendUser , FROMdefault = 1 , FROMautoIncrement ,
  FROMnow , FROMprogram , FROMendUser
}
enum  CONTENTS {
  CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 , CONTENTSinsertTime = 3 ,
  CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 ,
  CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 ,
  CONTENTSusername = 2 , CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4
}
 Hints to program in case FROM field is FROMprogram. More...
enum  FROM {
  FROMdefault = 1 , FROMautoIncrement , FROMnow , FROMprogram ,
  FROMendUser , FROMdefault = 1 , FROMautoIncrement , FROMnow ,
  FROMprogram , FROMendUser , FROMdefault = 1 , FROMautoIncrement ,
  FROMnow , FROMprogram , FROMendUser
}
enum  CONTENTS {
  CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 , CONTENTSinsertTime = 3 ,
  CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 , CONTENTSusername = 2 ,
  CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4 , CONTENTSunspecified = 0 , CONTENTSserviceName = 1 ,
  CONTENTSusername = 2 , CONTENTSinsertTime = 3 , CONTENTSupdateTime = 4
}
 Hints to program in case FROM field is FROMprogram. More...

Public Member Functions

 Column (Table *myTable=0)
 ~Column ()
const std::string & getName () const
const std::string & getComment () const
const std::string & getDefault () const
const std::string & getTableName () const
DatatypegetDatatype () const
EnumgetEnum () const
bool okValue (const std::string &val, bool set=true) const
bool isCompatible (const Column *otherCol) const
 Return true if otherCol and this have compatible datatypes.
bool nullAllowed () const
 Returns true if column may take on value NULL.
bool stickyInsert () const
bool isPrimaryKey () const
bool isAutoIncrement () const
FROM getSourceType () const
CONTENTS getContentsType () const
bool interpret (const std::string &interpType, std::string &val)
Visitor::VisitorState accept (Visitor *v)
 Column (Table *myTable=0)
 ~Column ()
const std::string & getName () const
const std::string & getComment () const
const std::string & getDefault () const
const std::string & getTableName () const
DatatypegetDatatype () const
EnumgetEnum () const
bool okValue (const std::string &val, bool set=true) const
bool isCompatible (const Column *otherCol) const
 Return true if otherCol and this have compatible datatypes.
bool nullAllowed () const
 Returns true if column may take on value NULL.
bool stickyInsert () const
bool isPrimaryKey () const
bool isAutoIncrement () const
FROM getSourceType () const
CONTENTS getContentsType () const
bool interpret (const std::string &interpType, std::string &val)
Visitor::VisitorState accept (Visitor *v)
 Column (Table *myTable=0)
 ~Column ()
const std::string & getName () const
const std::string & getComment () const
const std::string & getDefault () const
const std::string & getTableName () const
DatatypegetDatatype () const
EnumgetEnum () const
bool okValue (const std::string &val, bool set=true) const
bool isCompatible (const Column *otherCol) const
 Return true if otherCol and this have compatible datatypes.
bool nullAllowed () const
 Returns true if column may take on value NULL.
bool stickyInsert () const
bool isPrimaryKey () const
bool isAutoIncrement () const
FROM getSourceType () const
CONTENTS getContentsType () const
bool interpret (const std::string &interpType, std::string &val)
Visitor::VisitorState accept (Visitor *v)

Friends

class rdbModel::XercesBuilder

Detailed Description

rdbModel representation of a(n SQL-like) table description

Definition at line 22 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

Member Enumeration Documentation

◆ CONTENTS [1/3]

Hints to program in case FROM field is FROMprogram.

Enumerator
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 

Definition at line 38 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

◆ CONTENTS [2/3]

Hints to program in case FROM field is FROMprogram.

Enumerator
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

◆ CONTENTS [3/3]

Hints to program in case FROM field is FROMprogram.

Enumerator
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 
CONTENTSunspecified 
CONTENTSserviceName 
CONTENTSusername 
CONTENTSinsertTime 
CONTENTSupdateTime 

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

◆ FROM [1/3]

Source of value. Note timestamp with value current time should be indicated by contents value CONTENTSupdateTime or (if only upon insert) CONTENTS enterTime

Enumerator
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 

Definition at line 29 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

◆ FROM [2/3]

Source of value. Note timestamp with value current time should be indicated by contents value CONTENTSupdateTime or (if only upon insert) CONTENTS enterTime

Enumerator
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

29 {
30 FROMdefault = 1, // enduser can override default, however
32 FROMnow, // datatype must be timestamp - deprecated
35 };

◆ FROM [3/3]

Source of value. Note timestamp with value current time should be indicated by contents value CONTENTSupdateTime or (if only upon insert) CONTENTS enterTime

Enumerator
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 
FROMdefault 
FROMautoIncrement 
FROMnow 
FROMprogram 
FROMendUser 

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

29 {
30 FROMdefault = 1, // enduser can override default, however
32 FROMnow, // datatype must be timestamp - deprecated
35 };

Constructor & Destructor Documentation

◆ Column() [1/3]

rdbModel::Column::Column ( Table * myTable = 0)
inline

Definition at line 47 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

47 : m_myTable( myTable ), m_type( 0 ), m_isPrimaryKey( false ) {
48 m_contents = CONTENTSunspecified;
49 m_default = std::string( "" );
50 };

Referenced by isCompatible().

◆ ~Column() [1/3]

rdbModel::Column::~Column ( )

Definition at line 12 of file Column.cxx.

12{ delete m_type; }

◆ Column() [2/3]

rdbModel::Column::Column ( Table * myTable = 0)
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

47 : m_myTable( myTable ), m_type( 0 ), m_isPrimaryKey( false ) {
48 m_contents = CONTENTSunspecified;
49 m_default = std::string( "" );
50 };

◆ ~Column() [2/3]

rdbModel::Column::~Column ( )

◆ Column() [3/3]

rdbModel::Column::Column ( Table * myTable = 0)
inline

Definition at line 47 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

47 : m_myTable( myTable ), m_type( 0 ), m_isPrimaryKey( false ) {
48 m_contents = CONTENTSunspecified;
49 m_default = std::string( "" );
50 };

◆ ~Column() [3/3]

rdbModel::Column::~Column ( )

Member Function Documentation

◆ accept() [1/3]

Visitor::VisitorState rdbModel::Column::accept ( Visitor * v)

Definition at line 50 of file Column.cxx.

50 {
51
52 Visitor::VisitorState state = v->visitColumn( this );
53 if ( state == Visitor::VBRANCHDONE ) return Visitor::VCONTINUE;
54 return state;
55 }
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

◆ accept() [2/3]

Visitor::VisitorState rdbModel::Column::accept ( Visitor * v)

◆ accept() [3/3]

Visitor::VisitorState rdbModel::Column::accept ( Visitor * v)

◆ getComment() [1/3]

const std::string & rdbModel::Column::getComment ( ) const
inline

Definition at line 55 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

55{ return m_comment; };

◆ getComment() [2/3]

const std::string & rdbModel::Column::getComment ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

55{ return m_comment; };

◆ getComment() [3/3]

const std::string & rdbModel::Column::getComment ( ) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

55{ return m_comment; };

◆ getContentsType() [1/3]

CONTENTS rdbModel::Column::getContentsType ( ) const
inline

Definition at line 87 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

87{ return m_contents; }

◆ getContentsType() [2/3]

CONTENTS rdbModel::Column::getContentsType ( ) const
inline

Definition at line 87 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

87{ return m_contents; }

◆ getContentsType() [3/3]

CONTENTS rdbModel::Column::getContentsType ( ) const
inline

Definition at line 87 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

87{ return m_contents; }

◆ getDatatype() [1/3]

Datatype * rdbModel::Column::getDatatype ( ) const
inline

Definition at line 61 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

61{ return m_type; };

Referenced by main(), and rdbModel::MysqlConnection::visitColumn().

◆ getDatatype() [2/3]

Datatype * rdbModel::Column::getDatatype ( ) const
inline

Definition at line 61 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

61{ return m_type; };

◆ getDatatype() [3/3]

Datatype * rdbModel::Column::getDatatype ( ) const
inline

Definition at line 61 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

61{ return m_type; };

◆ getDefault() [1/3]

const std::string & rdbModel::Column::getDefault ( ) const
inline

Definition at line 57 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

57{ return m_default; }

◆ getDefault() [2/3]

const std::string & rdbModel::Column::getDefault ( ) const
inline

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

57{ return m_default; }

◆ getDefault() [3/3]

const std::string & rdbModel::Column::getDefault ( ) const
inline

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

57{ return m_default; }

◆ getEnum() [1/3]

Enum * rdbModel::Column::getEnum ( ) const

Return pointer to Enum object associated with this column (if none, return null pointer).

Definition at line 14 of file Column.cxx.

14{ return m_type->getEnum(); }

◆ getEnum() [2/3]

Enum * rdbModel::Column::getEnum ( ) const

Return pointer to Enum object associated with this column (if none, return null pointer).

◆ getEnum() [3/3]

Enum * rdbModel::Column::getEnum ( ) const

Return pointer to Enum object associated with this column (if none, return null pointer).

◆ getName() [1/3]

const std::string & rdbModel::Column::getName ( ) const
inline

◆ getName() [2/3]

const std::string & rdbModel::Column::getName ( ) const
inline

Definition at line 54 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

54{ return m_name; };

◆ getName() [3/3]

const std::string & rdbModel::Column::getName ( ) const
inline

Definition at line 54 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

54{ return m_name; };

◆ getSourceType() [1/3]

FROM rdbModel::Column::getSourceType ( ) const
inline

Definition at line 86 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

86{ return m_from; }

◆ getSourceType() [2/3]

FROM rdbModel::Column::getSourceType ( ) const
inline

Definition at line 86 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

86{ return m_from; }

◆ getSourceType() [3/3]

FROM rdbModel::Column::getSourceType ( ) const
inline

Definition at line 86 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

86{ return m_from; }

◆ getTableName() [1/3]

const std::string & rdbModel::Column::getTableName ( ) const

Definition at line 16 of file Column.cxx.

16{ return m_myTable->getName(); }

◆ getTableName() [2/3]

const std::string & rdbModel::Column::getTableName ( ) const

◆ getTableName() [3/3]

const std::string & rdbModel::Column::getTableName ( ) const

◆ interpret() [1/3]

bool rdbModel::Column::interpret ( const std::string & interpType,
std::string & val )

Handle special literal values, depending loosely on column datatype. Most Column objects won't do any interpretation, but, for example, timestamp-like columns may substitute for "NOW" Return true if any substitution was done

Definition at line 35 of file Column.cxx.

35 {
36 // Currently only interpretation is for timestamp-like columns.
37 // Value of interpType must be "time" and val must be "NOW".
38 // In this case, substitute ascii current time
39 if ( interpType.compare( std::string( "time" ) ) != 0 ) return false;
40
41 Datatype::TYPES dtype = m_type->getType();
42 if ( ( dtype != Datatype::TYPEdatetime ) && ( dtype != Datatype::TYPEtimestamp ) )
43 { return false; }
44 if ( val.compare( std::string( "NOW" ) ) != 0 ) return false;
45
46 val = facilities::Timestamp().getString();
47 return true;
48 }

Referenced by rdbModel::Table::supersedeRow().

◆ interpret() [2/3]

bool rdbModel::Column::interpret ( const std::string & interpType,
std::string & val )

Handle special literal values, depending loosely on column datatype. Most Column objects won't do any interpretation, but, for example, timestamp-like columns may substitute for "NOW" Return true if any substitution was done

◆ interpret() [3/3]

bool rdbModel::Column::interpret ( const std::string & interpType,
std::string & val )

Handle special literal values, depending loosely on column datatype. Most Column objects won't do any interpretation, but, for example, timestamp-like columns may substitute for "NOW" Return true if any substitution was done

◆ isAutoIncrement() [1/3]

bool rdbModel::Column::isAutoIncrement ( ) const

Definition at line 33 of file Column.cxx.

33{ return ( m_from == FROMautoIncrement ); }

Referenced by rdbModel::MysqlConnection::visitColumn().

◆ isAutoIncrement() [2/3]

bool rdbModel::Column::isAutoIncrement ( ) const

◆ isAutoIncrement() [3/3]

bool rdbModel::Column::isAutoIncrement ( ) const

◆ isCompatible() [1/3]

bool rdbModel::Column::isCompatible ( const Column * otherCol) const

Return true if otherCol and this have compatible datatypes.

Definition at line 29 of file Column.cxx.

29 {
30 return m_type->isCompatible( otherCol->m_type );
31 }

Referenced by rdbModel::Assertion::Operator::validCompareOp().

◆ isCompatible() [2/3]

bool rdbModel::Column::isCompatible ( const Column * otherCol) const

Return true if otherCol and this have compatible datatypes.

◆ isCompatible() [3/3]

bool rdbModel::Column::isCompatible ( const Column * otherCol) const

Return true if otherCol and this have compatible datatypes.

◆ isPrimaryKey() [1/3]

bool rdbModel::Column::isPrimaryKey ( ) const
inline

Definition at line 82 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

82{ return m_isPrimaryKey; }

Referenced by main().

◆ isPrimaryKey() [2/3]

bool rdbModel::Column::isPrimaryKey ( ) const
inline

Definition at line 82 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

82{ return m_isPrimaryKey; }

◆ isPrimaryKey() [3/3]

bool rdbModel::Column::isPrimaryKey ( ) const
inline

Definition at line 82 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

82{ return m_isPrimaryKey; }

◆ nullAllowed() [1/3]

bool rdbModel::Column::nullAllowed ( ) const
inline

Returns true if column may take on value NULL.

Definition at line 78 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

78{ return m_null; }

Referenced by calibUtil::Metadata::checkNulls(), and rdbModel::MysqlConnection::visitColumn().

◆ nullAllowed() [2/3]

bool rdbModel::Column::nullAllowed ( ) const
inline

Returns true if column may take on value NULL.

Definition at line 78 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

78{ return m_null; }

◆ nullAllowed() [3/3]

bool rdbModel::Column::nullAllowed ( ) const
inline

Returns true if column may take on value NULL.

Definition at line 78 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

78{ return m_null; }

◆ okValue() [1/3]

bool rdbModel::Column::okValue ( const std::string & val,
bool set = true ) const

See if supplied value meets constraints of column definition

  • val std::string representation of value to be checked
  • set true if value is to be written to column; false if just being used, e.g. in "where" clause

Definition at line 18 of file Column.cxx.

18 {
19 // auto increment and datetime values are established by rdbms
20 if ( set )
21 {
22
23 if ( ( m_from == FROMautoIncrement ) || ( m_from == FROMnow ) ) return false;
24 }
25
26 return m_type->okValue( val );
27 }

Referenced by calibUtil::Metadata::checkValues(), and rdbModel::Assertion::Operator::validCompareOp().

◆ okValue() [2/3]

bool rdbModel::Column::okValue ( const std::string & val,
bool set = true ) const

See if supplied value meets constraints of column definition

  • val std::string representation of value to be checked
  • set true if value is to be written to column; false if just being used, e.g. in "where" clause

◆ okValue() [3/3]

bool rdbModel::Column::okValue ( const std::string & val,
bool set = true ) const

See if supplied value meets constraints of column definition

  • val std::string representation of value to be checked
  • set true if value is to be written to column; false if just being used, e.g. in "where" clause

◆ stickyInsert() [1/3]

bool rdbModel::Column::stickyInsert ( ) const
inline

Definition at line 80 of file Calibration/rdbModel/include/rdbModel/Tables/Column.h.

80{ return m_stickyInsert; }

◆ stickyInsert() [2/3]

bool rdbModel::Column::stickyInsert ( ) const
inline

Definition at line 80 of file InstallArea/x86_64-el9-gcc13-dbg/include/rdbModel/Tables/Column.h.

80{ return m_stickyInsert; }

◆ stickyInsert() [3/3]

bool rdbModel::Column::stickyInsert ( ) const
inline

Definition at line 80 of file InstallArea/x86_64-el9-gcc13-opt/include/rdbModel/Tables/Column.h.

80{ return m_stickyInsert; }

◆ rdbModel::XercesBuilder


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