ATLAS Offline Software
IDbContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // Package : pool/StorageSvc (The pool framework)
7 //
8 // @author M.Frank
9 //
10 //====================================================================
11 #ifndef POOL_IDBCONTAINER_H
12 #define POOL_IDBCONTAINER_H
13 
14 // Framework include files
16 #include "StorageSvc/DbObject.h"
17 #include "StorageSvc/Transaction.h"
18 
19 #include <vector>
20 #include <cstdint>
21 
22 /*
23  * POOL namespace declaration
24  */
25 namespace pool {
26 
27  // Forward declarations
28  class DbTypeInfo;
29  class DbDatabase;
30  class DbContainer;
31  class DataCallBack;
32  class DbOption;
33  class DbSelect;
34 
35  typedef const class Shape *ShapeH;
36 
47  class IDbContainer {
48  protected:
50  virtual ~IDbContainer() { }
51 
52  public:
54  virtual void release() = 0;
56  virtual uint64_t size() = 0;
58  virtual std::string name() const = 0;
60  virtual DbStatus isShapeSupported(const DbTypeInfo* typ) const = 0;
62  virtual DbStatus setOption(const DbOption& refOpt) = 0;
64  virtual DbStatus getOption(DbOption& refOpt) = 0;
66  virtual void* allocate( unsigned long siz,
67  DbContainer& cntH,
68  ShapeH shape) = 0;
70  virtual DbStatus allocate(DbContainer& cntH,
71  const void* object,
72  ShapeH shape,
73  Token::OID_t& oid) = 0;
75  virtual DbStatus free( void* ptr,
76  DbContainer& cntH) = 0;
77 
79  virtual uint64_t nextRecordId() = 0;
81  virtual void useNextRecordId(uint64_t) = 0;
82 
84  virtual DbStatus close() = 0;
86  virtual DbStatus open( DbDatabase& dbH,
87  const std::string& nam,
88  const DbTypeInfo* info,
89  DbAccessMode mode) = 0;
91  virtual DbStatus update( DbSelect& sel) = 0;
93  virtual DbStatus destroy( DbSelect& sel) = 0;
95  virtual DbStatus select( DbSelect& criteria) = 0;
97  virtual DbStatus fetch(DbSelect& sel) = 0;
98 
100 
109  virtual DbStatus load( void** ptr, ShapeH shape,
110  const Token::OID_t& lnkH,
111  Token::OID_t& oid,
112  bool any_next=false) = 0;
113 
115 
121  virtual DbStatus save( DbContainer& cntH,
122  const void* object,
123  ShapeH shape,
124  Token::OID_t& linkH) = 0;
125 
129 
135  virtual DbStatus update(DbContainer& cntH,
136  const void* object,
137  ShapeH shape,
138  const DbObjectHandle<DbObject>& objH) = 0;
139 
141 
147  virtual DbStatus update(DbContainer& cntH,
148  const void* object,
149  ShapeH shape,
150  const Token::OID_t& linkH) = 0;
151 
153 
157  virtual DbStatus destroy( const Token::OID_t& linkH) = 0;
158 
161 
163  virtual bool updatesPending() const = 0;
164  };
165 } // End namespace pool
166 #endif // POOL_IDBCONTAINER_H
grepfile.info
info
Definition: grepfile.py:38
pool::IDbContainer::update
virtual DbStatus update(DbContainer &cntH, const void *object, ShapeH shape, const Token::OID_t &linkH)=0
Update existing object in the container.
pool::DbAccessMode
int DbAccessMode
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:47
pool::IDbContainer::transAct
virtual DbStatus transAct(Transaction::Action)=0
Execute Transaction Action.
pool::IDbContainer::size
virtual uint64_t size()=0
Access to container size.
pool::DbStatus
Definition: DbStatus.h:67
Transaction.h
pool::IDbContainer::free
virtual DbStatus free(void *ptr, DbContainer &cntH)=0
In place deletion of raw memory.
pool::IDbContainer::useNextRecordId
virtual void useNextRecordId(uint64_t)=0
Suggest next Record ID for tbe next object written - used only with synced indexes.
pool::IDbContainer::allocate
virtual DbStatus allocate(DbContainer &cntH, const void *object, ShapeH shape, Token::OID_t &oid)=0
In place allocation of object location.
pool
pool namespace
Definition: libname.h:15
pool::IDbContainer::close
virtual DbStatus close()=0
Close the container.
pool::IDbContainer
Definition: IDbContainer.h:47
pool::DbObjectHandle
Definition: DbContainer.h:37
pool::IDbContainer::update
virtual DbStatus update(DbContainer &cntH, const void *object, ShapeH shape, const DbObjectHandle< DbObject > &objH)=0
Update existing object in the container.
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
pool::IDbContainer::nextRecordId
virtual uint64_t nextRecordId()=0
Number of next record in the container (=size if no delete is allowed)
pool::IDbContainer::load
virtual DbStatus load(void **ptr, ShapeH shape, const Token::OID_t &lnkH, Token::OID_t &oid, bool any_next=false)=0
Find object within the container and load it into memory.
pool::IDbContainer::updatesPending
virtual bool updatesPending() const =0
Query the pending transaction stack.
pool::IDbContainer::getOption
virtual DbStatus getOption(DbOption &refOpt)=0
Access options.
pool::IDbContainer::destroy
virtual DbStatus destroy(DbSelect &sel)=0
Perform DELETE select.
pool::IDbContainer::update
virtual DbStatus update(DbSelect &sel)=0
Perform UPDATE select.
Token::OID_t
Definition: Token.h:24
pool::ShapeH
const class Shape * ShapeH
Definition: DbContainerObj.h:27
pool::IDbContainer::save
virtual DbStatus save(DbObjectHandle< DbObject > &objH)=0
Add object to the container.
pool::IDbContainer::setOption
virtual DbStatus setOption(const DbOption &refOpt)=0
Set options.
pool::DbOption
Definition: DbOption.h:36
pool::IDbContainer::save
virtual DbStatus save(DbContainer &cntH, const void *object, ShapeH shape, Token::OID_t &linkH)=0
Save new object in the container and return its handle.
pool::IDbContainer::isShapeSupported
virtual DbStatus isShapeSupported(const DbTypeInfo *typ) const =0
Ask if a given shape is supported.
sel
sel
Definition: SUSYToolsTester.cxx:97
pool::IDbContainer::name
virtual std::string name() const =0
Get container name.
pool::DbSelect
Definition: DbSelect.h:44
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
Preparation.mode
mode
Definition: Preparation.py:94
pool::IDbContainer::destroy
virtual DbStatus destroy(const Token::OID_t &linkH)=0
Destroy an object in a container.
pool::IDbContainer::select
virtual DbStatus select(DbSelect &criteria)=0
Define selection criteria.
DbObject.h
pool::IDbContainer::~IDbContainer
virtual ~IDbContainer()
Destructor (called only by sub-classes)
Definition: IDbContainer.h:50
pool::IDbContainer::fetch
virtual DbStatus fetch(DbSelect &sel)=0
Fetch next object address of the selection to set token.
pool::IDbContainer::release
virtual void release()=0
Release the technology specific implementation.
pool::IDbContainer::open
virtual DbStatus open(DbDatabase &dbH, const std::string &nam, const DbTypeInfo *info, DbAccessMode mode)=0
Open the container.
pool::Transaction::Action
Action
Definition: Transaction.h:34
pool::DbContainer
Definition: DbContainer.h:51
pool::IDbContainer::allocate
virtual void * allocate(unsigned long siz, DbContainer &cntH, ShapeH shape)=0
In place allocation of raw memory.
pool::DbDatabase
Definition: DbDatabase.h:53
Token.h
This file contains the class definition for the Token class (migrated from POOL).
pool::DbTypeInfo
Definition: DbTypeInfo.h:47