cqosdb::DefaultProperty Class Reference

An implementation of Parameter. More...

#include <Metadata.hxx>

Inheritance diagram for cqosdb::DefaultProperty:

cqosdb::Parameter

List of all members.

Public Member Functions

 DefaultProperty (string name, string type, int value)
 Constructor: initialize with parameter name, type and integer parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty (string name, string type, long value)
 Constructor: initialize with parameter name, type and long parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty (string name, string type, double value)
 Constructor: initialize with parameter name, type and double parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty (string name, string type, string value)
 Constructor: initialize with parameter name, type and string parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty (string name, string type, bool value)
 Constructor: initialize with parameter name, type and boolean parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty (string name, string type)
 Constructor: initialize with parameter name and type, leaving the value empty and to be filled in later, the type should be 'int', 'long', 'double', 'string' or 'bool'.
 DefaultProperty ()
 ~DefaultProperty ()
string getClassName ()
 Return class name.
void setName (string name)
 Set parameter name.
void setValue (int value)
 Set parameter value, integer type.
void setValue (long value)
 Set parameter value, long integer type.
void setValue (double value)
 Set parameter value, double type.
void setValue (string value)
 Set parameter value, string type.
void setValue (bool value)
 Set parameter value, boolean type.
void setTBName (string tbName)
 Set table where the parameter is stored in the database.
void setTrialID (int trialID)
 Set trial the parameter belongs to.
void setInterEvt (string interEvt)
 Set interval event(intended to be a phase event) the parameter is associated with.
void setCatName (string catName)
 Set parameter's category name.
void setParamType (string type)
 Set parameter's type.
string getName ()
 Grab parameter name.
void getValue (int *value)
 Grab parameter integer value.
void getValue (long *value)
 Grab parameter long integer value.
void getValue (double *value)
 Grab parameter double value.
void getValue (string *value)
 Grab parameter string value.
void getValue (bool *value)
 Grab parameter boolean value.
string getTBName ()
 Grab database table where the parameter is stored.
int getTrialID ()
 Grab trial the parameter belongs to.
string getInterEvt ()
 Grab intervel event number.
string getCatName ()
 Grab parameter's category name.
string getParamType ()
 Grab parameter's type.
bool compareWith (Parameter &another, double tolerance, int relation)
 Compare with another parameter of the same type.
bool compareWith (Parameter &another, int relation)
 Compare with another parameter of the same type.
string getDBConditions ()
 Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameter value from DB.
string getDBConditions (int tbIndex, double tolerance, int relation)
 Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.
string getDBConditions (int tbIndex, string aStr, int relation)
 Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.
string getDBConditions (int tbIndex, bool boolVal, int relation)
 Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.

Private Attributes

string propertyName
 Correspond to parameter_name in the DB.
string propertyType
 Correspond to parameter_type in the DB.
string catName
 Correspond to category_name in the DB.
double doubleValue
 Correspond to parameter_value in the DB.
string stringValue
bool boolValue
string tableName
 Supposed to be 'metadata_parameters'.
int trialID
 Correspond to trial and interval_event in the DB.
string interEvt
bool hasAValue


Detailed Description

An implementation of Parameter.

Constructor & Destructor Documentation

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type,
int  value 
)

Constructor: initialize with parameter name, type and integer parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type,
long  value 
)

Constructor: initialize with parameter name, type and long parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type,
double  value 
)

Constructor: initialize with parameter name, type and double parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type,
string  value 
)

Constructor: initialize with parameter name, type and string parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type,
bool  value 
)

Constructor: initialize with parameter name, type and boolean parameter value, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty ( string  name,
string  type 
)

Constructor: initialize with parameter name and type, leaving the value empty and to be filled in later, the type should be 'int', 'long', 'double', 'string' or 'bool'.

cqosdb::DefaultProperty::DefaultProperty (  ) 

cqosdb::DefaultProperty::~DefaultProperty (  )  [inline]


Member Function Documentation

string cqosdb::DefaultProperty::getClassName (  )  [virtual]

Return class name.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setName ( string  name  )  [virtual]

Set parameter name.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setValue ( int  value  )  [virtual]

Set parameter value, integer type.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setValue ( long  value  )  [virtual]

Set parameter value, long integer type.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setValue ( double  value  )  [virtual]

Set parameter value, double type.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setValue ( string  value  )  [virtual]

Set parameter value, string type.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setValue ( bool  value  )  [virtual]

Set parameter value, boolean type.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setTBName ( string  tbName  )  [virtual]

Set table where the parameter is stored in the database.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setTrialID ( int  trialID  )  [virtual]

Set trial the parameter belongs to.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::setInterEvt ( string  interEvt  ) 

Set interval event(intended to be a phase event) the parameter is associated with.

void cqosdb::DefaultProperty::setCatName ( string  catName  ) 

