Version.cpp

00001 #include "Version.h"
00002 #include <string>
00003 #include <sstream>
00004 #include <cstring>
00005 #include <cmath>
00006 
00007 using namespace std;
00008 
00009 namespace Sct {
00010 
00011 //Tag from CVS
00012 #define TAG "$Name:  $"
00013 
00014 //Build information
00015 const char* BuildSystem = "Linux pcei 2.4.21-32.0.1.EL.cern #1 Thu May 26 12:45:05 CEST 2005 i686 i686 i386 GNU/Linux";
00016 const char* BuildHost = "pcei.hep.phy.cam.ac.uk";
00017 const char* BuildDate = "20:52:59  1 Nov 2005";
00018 const char* CmtConfig = "i686-slc3-gcc323-dbg ";
00019 const char* TdaqVersion = "tdaq-01-04-01 ";
00020 const char* RootVersion = "4.03/04";
00021 const char* GccVersion = "3.2.3";
00022 const char* RodDaqVersion = "lester-20051014a-for-TDAQ14_BRANCH-development";
00023 
00024 const char* getVersionString() {
00025     static char* str = 0;
00026     if (!str) {
00027         if (strlen(TAG) > 10) {
00028                     str = new char[strlen(TAG)-6];
00029                     strncpy(str,  &TAG[7], strlen(TAG)-9);
00030                     str[strlen(TAG)-9] = '\0';
00031         } else {
00032             str = new char[20];
00033             strcpy(str, "SctRodDaq_0_00_Exp");
00034         }
00035     }
00036     return str;
00037 }
00038 
00039 const char* getVersionModifier() {
00040     return &strrchr(VersionString, '_')[1];
00041 }
00042 
00043 unsigned int getMajorVersion() {
00044     return (unsigned int)floor(Version);
00045 }
00046 
00047 unsigned int getMinorVersion() {
00048     return (unsigned int) floor( (Version - MajorVersion) * 101);
00049 }
00050 
00051 double getVersion() {
00052     char str [strlen(VersionString) - 10];
00053     strcpy(str,  &VersionString[10]);
00054     str[1] = '.';
00055     return atof(str);
00056 }
00057     
00058 const char* VersionString = getVersionString();
00059 const char* VersionModifier = getVersionModifier();
00060 const double Version = getVersion();
00061 const unsigned int MajorVersion = getMajorVersion();
00062 const unsigned int MinorVersion = getMinorVersion();
00063     
00064 }

Generated on Mon Feb 6 14:01:37 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6