ATLAS Offline Software
DbToken.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: DbToken.h 726071 2016-02-25 09:23:05Z krasznaa $
6 //====================================================================
7 // Pool DbToken class definitions
8 //--------------------------------------------------------------------
9 //
10 // Package : StorageSvc (The POOL project)
11 // @author M.Frank
12 //====================================================================
13 #ifndef POOL_DBTOKEN_H
14 #define POOL_DBTOKEN_H 1
15 
16 // Framework include files
18 
19 #include <vector>
20 
21 /*
22  * POOL namespace declaration
23  */
24 namespace pool {
25 
26  // Forward declarations
27  class DbTypeInfo;
28 
42  class DbToken : public Token {
43  public:
45  enum {TOKEN_FULL_KEY = 1<<0,
47  TOKEN_ITERATOR = 1<<2
48  };
49  private:
55  std::vector< Guid > m_ukeys;
59  bool m_local;
60  public:
62  static void makeKey(const Token* tok, int which, Guid& guid);
64  DbToken() : m_info(0), m_local(false) {}
66  virtual bool equal(const Token& pTok) const;
68  virtual bool less(const Token& pTok) const;
70  void setKey(int which);
72  void setKeyEx(int which, const Guid& guid);
74  void setUserKey(int i, const Guid& guid);
76  void setTypeInfo(const DbTypeInfo* t) { m_info = t; }
78  const DbTypeInfo* typeInfo() const { return m_info; }
80  void setLocal(bool val) { m_local = val; }
82  bool isLocal() const { return m_local; }
84  void addTypeSetting(int val) { setType(type() | val); }
86  void removeTypeSetting(int val) { setType(type() & ~val); }
88  const Guid& fullKey() const { return m_keyFull; }
90  const Guid& contKey() const { return m_contKey; }
92  const Guid& userkey(int i) const { return m_ukeys[i]; }
93  };
94 } // End namespace pool
95 #endif // POOL_DBTOKEN_H
pool::DbToken::contKey
const Guid & contKey() const
Access to user key #1.
Definition: DbToken.h:90
pool::DbToken::setKeyEx
void setKeyEx(int which, const Guid &guid)
Copy the key.
pool::DbToken::makeKey
static void makeKey(const Token *tok, int which, Guid &guid)
Produce the token keys only on demand for export.
pool::DbToken::m_keyFull
Guid m_keyFull
Buffer to hold user key identifying full token.
Definition: DbToken.h:51
pool::DbToken::addTypeSetting
void addTypeSetting(int val)
Add type setting.
Definition: DbToken.h:84
pool::DbToken::typeInfo
const DbTypeInfo * typeInfo() const
Access type information.
Definition: DbToken.h:78
pool::DbToken::m_contKey
Guid m_contKey
Buffer to hold user key #1.
Definition: DbToken.h:53
pool
pool namespace
Definition: libname.h:15
pool::DbToken
Db objects: DbToken, DbToken.h, POOLCore/DbToken.h.
Definition: DbToken.h:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
pool::DbToken::DbToken
DbToken()
Standard constructor.
Definition: DbToken.h:64
pool::DbToken::TOKEN_FULL_KEY
@ TOKEN_FULL_KEY
Definition: DbToken.h:45
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
Token::setType
Token & setType(int t)
Set token type.
Definition: Token.h:87
pool::DbToken::setTypeInfo
void setTypeInfo(const DbTypeInfo *t)
Update type information.
Definition: DbToken.h:76
lumiFormat.i
int i
Definition: lumiFormat.py:85
pool::DbToken::equal
virtual bool equal(const Token &pTok) const
Fast token comparison: operator equal.
pool::DbToken::setUserKey
void setUserKey(int i, const Guid &guid)
Set a user key.
pool::DbToken::TOKEN_ITERATOR
@ TOKEN_ITERATOR
Definition: DbToken.h:47
pool::DbToken::isLocal
bool isLocal() const
Access local flag.
Definition: DbToken.h:82
pool::DbToken::m_ukeys
std::vector< Guid > m_ukeys
Optional other user keys.
Definition: DbToken.h:55
Token::type
int type() const
Access token type.
Definition: Token.h:85
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
pool_uuid.guid
guid
Definition: pool_uuid.py:112
pool::DbToken::m_info
const DbTypeInfo * m_info
Database type information cache.
Definition: DbToken.h:57
pool::DbToken::less
virtual bool less(const Token &pTok) const
Fast token comparison: operator less.
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
pool::DbToken::fullKey
const Guid & fullKey() const
Access to user key identifying full token.
Definition: DbToken.h:88
pool::DbToken::setLocal
void setLocal(bool val)
Set local flag.
Definition: DbToken.h:80
Token.h
This file contains the class definition for the Token class (migrated from POOL).
pool::DbToken::removeTypeSetting
void removeTypeSetting(int val)
Add type setting.
Definition: DbToken.h:86
pool::DbToken::userkey
const Guid & userkey(int i) const
Access to optional user keys #2.
Definition: DbToken.h:92
pool::DbToken::m_local
bool m_local
Flag to indicate if toekn is local or foreign.
Definition: DbToken.h:59
pool::DbTypeInfo
Definition: DbTypeInfo.h:47
pool::DbToken::TOKEN_CONT_KEY
@ TOKEN_CONT_KEY
Definition: DbToken.h:46
pool::DbToken::setKey
void setKey(int which)
Produce the keys only on demand.