ATLAS Offline Software
Public Types | Public Member Functions | List of all members
IStringPool Class Referenceabstract

Abstract interface for looking up strings/CLIDs in a pool. More...

#include <IStringPool.h>

Inheritance diagram for IStringPool:
Collaboration diagram for IStringPool:

Public Types

typedef SG::sgkey_t sgkey_t
 Type of the keys. More...
 

Public Member Functions

virtual ~IStringPool ()
 Destructor. More...
 
virtual sgkey_t stringToKey (const std::string &str, CLID clid)=0
 Find the key for a string/CLID pair. More...
 
virtual const std::string * keyToString (sgkey_t key) const =0
 Find the string corresponding to a given key. More...
 
virtual const std::string * keyToString (sgkey_t key, CLID &clid) const =0
 Find the string and CLID corresponding to a given key. More...
 
virtual void registerKey (sgkey_t key, const std::string &str, CLID clid)=0
 Remember an additional mapping from key to string/CLID. More...
 

Detailed Description

Abstract interface for looking up strings/CLIDs in a pool.

Definition at line 27 of file IStringPool.h.

Member Typedef Documentation

◆ sgkey_t

Type of the keys.

Definition at line 34 of file IStringPool.h.

Constructor & Destructor Documentation

◆ ~IStringPool()

virtual IStringPool::~IStringPool ( )
inlinevirtual

Destructor.

Definition at line 31 of file IStringPool.h.

31 {}

Member Function Documentation

◆ keyToString() [1/2]

virtual const std::string* IStringPool::keyToString ( sgkey_t  key) const
pure virtual

Find the string corresponding to a given key.

Parameters
keyThe key to look up.
Returns
Pointer to the string found, or null. We can find keys as long as the corresponding string was given to either stringToKey() or registerKey().

Implemented in StoreGateSvc, SGImplSvc, and ActiveStoreSvc.

◆ keyToString() [2/2]

virtual const std::string* IStringPool::keyToString ( sgkey_t  key,
CLID clid 
) const
pure virtual

Find the string and CLID corresponding to a given key.

Parameters
keyThe key to look up.
clid[out]The found CLID.
Returns
Pointer to the string found, or null. We can find keys as long as the corresponding string was given to either stringToKey() or registerKey().

Implemented in StoreGateSvc, SGImplSvc, and ActiveStoreSvc.

◆ registerKey()

virtual void IStringPool::registerKey ( sgkey_t  key,
const std::string &  str,
CLID  clid 
)
pure virtual

Remember an additional mapping from key to string/CLID.

Parameters
keyThe key to enter.
strThe string to enter.
clidThe CLID associated with the string.
Returns
True if successful; false if the key already corresponds to a different string.

This registers an additional mapping from a key to a string; it can be found later through lookup() on the string. Logs an error if key already corresponds to a different string.

Implemented in StoreGateSvc, SGImplSvc, and ActiveStoreSvc.

◆ stringToKey()

virtual sgkey_t IStringPool::stringToKey ( const std::string &  str,
CLID  clid 
)
pure virtual

Find the key for a string/CLID pair.

Parameters
strThe string to look up.
clidThe CLID associated with the string.
Returns
A key identifying the string. A given string will always return the same key. Will abort in case of a hash collision!

Implemented in StoreGateSvc, SGImplSvc, and ActiveStoreSvc.


The documentation for this class was generated from the following file: