ATLAS Offline Software
Functions
SGVersionedKey.cxx File Reference
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <stdexcept>
#include <cassert>
#include "SGTools/SGVersionedKey.h"
Include dependency graph for SGVersionedKey.cxx:

Go to the source code of this file.

Functions

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

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