Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbNTupleBase Class Reference

A base class for abstract n-tuples. More...

#include <CdbNTupleBase.hh>

Inheritance diagram for CdbNTupleBase:

CdbNTuple< T, NCOL > CdbNTupleSimpleImpl< T, NCOL > List of all members.

Public Member Functions

virtual ~CdbNTupleBase ()
 The destructor.

unsigned int columns () const
 Get the current width (the number of columns) of n-tuple.

std::string name () const
 The name of the n-tuple.

void set_name (const std::string &theName)
 The name can also be dynamically assigned.

std::string description () const
 The description of the n-tuple.

void set_description (const std::string &theDescription)
 The description can also be dynamically assigned.

void column_names (std::vector< std::string > &theVectorOfNames) const
 Get a vector with all column names.

CdbStatus column_name (unsigned int theNumber, std::string &theName) const
 Get the name of specified column number.

CdbStatus column_number (const std::string &theName, unsigned int &theNumber) const
 Get the number of specified column name.

CdbStatus set_column_name (unsigned int theNumber, const std::string &theName)
 Set the name of specified column.


Static Public Member Functions

bool is_system_name (const std::string &theName)
 Check if specified name correspond to so called "system" names of columns.

std::string default_column_name (unsigned int theNumber)
 Get the default column name for specified column number.


Protected Member Functions

 CdbNTupleBase (unsigned int theNumberOfColumns, const std::string &theName, const std::string &theDescription)
 The constructor.

 CdbNTupleBase (unsigned int theNumberOfColumns, const std::vector< std::string > &theCollumnNames, const std::string &theName, const std::string &theDescription)
 The constructor.

 CdbNTupleBase (const CdbNTupleBase &theOther)
 The copy constructor.

CdbNTupleBase & operator= (const CdbNTupleBase &theOther)
 The assignment operator.


Detailed Description

A base class for abstract n-tuples.

This class provides common metadata infrastructure for an abstract n-tuple template class to prevent code bloat at the template level.

Notes:

Definition at line 24 of file CdbNTupleBase.hh.


Constructor & Destructor Documentation

CdbNTupleBase::CdbNTupleBase unsigned int    theNumberOfColumns,
const std::string &    theName,
const std::string &    theDescription
[protected]
 

The constructor.

The constructor will assign default names to the columns. These names will be derived from relative locations of the corresponding columns in a row. For example, for an n-tuple of the width of 4 we would have:

"#0" "#1" "#2" "#3"

Definition at line 44 of file CdbNTupleBase.cc.

CdbNTupleBase::CdbNTupleBase unsigned int    theNumberOfColumns,
const std::vector< std::string > &    theCollumnNames,
const std::string &    theName,
const std::string &    theDescription
[protected]
 

The constructor.

This constructor can be used to specify custom names of columns. The vector of names passed as the first parameter can be of any length, where it would be shorter or longer than the width of n-tuple.

Columns naming rules:

(1) Names passed in the vector must be unique.

(2) Names begining with the '#' symbol are considered as "system" names. Using system names is generally prohibited, except just one case described by the rule (3) below.

(3) The default system names assigned by the above defined constructor can only be used if their naming follows the same rules. A run-time assertion will happen in case of violation of this rule.

(4) If the vector is shorter then elements of the vector will be used to name the first the rest of names will be filled with default names derived from relative position of the corresponding column in a row. See the above defined constructor's description for details.

(5) If the vector is longer - then the rest of the vector will be simply ignored. No correctness checks for names in the rest of the vector would be performed.

Definition at line 55 of file CdbNTupleBase.cc.

CdbNTupleBase::CdbNTupleBase const CdbNTupleBase &    theOther [protected]
 

The copy constructor.

Copy the local context.

Definition at line 125 of file CdbNTupleBase.cc.

CdbNTupleBase::~CdbNTupleBase   [virtual]
 

The destructor.

Just to enforce the virtual destructor.

Definition at line 41 of file CdbNTupleBase.cc.


Member Function Documentation

CdbStatus CdbNTupleBase::column_name unsigned int    theNumber,
std::string &    theName
const
 

Get the name of specified column number.

The column must fit into the n-tuple's width. The method would return CdbStatus::NotFound if it couldn't fine the column.

Definition at line 182 of file CdbNTupleBase.cc.

References CdbStatus::NotFound, and CdbStatus::Success.

void CdbNTupleBase::column_names std::vector< std::string > &    theVectorOfNames const
 

Get a vector with all column names.

The order of names in the vector will be exactly the same as it's defined in an tuple.

Definition at line 175 of file CdbNTupleBase.cc.

CdbStatus CdbNTupleBase::column_number const std::string &    theName,
unsigned int &    theNumber
const
 

Get the number of specified column name.

The column with specified name must be known. The method would return CdbStatus::NotFound if it couldn't fine the column.

Definition at line 191 of file CdbNTupleBase.cc.

References CdbStatus::NotFound, and CdbStatus::Success.

Referenced by CdbNTupleSimpleImpl< T, NCOL >::find_row(), CdbNTupleSimpleImpl< T, NCOL >::get_column(), CdbNTupleSimpleImpl< T, NCOL >::get_element(), and CdbNTupleSimpleImpl< T, NCOL >::set_element().

unsigned int CdbNTupleBase::columns   const
 

Get the current width (the number of columns) of n-tuple.

Definition at line 145 of file CdbNTupleBase.cc.

std::string CdbNTupleBase::default_column_name unsigned int    theNumber [static]
 

Get the default column name for specified column number.

The rules for how these default names will look alike are described in the documentation for constructors of the class.

See also:
CdbNTupleBase::CdbNTupleBase

Definition at line 219 of file CdbNTupleBase.cc.

Referenced by CdbNTupleGlue().

std::string CdbNTupleBase::description   const
 

The description of the n-tuple.

Definition at line 163 of file CdbNTupleBase.cc.

bool CdbNTupleBase::is_system_name const std::string &    theName [static]
 

Check if specified name correspond to so called "system" names of columns.

The rules for how these default system names will look alike are described in the documentation for constructors of the class.

See also:
CdbNTupleBase::CdbNTupleBase

Definition at line 213 of file CdbNTupleBase.cc.

Referenced by CdbNTupleGlue().

std::string CdbNTupleBase::name   const
 

The name of the n-tuple.

Definition at line 151 of file CdbNTupleBase.cc.

CdbNTupleBase & CdbNTupleBase::operator= const CdbNTupleBase &    theOther [protected]
 

The assignment operator.

Copy the local context.

Definition at line 133 of file CdbNTupleBase.cc.

References _columns, _description, _name, and _ncol.

Referenced by CdbNTuple< T, NCOL >::operator=().

CdbStatus CdbNTupleBase::set_column_name unsigned int    theNumber,
const std::string &    theName
 

Set the name of specified column.

The column must fit into the n-tuple's width.

Definition at line 204 of file CdbNTupleBase.cc.

References CdbStatus::NotFound, and CdbStatus::Success.

void CdbNTupleBase::set_description const std::string &    theDescription
 

The description can also be dynamically assigned.

Definition at line 169 of file CdbNTupleBase.cc.

void CdbNTupleBase::set_name const std::string &    theName
 

The name can also be dynamically assigned.

Definition at line 157 of file CdbNTupleBase.cc.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:22 2005 for CDB by doxygen1.3-rc3