ATLAS Offline Software
|
#include <src/DbContainerObj.h>
Public Types | |
typedef DbAccessObj< DbObject *, DbObjectHolder > | Base |
Type definitions. More... | |
typedef std::map< DbObject *, DbObjectHolder * > | Keys |
typedef Keys::iterator | iterator |
typedef Keys::const_iterator | const_iterator |
Public Member Functions | |
DbContainerObj (DbDatabase &dbH, const std::string &nam, const DbType &dbtyp, DbAccessMode mod) | |
Standard constructor of a container object using the Database handle as a clustering hint. More... | |
virtual | ~DbContainerObj () |
Standard destructor. More... | |
const IDbContainer * | info () const |
Access to internals. More... | |
IDbContainer * | info () |
const DbTypeInfo * | objectShape (const Guid &nam) |
Retrieve persistent type information by name. More... | |
DbStatus | addShape (const DbTypeInfo *typ) |
Add persistent type. Returns error if the type is not supported. More... | |
DbDatabase & | database () |
Handle to Database (CONST) More... | |
const Token * | token () const |
Access the token of the container object. More... | |
bool | updatesPending () const |
Query the pending transaction stack. More... | |
bool | isOpen () const |
Flag if container was opened. More... | |
bool | isReadOnly () const |
Check if database is in read-only mode. More... | |
void | cancelTransaction () |
Cancel transaction flag. More... | |
uint64_t | size () |
Size of the Database container (=# of objects) More... | |
DbStatus | open (const DbTypeInfo *typ) |
Open the container. More... | |
DbStatus | close () |
Close the container. More... | |
DbStatus | retire () |
Retire the container. More... | |
DbStatus | transAct (Transaction::Action) |
Execute Database Transaction Action. More... | |
DbStatus | setOption (const DbOption &opt) |
Pass options to the implementation. More... | |
DbStatus | getOption (DbOption &refOpt) |
Access options. More... | |
DbStatus | remove (ObjHandle &objH) |
Remove the transient representation of the object from memory. More... | |
DbStatus | destroy (const Token::OID_t &linkH) |
Destroy an existing persistent object identified by its handle. More... | |
DbStatus | save (DbObjectHandle< DbObject > &objH, const DbTypeInfo *typ) |
Add an object to the container identified by its handle. More... | |
void * | allocate (unsigned long siz, DbContainer &cntH, ShapeH shape) |
In place allocation of raw memory. More... | |
DbStatus | allocate (DbContainer &cntH, const void *object, ShapeH shape, Token::OID_t &oid) |
In place allocation of object location. More... | |
DbStatus | free (void *ptr, DbContainer &cntH) |
In place free of raw memory. More... | |
DbStatus | save (DbContainer &cntH, const void *object, ShapeH shape, Token::OID_t &linkH) |
Save new object in the container and return its handle. More... | |
DbStatus | update (DbContainer &cntH, const void *object, ShapeH shape, const Token::OID_t &linkH) |
Update an object to the container identified by its handle. More... | |
DbStatus | update (DbContainer &cntH, const void *object, ShapeH shape, const DbObjectHandle< DbObject > &objH) |
Update existing object in the container. More... | |
DbStatus | load (void **ptr, ShapeH shape, const Token::OID_t &linkH, Token::OID_t &oid, bool any_next) |
Select object in the container identified by its handle. More... | |
DbStatus | update (DbSelect &sel) |
Perform UPDATE select. More... | |
DbStatus | destroy (DbSelect &sel) |
Perform DELETE statement. More... | |
DbStatus | select (DbSelect &sel) |
Perform selection. The statement belongs to the container afterwards. More... | |
DbStatus | fetch (DbSelect &sel) |
Fetch next object address of the selection to set token. More... | |
const std::string & | name () const |
Access the instance name. More... | |
void | setName (const std::string &n) |
Access the instance name. More... | |
DbAccessMode | mode () const |
Access mode. More... | |
void | setMode (DbAccessMode m) |
Set Access mode. More... | |
const DbType & | type () const |
const IOODatabase * | db () const |
Allow access to the Database implementation. More... | |
IOODatabase * | db () |
int | refCount () const |
Access reference counter. More... | |
int | addRef () const |
Add reference count. More... | |
int | release () const |
Remove reference count. More... | |
DbStatus | clearEntries () |
Object cleanup: remove all entries. More... | |
const DbObjectHolder * | find (const DbObject * &key) const |
Find object by key (CONST) More... | |
DbObjectHolder * | find (const DbObject * &key) |
Find object by key. More... | |
DbStatus | add (const DbObject * &key, DbObjectHolder *val) |
Add entry to container. More... | |
DbStatus | remove (const DbObjectHolder *val) |
Remove entry from container. More... | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Private Types | |
typedef DbObjectHandle< DbObject > | ObjHandle |
Private Member Functions | |
bool | hasAccess () |
Check database access. More... | |
Private Attributes | |
IDbContainer * | m_info |
Pointer to interface of the technology dependent part. More... | |
const Token * | m_tokH |
Container token. More... | |
DbDatabase | m_dbH |
Handle to hosting Database. More... | |
bool | m_isOpen |
Flag indication DbStatus of technology dependent container. More... | |
std::atomic< int > | m_refCount |
Reference counter. More... | |
DbAccessMode | m_mode |
Access mode. More... | |
std::string | m_name |
Name of the instance. More... | |
DbType | m_type |
Database type. More... | |
Keys | m_keys |
Key entry buffer. More... | |
IOODatabase * | m_pool |
Pointer to specific pool implementation. More... | |
Description:
Implementation independent part of a container object objects.
There is a ring of protection around the object. The object can only be accessed through its handle, the technology dependent code and the DbDatabaseObj object hosting the container. This should ensure proper reference counting and inhibit non existing references flying around.
Definition at line 50 of file DbContainerObj.h.
|
inherited |
Type definitions.
Definition at line 50 of file DbAccessObj.h.
|
inherited |
Definition at line 53 of file DbAccessObj.h.
|
inherited |
Definition at line 52 of file DbAccessObj.h.
|
inherited |
Definition at line 51 of file DbAccessObj.h.
|
private |
Definition at line 52 of file DbContainerObj.h.
pool::DbContainerObj::DbContainerObj | ( | DbDatabase & | dbH, |
const std::string & | nam, | ||
const DbType & | dbtyp, | ||
DbAccessMode | mod | ||
) |
Standard constructor of a container object using the Database handle as a clustering hint.
dbH | [IN] Valid handle to database object |
nam | [IN] Name of the container to be opened. |
dbtyp | [IN] Database type (including minor type) |
mod | [IN] Access mode. |
|
virtual |
Standard destructor.
|
inlineinherited |
|
inlineinherited |
DbStatus pool::DbContainerObj::addShape | ( | const DbTypeInfo * | typ | ) |
Add persistent type. Returns error if the type is not supported.
DbStatus pool::DbContainerObj::allocate | ( | DbContainer & | cntH, |
const void * | object, | ||
ShapeH | shape, | ||
Token::OID_t & | oid | ||
) |
In place allocation of object location.
void* pool::DbContainerObj::allocate | ( | unsigned long | siz, |
DbContainer & | cntH, | ||
ShapeH | shape | ||
) |
In place allocation of raw memory.
|
inlineinherited |
Definition at line 163 of file DbAccessObj.h.
|
inlineinherited |
Definition at line 164 of file DbAccessObj.h.
|
inline |
|
inlineinherited |
DbStatus pool::DbContainerObj::close | ( | ) |
Close the container.
|
inline |
|
inlineinherited |
Definition at line 87 of file DbAccessObj.h.
|
inlineinherited |
DbStatus pool::DbContainerObj::destroy | ( | const Token::OID_t & | linkH | ) |
Destroy an existing persistent object identified by its handle.
|
inlineinherited |
Definition at line 165 of file DbAccessObj.h.
|
inlineinherited |
Definition at line 166 of file DbAccessObj.h.
Fetch next object address of the selection to set token.
|
inlineinherited |
|
inlineinherited |
Find object by key (CONST)
Definition at line 132 of file DbAccessObj.h.
DbStatus pool::DbContainerObj::free | ( | void * | ptr, |
DbContainer & | cntH | ||
) |
In place free of raw memory.
|
private |
Check database access.
|
inline |
Definition at line 82 of file DbContainerObj.h.
|
inline |
|
inline |
|
inline |
DbStatus pool::DbContainerObj::load | ( | void ** | ptr, |
ShapeH | shape, | ||
const Token::OID_t & | linkH, | ||
Token::OID_t & | oid, | ||
bool | any_next | ||
) |
Select object in the container identified by its handle.
|
inlineinherited |
|
inlineinherited |
const DbTypeInfo* pool::DbContainerObj::objectShape | ( | const Guid & | nam | ) |
Retrieve persistent type information by name.
DbStatus pool::DbContainerObj::open | ( | const DbTypeInfo * | typ | ) |
Open the container.
|
inlineinherited |
|
inlineinherited |
Remove reference count.
Definition at line 103 of file DbAccessObj.h.
|
inlineinherited |
Remove the transient representation of the object from memory.
DbStatus pool::DbContainerObj::retire | ( | ) |
Retire the container.
DbStatus pool::DbContainerObj::save | ( | DbContainer & | cntH, |
const void * | object, | ||
ShapeH | shape, | ||
Token::OID_t & | linkH | ||
) |
Save new object in the container and return its handle.
cntH | [IN] Handle to container object. |
linkH | [OUT] Internal OID to identify object. |
DbStatus pool::DbContainerObj::save | ( | DbObjectHandle< DbObject > & | objH, |
const DbTypeInfo * | typ | ||
) |
Add an object to the container identified by its handle.
Perform selection. The statement belongs to the container afterwards.
|
inlineinherited |
|
inlineinherited |
Pass options to the implementation.
uint64_t pool::DbContainerObj::size | ( | ) |
Size of the Database container (=# of objects)
DbStatus pool::DbContainerObj::transAct | ( | Transaction::Action | ) |
Execute Database Transaction Action.
|
inlineinherited |
Definition at line 84 of file DbAccessObj.h.
DbStatus pool::DbContainerObj::update | ( | DbContainer & | cntH, |
const void * | object, | ||
ShapeH | shape, | ||
const DbObjectHandle< DbObject > & | objH | ||
) |
Update existing object in the container.
cntH | [IN] Valid handle to container |
objH | [IN] Object handle |
DbStatus pool::DbContainerObj::update | ( | DbContainer & | cntH, |
const void * | object, | ||
ShapeH | shape, | ||
const Token::OID_t & | linkH | ||
) |
Update an object to the container identified by its handle.
cntH | [IN] Handle to container object. |
linkH | [IN] Internal OID to identify object. |
bool pool::DbContainerObj::updatesPending | ( | ) | const |
Query the pending transaction stack.
|
private |
Handle to hosting Database.
Definition at line 59 of file DbContainerObj.h.
|
private |
Pointer to interface of the technology dependent part.
Definition at line 55 of file DbContainerObj.h.
|
private |
Flag indication DbStatus of technology dependent container.
Definition at line 61 of file DbContainerObj.h.
|
privateinherited |
Key entry buffer.
Definition at line 64 of file DbAccessObj.h.
|
privateinherited |
Access mode.
Definition at line 58 of file DbAccessObj.h.
|
privateinherited |
Name of the instance.
Definition at line 60 of file DbAccessObj.h.
|
privateinherited |
Pointer to specific pool implementation.
Definition at line 66 of file DbAccessObj.h.
|
mutableprivateinherited |
Reference counter.
Definition at line 56 of file DbAccessObj.h.
Container token.
Definition at line 57 of file DbContainerObj.h.
|
privateinherited |
Database type.
Definition at line 62 of file DbAccessObj.h.