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

#include <CollectionBase/CollectionIndex.h>

Inheritance diagram for pool::CollectionIndex:
Collaboration diagram for pool::CollectionIndex:

Public Member Functions

 CollectionIndex ()
 Default constructor. More...
 
 CollectionIndex (const std::string &indexName, const std::vector< std::string > &columnNames, bool isUnique=false)
 Constructor that takes the index properties as input. More...
 
 CollectionIndex (const pool::CollectionIndex &rhs)
 Copy constructor. More...
 
 ~CollectionIndex ()
 Default destructor. More...
 
CollectionIndexoperator= (const CollectionIndex &rhs)
 Assignment operator. More...
 
bool operator== (const CollectionIndex &rhs) const
 Equality operator. More...
 
bool operator!= (const CollectionIndex &rhs) const
 Inequality operator. More...
 
virtual void setName (const std::string &name)
 Sets the name of the index. More...
 
virtual std::vector< std::string > & columnNames ()
 Returns the names of all columns on which the index is created, with possibility for direct modification. More...
 
virtual void setIsUnique (bool isUnique)
 Sets the uniqueness of the index. More...
 
virtual const std::string & name () const
 Returns the name of the index. More...
 
virtual const std::vector< std::string > & columnNames () const
 Returns the names of all columns on which the index is created. More...
 
virtual bool isUnique () const
 Indicates whether the combination of indexed column values must be different for each row. More...
 

Private Attributes

std::string m_name
 Name of index. More...
 
std::vector< std::string > m_columnNames
 Names of all columns on which index is created. More...
 
bool m_isUnique
 Flag indicating whether index is unique. More...
 

Detailed Description

An implementation of the ICollectionIndex interface for retrieving a description of an index on one or more columns of a collection.

Definition at line 19 of file CollectionIndex.h.

Constructor & Destructor Documentation

◆ CollectionIndex() [1/3]

pool::CollectionIndex::CollectionIndex ( )
inline

Default constructor.

Definition at line 23 of file CollectionIndex.h.

24  : m_name( "" ),
25  m_columnNames(),
26  m_isUnique( false ) {}

◆ CollectionIndex() [2/3]

pool::CollectionIndex::CollectionIndex ( const std::string &  indexName,
const std::vector< std::string > &  columnNames,
bool  isUnique = false 
)
inline

Constructor that takes the index properties as input.

Parameters
indexNameName of index.
columnNamesNames of all columns on which index is created.
isUniqueFlag indicating whether index is unique.

Definition at line 35 of file CollectionIndex.h.

38  : m_name( indexName ),
40  m_isUnique( isUnique ) {}

◆ CollectionIndex() [3/3]

pool::CollectionIndex::CollectionIndex ( const pool::CollectionIndex rhs)
inline

Copy constructor.

Definition at line 43 of file CollectionIndex.h.

44  : ICollectionIndex(),
45  m_name( rhs.m_name ),
47  m_isUnique( rhs.m_isUnique )
48  {}

◆ ~CollectionIndex()

pool::CollectionIndex::~CollectionIndex ( )
inline

Default destructor.

Definition at line 51 of file CollectionIndex.h.

51 {}

Member Function Documentation

◆ columnNames() [1/2]

virtual std::vector<std::string>& pool::CollectionIndex::columnNames ( )
inlinevirtual

Returns the names of all columns on which the index is created, with possibility for direct modification.

Definition at line 95 of file CollectionIndex.h.

95 { return m_columnNames; }

◆ columnNames() [2/2]

virtual const std::vector<std::string>& pool::CollectionIndex::columnNames ( ) const
inlinevirtual

Returns the names of all columns on which the index is created.

Implements pool::ICollectionIndex.

Definition at line 108 of file CollectionIndex.h.

108 { return m_columnNames; }

◆ isUnique()

virtual bool pool::CollectionIndex::isUnique ( ) const
inlinevirtual

Indicates whether the combination of indexed column values must be different for each row.

Implements pool::ICollectionIndex.

Definition at line 111 of file CollectionIndex.h.

111 { return m_isUnique; }

◆ name()

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

Returns the name of the index.

Implements pool::ICollectionIndex.

Definition at line 105 of file CollectionIndex.h.

105 { return m_name; }

◆ operator!=()

Inequality operator.

Definition at line 79 of file CollectionIndex.h.

80  {
81  return ( ! ( *this == rhs ) );
82  }

◆ operator=()

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

Assignment operator.

Definition at line 54 of file CollectionIndex.h.

55  {
56  m_name = rhs.m_name;
57  m_columnNames = rhs.m_columnNames;
58  m_isUnique = rhs.m_isUnique;
59 
60  return *this;
61  }

◆ operator==()

bool pool::CollectionIndex::operator== ( const CollectionIndex rhs) const
inline

Equality operator.

Definition at line 64 of file CollectionIndex.h.

65  {
66  if ( m_name == rhs.m_name &&
67  m_columnNames == rhs.m_columnNames &&
68  m_isUnique == rhs.m_isUnique )
69  {
70  return true;
71  }
72  else
73  {
74  return false;
75  }
76  }

◆ setIsUnique()

virtual void pool::CollectionIndex::setIsUnique ( bool  isUnique)
inlinevirtual

Sets the uniqueness of the index.

Parameters
isUniqueFlag indicating whether index is unique.

Definition at line 102 of file CollectionIndex.h.

102 { m_isUnique = isUnique; }

◆ setName()

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

Sets the name of the index.

Parameters
nameName of index.

Definition at line 89 of file CollectionIndex.h.

89 { m_name = name; }

Member Data Documentation

◆ m_columnNames

std::vector< std::string > pool::CollectionIndex::m_columnNames
private

Names of all columns on which index is created.

Definition at line 118 of file CollectionIndex.h.

◆ m_isUnique

bool pool::CollectionIndex::m_isUnique
private

Flag indicating whether index is unique.

Definition at line 121 of file CollectionIndex.h.

◆ m_name

std::string pool::CollectionIndex::m_name
private

Name of index.

Definition at line 115 of file CollectionIndex.h.


The documentation for this class was generated from the following file:
pool::CollectionIndex::columnNames
virtual std::vector< std::string > & columnNames()
Returns the names of all columns on which the index is created, with possibility for direct modificat...
Definition: CollectionIndex.h:95
pool::CollectionIndex::m_columnNames
std::vector< std::string > m_columnNames
Names of all columns on which index is created.
Definition: CollectionIndex.h:118
pool::CollectionIndex::m_isUnique
bool m_isUnique
Flag indicating whether index is unique.
Definition: CollectionIndex.h:121
pool::CollectionIndex::m_name
std::string m_name
Name of index.
Definition: CollectionIndex.h:115
pool::CollectionIndex::name
virtual const std::string & name() const
Returns the name of the index.
Definition: CollectionIndex.h:105
pool::CollectionIndex::isUnique
virtual bool isUnique() const
Indicates whether the combination of indexed column values must be different for each row.
Definition: CollectionIndex.h:111