ATLAS Offline Software
Loading...
Searching...
No Matches
pool::CollectionColumn Class Reference

An implementation of the ICollectionColumn interface for retrieving a description of a column of a collection. More...

#include <CollectionSvc/CollectionColumn.h>

Inheritance diagram for pool::CollectionColumn:
Collaboration diagram for pool::CollectionColumn:

Public Member Functions

 CollectionColumn ()
 Default constructor.
 CollectionColumn (const std::string &name, const std::string &type, int maxSize=0, bool sizeIsFixed=true)
 Constructor that takes the column properties as input.
 CollectionColumn (const CollectionColumn &rhs)
 Copy constructor.
 ~CollectionColumn ()
 Default destructor.
CollectionColumnoperator= (const CollectionColumn &rhs)
 Assignment operator.
bool operator== (const CollectionColumn &rhs) const
 Equality operator.
bool operator!= (const CollectionColumn &rhs) const
 Inequality operator.
virtual void setName (const std::string &name)
 Sets the name of the column.
virtual void setType (const std::string &type)
 Sets the data type of the column.
virtual void setType (const std::type_info &type)
 Sets the data type of the column.
virtual void setMaxSize (int maxSize)
 Sets the maximum size of the column data type.
virtual void setSizeIsFixed (bool sizeIsFixed)
 Sets a flag indicating whether the size of the column data type may vary.
virtual void setId (int id)
 Sets the position of the column in its associated collection fragment.
virtual const std::string & name () const
 Returns the name of the column.
virtual const std::string & type () const
 Returns the data type of the column.
virtual int maxSize () const
 Returns the maximum size of the column data type.
virtual bool sizeIsFixed () const
 Indicates whether the data type of the column can vary in size.
virtual int id () const
 Returns the position of the column in its associated collection fragment.

Private Attributes

std::string m_name
 Name of column.
std::string m_type
 Data type of column.
int m_maxSize
 Maximum size of column data type.
bool m_sizeIsFixed
 Flag indicating whether data type of column can vary in size.
int m_id
 Position of column in associated collection fragment.

Detailed Description

An implementation of the ICollectionColumn interface for retrieving a description of a column of a collection.

Definition at line 23 of file CollectionColumn.h.

Constructor & Destructor Documentation

◆ CollectionColumn() [1/3]

pool::CollectionColumn::CollectionColumn ( )
inline

Default constructor.

Definition at line 27 of file CollectionColumn.h.

28 : m_name( "" ),
29 m_type( "" ),
30 m_maxSize( 0 ),
31 m_sizeIsFixed( true ),
32 m_id( 0 ) {}
bool m_sizeIsFixed
Flag indicating whether data type of column can vary in size.
std::string m_name
Name of column.
std::string m_type
Data type of column.
int m_id
Position of column in associated collection fragment.
int m_maxSize
Maximum size of column data type.

◆ CollectionColumn() [2/3]

pool::CollectionColumn::CollectionColumn ( const std::string & name,
const std::string & type,
int maxSize = 0,
bool sizeIsFixed = true )
inline

Constructor that takes the column properties as input.

Parameters
nameName of column.
typeData type of column.
maxSizeMaximum size of column data type.
sizeIsFixedFlag to allow column data type to vary in size.

Definition at line 42 of file CollectionColumn.h.

46 : m_name( name ),
47 m_type( type ),
50 m_id( 0 ) {}
virtual bool sizeIsFixed() const
Indicates whether the data type of the column can vary in size.
virtual int maxSize() const
Returns the maximum size of the column data type.
virtual const std::string & name() const
Returns the name of the column.
virtual const std::string & type() const
Returns the data type of the column.

◆ CollectionColumn() [3/3]

pool::CollectionColumn::CollectionColumn ( const CollectionColumn & rhs)
inline

Copy constructor.

Definition at line 53 of file CollectionColumn.h.

54 : ICollectionColumn(),
55 m_name( rhs.m_name ),
56 m_type( rhs.m_type ),
57 m_maxSize( rhs.m_maxSize ),
58 m_sizeIsFixed( rhs.m_sizeIsFixed ),
59 m_id( rhs.m_id )
60 {}

◆ ~CollectionColumn()

pool::CollectionColumn::~CollectionColumn ( )
inline

Default destructor.

Definition at line 63 of file CollectionColumn.h.

63{}

Member Function Documentation

◆ id()

virtual int pool::CollectionColumn::id ( ) const
inlinevirtual

Returns the position of the column in its associated collection fragment.

Implements pool::ICollectionColumn.

Definition at line 155 of file CollectionColumn.h.

155{ return m_id; }

◆ maxSize()

virtual int pool::CollectionColumn::maxSize ( ) const
inlinevirtual

Returns the maximum size of the column data type.

This information is useful for data of type string or blob.

