CMake: Retrieve Git information
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliVersion.cxx
CommitLineData
f19da7e9 1#include "AliVersion.h"
2#include "ARVersion.h"
3#include <TClass.h>
4
5AliVersion* AliVersion::fgInstance = 0;
6
7AliVersion* AliVersion::Instance()
8{
9 if (!fgInstance) fgInstance = new AliVersion;
10 return (AliVersion*)fgInstance;
11}
12
13AliVersion::AliVersion()
14 : TNamed("alirootVersion", "AliROOT Version"),
15 fHash(ALIROOT_REVISION),
5420ed56 16 fTag(ALIROOT_VERSION)
f19da7e9 17{ SetUniqueID(ALIROOT_SERIAL); }
18
19Int_t AliVersion::Compare(const TObject* o) const
20{
21 if (!o->IsA()->InheritsFrom(AliVersion::Class()))
22 Fatal("Compare", "Cannot compare an AliVersion object to a %s object",
23 o->IsA()->GetName());
24 const AliVersion* av = static_cast<const AliVersion*>(o);
25 return (av->GetSerial() == GetSerial() ? 0 :
26 av->GetSerial() > GetSerial() ? -1 : 1);
27}
28
29void AliVersion::Print(Option_t *) const
30{
31 // print aliroot version
32 printf("AliRoot serial:\t%d\nAliRoot hash:\t%s\nAliRoot tag:\t%s\n",GetSerial(),fTag.Data(),fHash.Data());
33}