ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
pool::CollectionColumn Class Reference

#include <CollectionBase/CollectionColumn.h>

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

Public Member Functions

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

Private Attributes

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

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 ) {}

◆ 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 ),
48  m_maxSize( maxSize ),
50  m_id( 0 ) {}

◆ 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

◆ annotation()

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

Returns the user annotation for this column.

Implements pool::ICollectionColumn.

Definition at line 146 of file CollectionColumn.h.

146 { return m_annotation; }

◆ 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 161 of file CollectionColumn.h.

161 { 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 152 of file CollectionColumn.h.

152 { 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 140 of file CollectionColumn.h.

140 { return m_name; }

◆ operator!=()

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  }

◆ setAnnotation()

virtual void pool::CollectionColumn::setAnnotation ( const std::string &  anno)
inlinevirtual

Returns the user annotation for this column.

Definition at line 137 of file CollectionColumn.h.

137 { m_annotation = anno; }

◆ 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; }

◆ 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 158 of file CollectionColumn.h.

158 { 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 143 of file CollectionColumn.h.

143 { return m_type; }

Member Data Documentation

◆ m_annotation

std::string pool::CollectionColumn::m_annotation
private

User annotation.

Definition at line 171 of file CollectionColumn.h.

◆ m_id

int pool::CollectionColumn::m_id
private

Position of column in associated collection fragment.

Definition at line 181 of file CollectionColumn.h.

◆ m_maxSize

int pool::CollectionColumn::m_maxSize
private

Maximum size of column data type.

Definition at line 175 of file CollectionColumn.h.

◆ m_name

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

Name of column.

Definition at line 165 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 178 of file CollectionColumn.h.

◆ m_type

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

Data type of column.

Definition at line 168 of file CollectionColumn.h.


The documentation for this class was generated from the following file:
pool::CollectionColumn::m_sizeIsFixed
bool m_sizeIsFixed
Flag indicating whether data type of column can vary in size.
Definition: CollectionColumn.h:178
pool::CollectionColumn::name
virtual const std::string & name() const
Returns the name of the column.
Definition: CollectionColumn.h:140
pool::CollectionColumn::sizeIsFixed
virtual bool sizeIsFixed() const
Indicates whether the data type of the column can vary in size.
Definition: CollectionColumn.h:158
pool::CollectionColumn::m_maxSize
int m_maxSize
Maximum size of column data type.
Definition: CollectionColumn.h:175
pool::CollectionColumn::m_annotation
std::string m_annotation
User annotation.
Definition: CollectionColumn.h:171
pool::CollectionColumn::m_id
int m_id
Position of column in associated collection fragment.
Definition: CollectionColumn.h:181
pool::CollectionColumn::m_name
std::string m_name
Name of column.
Definition: CollectionColumn.h:165
pool::CollectionColumn::m_type
std::string m_type
Data type of column.
Definition: CollectionColumn.h:168
pool::CollectionColumn::maxSize
virtual int maxSize() const
Returns the maximum size of the column data type.
Definition: CollectionColumn.h:152
pool::CollectionColumn::id
virtual int id() const
Returns the position of the column in its associated collection fragment.
Definition: CollectionColumn.h:161
pool::CollectionColumn::type
virtual const std::string & type() const
Returns the data type of the column.
Definition: CollectionColumn.h:143