ATLAS Offline Software
Classes | Namespaces | Functions
SGVersionedKey.h File Reference
#include <iostream>
#include <string>
Include dependency graph for SGVersionedKey.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SG::ObjectWithVersion
 associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retrieval in case the user is interested only in the versionedKey More...
 
class  SG::VersionedKey
 a StoreGateSvc key with a version number. Notice that StoreGate does not order multiple instances of an object with a given key by version number. A generic retrieve will always return the first version recorded. For example, if object ("MyKey",1) is recorded _before__ ("MyKey", 2) a sg.retrieve(pObj,"MyKey") will return ("MyKey",1). StoreGateSvc provides retrieveAllVersions and retrieveHighestVersion, which offer a better-defined behaviour. More...
 

Namespaces

 SG
 Forward declaration.
 

Functions

bool operator< (const SG::VersionedKey &lhs, const SG::VersionedKey &rhs)
 sort according to highest key version More...
 
std::ostream & SG::operator<< (std::ostream &ost, const SG::VersionedKey &k)
 

Detailed Description

defines a StoreGateSvc key with a version number

Definition in file SGVersionedKey.h.

Function Documentation

◆ operator<()

bool operator< ( const SG::VersionedKey lhs,
const SG::VersionedKey rhs 
)

sort according to highest key version

Definition at line 91 of file SGVersionedKey.cxx.

91  {
92  std::string lhskey;
93  unsigned char lhsVersion(0);
94  lhs.decode(lhskey, lhsVersion);
95  unsigned char rhsVersion(0);
96  std::string rhskey;
97  rhs.decode(rhskey, rhsVersion);
98  int keyCompare(strcmp(lhskey.c_str(), rhskey.c_str()));
99  return ( ( keyCompare < 0) ||
100  ( (keyCompare == 0) && (lhsVersion < rhsVersion) ) ) ;
101 
102 }
SG::VersionedKey::decode
void decode(std::string &outKey, unsigned char &version) const
sets outKey to point to base key, and version to encoded version (0 is taken to mean default version)...
Definition: SGVersionedKey.cxx:45