ATLAS Offline Software
DbSelect.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //====================================================================
6 // $Id: DbSelect.h 726071 2016-02-25 09:23:05Z krasznaa $
7 //
8 // Package : pool/StorageSvc (The pool framework)
9 //
10 // @author M.Frank
11 //
12 //====================================================================
13 // $Header: /cvs/PF/pool/StorageSvc/StorageSvc/DbSelect.h,v 1.9 2007/11/20 16:43:06 frankb Exp $
14 #ifndef POOL_DBSELECT_H
15 #define POOL_DBSELECT_H
16 
17 // Framework include files
19 #include "StorageSvc/DbStatus.h"
20 
21 // C++ include files
22 #include <string>
23 #include <typeinfo>
24 
25 /*
26  * POOL namespace declaration
27  */
28 namespace pool {
29 
30  // Forward declaration
31  class DbSelectContext;
32  class DbDatabase;
33  class DbContainer;
34 
44  class DbSelect {
45  public:
46 
47  struct Pointer {
48  virtual ~Pointer() {}
49  virtual const std::type_info& type() const = 0;
50  };
51  template <class T> struct Ptr : public Pointer {
52  T* m_ptr;
53  Ptr(T* p) : m_ptr(p) { }
54  virtual ~Ptr() { deletePtr(m_ptr); }
55  virtual const std::type_info& type() const { return typeid(T); }
56  };
57  private:
59  DbSelectContext* m_context;
61  std::string m_criteria;
63  DbSelect() : m_context(0) {}
65  DbSelect(const DbSelect&) = delete;
66  DbSelect& operator= (const DbSelect&) = delete;
67  public:
69  DbSelect(const std::string& crit);
71  virtual ~DbSelect();
73  const std::string& criteria() const { return m_criteria; }
75  Token::OID_t& link() const;
79  Pointer* statement() const;
81  DbDatabase& database() const;
83  void setDatabase(const DbDatabase& dbcH);
89  const Guid& shapeID() const;
91  void setShapeID(const Guid& id);
93  DbStatus start(DbDatabase& dbH, const std::string& cntName);
95  DbStatus next(Token*& refpToken);
96  };
97 } // End namespace pool
98 #endif // POOL_DBSELECT_H
pool::DbSelect::start
DbStatus start(DbDatabase &dbH, const std::string &cntName)
Start selective iterator over a container in a database.
pool::DbSelect::DbSelect
DbSelect(const std::string &crit)
Constructor taking selection criteria.
pool::DbSelect::DbSelect
DbSelect()
No default constructor.
Definition: DbSelect.h:63
pool::DbSelect::Ptr::~Ptr
virtual ~Ptr()
Definition: DbSelect.h:54
pool::DbSelect::m_criteria
std::string m_criteria
String containing the selection criteria.
Definition: DbSelect.h:61
pool::DbStatus
Definition: DbStatus.h:67
pool::DbSelect::database
DbDatabase & database() const
Access referring database context.
pool::DbSelect::next
DbStatus next(Token *&refpToken)
Access the next token of a sequence.
pool::DbSelect::DbSelect
DbSelect(const DbSelect &)=delete
No copy constructor.
pool::DbSelect::setDatabase
void setDatabase(const DbDatabase &dbcH)
Set database context.
pool::DbSelect::operator=
DbSelect & operator=(const DbSelect &)=delete
pool::deletePtr
DbStatus deletePtr(T *&p)
Delete a pointer.
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:102
pool
pool namespace
Definition: libname.h:15
pool::DbSelect::setShapeID
void setShapeID(const Guid &id)
Set shape ID.
pool::DbSelect::Ptr::type
virtual const std::type_info & type() const
Definition: DbSelect.h:55
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
Token::OID_t
Definition: Token.h:24
pool::DbSelect::statement
Pointer * statement() const
Access to existing selection statement.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
pool::DbSelect::Ptr
Definition: DbSelect.h:51
pool::DbSelect
Definition: DbSelect.h:44
pool::DbSelect::Pointer
Definition: DbSelect.h:47
pool::DbSelect::Pointer::~Pointer
virtual ~Pointer()
Definition: DbSelect.h:48
pool::DbSelect::container
DbContainer & container() const
Access referring container context.
pool::DbSelect::setStatement
void setStatement(Pointer *p)
Set selection statement.
pool::DbContainer
Definition: DbContainer.h:51
pool::DbSelect::Pointer::type
virtual const std::type_info & type() const =0
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
pool::DbSelect::m_context
DbSelectContext * m_context
Pointer with database context.
Definition: DbSelect.h:59
pool::DbSelect::~DbSelect
virtual ~DbSelect()
Standard destructor.
pool::DbSelect::criteria
const std::string & criteria() const
Access to selection criteria.
Definition: DbSelect.h:73
pool::DbSelect::link
Token::OID_t & link() const
Access to link handle.
pool::DbDatabase
Definition: DbDatabase.h:53
Token.h
This file contains the class definition for the Token class (migrated from POOL).
pool::DbSelect::setContainer
void setContainer(DbContainer &cntH)
Set container context.
DbStatus.h
pool::DbSelect::shapeID
const Guid & shapeID() const
Access shape ID.
pool::DbSelect::Ptr::m_ptr
T * m_ptr
Definition: DbSelect.h:52
pool::DbSelect::Ptr::Ptr
Ptr(T *p)
Definition: DbSelect.h:53