Set parameter's category name.

void cqosdb::DefaultProperty::setParamType ( string  type  ) 

Set parameter's type.

string cqosdb::DefaultProperty::getName (  )  [virtual]

Grab parameter name.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::getValue ( int *  value  )  [virtual]

Grab parameter integer value.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::getValue ( long *  value  )  [virtual]

Grab parameter long integer value.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::getValue ( double *  value  )  [virtual]

Grab parameter double value.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::getValue ( string *  value  )  [virtual]

Grab parameter string value.

Implements cqosdb::Parameter.

void cqosdb::DefaultProperty::getValue ( bool *  value  )  [virtual]

Grab parameter boolean value.

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getTBName (  )  [virtual]

Grab database table where the parameter is stored.

Implements cqosdb::Parameter.

int cqosdb::DefaultProperty::getTrialID (  )  [virtual]

Grab trial the parameter belongs to.

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getInterEvt (  ) 

Grab intervel event number.

string cqosdb::DefaultProperty::getCatName (  ) 

Grab parameter's category name.

string cqosdb::DefaultProperty::getParamType (  ) 

Grab parameter's type.

bool cqosdb::DefaultProperty::compareWith ( Parameter another,
double  tolerance,
int  relation 
) [virtual]

Compare with another parameter of the same type.

Parameters:
another another parameter
tolerance comparison tolerance value
relation comparison relation, which could be LT, LTEQ, GT, GTEQ, EQ, NEQ, BT
Returns:
true if (this-another) .relation. tolerance is true, false otherwise

Implements cqosdb::Parameter.

bool cqosdb::DefaultProperty::compareWith ( Parameter another,
int  relation 
) [virtual]

Compare with another parameter of the same type.

Parameters:
another another parameter
relation comparison relation, which could be LT, LTEQ, GT, GTEQ, EQ, NEQ
Returns:
true if this .relation. another is true, false otherwise

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getDBConditions (  )  [virtual]

Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameter value from DB.

for example, if parameter.getName() = 'myName', parameter.getTBName() = 'myTB', parameter.getTrialID() =0; parameter.getInterEvtNo()=1, then the string is like: myTB.parameter_name='myName' and myTB.trial=0 and myTB.intervel_event=1

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getDBConditions ( int  tbIndex,
double  value,
int  relation 
) [virtual]

Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.

Parameters:
tbIndex >= 0 index of the parameter table < 0 don't use index
value,value to compare with
relation comparison relation, either L, LTEQ, EQ, NEQ, GT, GTEQ, or BT
For example, if parameter.getName() = 'myName', parameter.getTBName() = 'myTB', parameter.getTrialID() =0; parameter.getInterEvtNo()=1, parameter.getValue()=3, tbIndex =0, value = 0.3, relation = LT then the string is like: myTB0.parameter_name='myName' and myTB0.trial=0 and myTB0.interval_event=1 and myTB0.parameter_value < 0.3

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getDBConditions ( int  tbIndex,
string  aStr,
int  relation 
) [virtual]

Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.

Parameters:
tbIndex >= 0 index of the parameter table < 0 don't use index
aStr string to compare with
relation comparison relation, either EQ, or NEQ
For example, if parameter.getName() = 'myName', parameter.getTBName() = 'myTB', parameter.getTrialID() =0; parameter.getInterEvtNo()=1, parameter.getValue()='foo', tbIndex =0, aStr = 'fet', relation = eq then the string is like: myTB0.parameter_name='myName' and myTB0.trial=0 and myTB0.interval_event=1 and myTB0.parameter_value = 'fet'

Implements cqosdb::Parameter.

string cqosdb::DefaultProperty::getDBConditions ( int  tbIndex,
bool  boolVal,
int  relation 
) [virtual]

Produce a SQL string text that specifies conditions related to the parameter, which can be used in 'where' clause in a SQL command for retrieving parameters satisfying the conditions.

Parameters:
tbIndex >= 0 index of the parameter table < 0 don't use index
boolVal boolean value to compare with
relation comparison relation, either EQ, or NEQ
For example, if parameter.getName() = 'myName', parameter.getTBName() = 'myTB', parameter.getTrialID() =0; parameter.getInterEvtNo()=1, parameter.getValue()='true', tbIndex =0, boolVal = true, relation = eq then the string is like: myTB0.parameter_name='myName' and myTB0.trial=0 and myTB0.interval_event=1 and myTB0.parameter_value = 'true'

Implements cqosdb::Parameter.


Member Data Documentation

Correspond to parameter_name in the DB.

Correspond to parameter_type in the DB.

Correspond to category_name in the DB.

Correspond to parameter_value in the DB.

Supposed to be 'metadata_parameters'.

Correspond to trial and interval_event in the DB.


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

Generated on Tue Sep 23 19:59:06 2008 for CQoS Database Library by  doxygen 1.5.5