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