ATLAS Offline Software
Loading...
Searching...
No Matches
SGVersionedKey.h File Reference

defines a StoreGateSvc key with a version number More...

#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::VersionedKey
 a StoreGateSvc key with a version number. More...

Namespaces

namespace  SG
 Forward declaration.

Functions

bool operator< (const SG::VersionedKey &lhs, const SG::VersionedKey &rhs)
 sort according to highest key version
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}
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)...