Implements pool::ICollectionColumn.

Definition at line 146 of file CollectionColumn.h.

146{ return m_maxSize; }

◆ name()

virtual const std::string & pool::CollectionColumn::name ( ) const
inlinevirtual

Returns the name of the column.

Implements pool::ICollectionColumn.

Definition at line 137 of file CollectionColumn.h.

137{ return m_name; }

◆ operator!=()

bool pool::CollectionColumn::operator!= ( const CollectionColumn & rhs) const
inline

Inequality operator.

Definition at line 90 of file CollectionColumn.h.

91 {
92 return !( *this == rhs );
93 }

◆ operator=()

CollectionColumn & pool::CollectionColumn::operator= ( const CollectionColumn & rhs)
inline

Assignment operator.

Definition at line 66 of file CollectionColumn.h.

67 {
68 m_name = rhs.m_name;
69 m_type = rhs.m_type;
70 m_maxSize = rhs.m_maxSize;
71 m_sizeIsFixed = rhs.m_sizeIsFixed;
72 m_id = rhs.m_id;
73
74 return *this;
75 }

◆ operator==()

bool pool::CollectionColumn::operator== ( const CollectionColumn & rhs) const
inline

Equality operator.

Definition at line 78 of file CollectionColumn.h.

79 {
80 return
81 m_name == rhs.m_name &&
82 m_type == rhs.m_type &&
83 m_maxSize == rhs.m_maxSize &&
84 m_sizeIsFixed == rhs.m_sizeIsFixed
85 // && m_id == rhs.m_id //MN - does not matter?
86 ;
87 }

◆ setId()

virtual void pool::CollectionColumn::setId ( int id)
inlinevirtual

Sets the position of the column in its associated collection fragment.

Definition at line 134 of file CollectionColumn.h.

134{ m_id = id; }
virtual int id() const
Returns the position of the column in its associated collection fragment.

◆ setMaxSize()

virtual void pool::CollectionColumn::setMaxSize ( int maxSize)
inlinevirtual

Sets the maximum size of the column data type.

This method is useful for data of type string or blob.

Parameters
maxSizeMaximum size of column data type.

Definition at line 123 of file CollectionColumn.h.

123{ m_maxSize = maxSize; }

◆ setName()

virtual void pool::CollectionColumn::setName ( const std::string & name)
inlinevirtual

Sets the name of the column.

Parameters
nameName of column.

Definition at line 100 of file CollectionColumn.h.

100{ m_name = name; }

◆ setSizeIsFixed()

virtual void pool::CollectionColumn::setSizeIsFixed ( bool sizeIsFixed)
inlinevirtual

Sets a flag indicating whether the size of the column data type may vary.

This method is useful for data of type string or blob.

Parameters
sizeIsFixedFlag to allow column data type to vary in size.

Definition at line 131 of file CollectionColumn.h.

◆ setType() [1/2]

virtual void pool::CollectionColumn::setType ( const std::string & type)
inlinevirtual

Sets the data type of the column.

Parameters
typeData type of column.

Definition at line 107 of file CollectionColumn.h.

107{ m_type = type; }

◆ setType() [2/2]

virtual void pool::CollectionColumn::setType ( const std::type_info & type)
inlinevirtual

Sets the data type of the column.

Parameters
typeData type of column.

Definition at line 114 of file CollectionColumn.h.

115 { m_type = coral::AttributeSpecification::typeNameForId( type ); }

◆ sizeIsFixed()

virtual bool pool::CollectionColumn::sizeIsFixed ( ) const
inlinevirtual

Indicates whether the data type of the column can vary in size.

This information is useful for data of type string or blob.

Implements pool::ICollectionColumn.

Definition at line 152 of file CollectionColumn.h.

152{ return m_sizeIsFixed; }

◆ type()

virtual const std::string & pool::CollectionColumn::type ( ) const
inlinevirtual

Returns the data type of the column.

Implements pool::ICollectionColumn.

Definition at line 140 of file CollectionColumn.h.

140{ return m_type; }

Member Data Documentation

◆ m_id

int pool::CollectionColumn::m_id
private

Position of column in associated collection fragment.

Definition at line 171 of file CollectionColumn.h.

◆ m_maxSize

int pool::CollectionColumn::m_maxSize
private

Maximum size of column data type.

Definition at line 165 of file CollectionColumn.h.

◆ m_name

std::string pool::CollectionColumn::m_name
private

Name of column.

Definition at line 159 of file CollectionColumn.h.

◆ m_sizeIsFixed

bool pool::CollectionColumn::m_sizeIsFixed
private

Flag indicating whether data type of column can vary in size.

Definition at line 168 of file CollectionColumn.h.

◆ m_type

std::string pool::CollectionColumn::m_type
private

Data type of column.

Definition at line 162 of file CollectionColumn.h.


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