/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Enumerations | Functions
Site Namespace Reference

Defines an enum for a specific site: DayaBay, LingAo, Mid, or Far. More...

Enumerations

enum  Site_t {
  kUnknown = 0x00, kDayaBay = 0x01, kLingAo = 0x02, kFar = 0x04,
  kMid = 0x08, kAberdeen = 0x10, kSAB = 0x20, kPMTBenchTest = 0x40,
  kAll = kDayaBay | kLingAo | kFar | kMid | kAberdeen | kSAB | kPMTBenchTest
}

Functions

const char * AsString (Site_t site)
const char * StringFromMask (int mask)
Site_t FromString (const char *str)
int MaskFromString (const char *str)
int FullMask ()

Detailed Description

Defines an enum for a specific site: DayaBay, LingAo, Mid, or Far.

Author:
Nathaniel Tagg
Version:
Revision:
1.7
Date:
Date:
2007/05/09 20:47:36

Created 2006.10.12


Enumeration Type Documentation

Enumerator:
kUnknown 
kDayaBay 
kLingAo 
kFar 
kMid 
kAberdeen 
kSAB 
kPMTBenchTest 
kAll 

Definition at line 18 of file Site.h.

                {
        kUnknown      = 0x00, 
        kDayaBay      = 0x01,
        kLingAo       = 0x02,
        kFar          = 0x04,
        kMid          = 0x08,
        kAberdeen     = 0x10,
        kSAB          = 0x20,
        kPMTBenchTest = 0x40,
        kAll          = kDayaBay | kLingAo | kFar | kMid | kAberdeen | kSAB | kPMTBenchTest
    };

Function Documentation

const char * Site::AsString ( Site_t  site)

Definition at line 8 of file Site.cc.

{
  switch(site) {
  case kUnknown:      return "Unknown"; break;
  case kDayaBay:      return "DayaBay"; break;
  case kLingAo:       return "LingAo"; break;
  case kMid:          return "Mid"; break;
  case kFar:          return "Far"; break;
  case kAberdeen:     return "Aberdeen"; break;
  case kSAB:          return "SAB"; break;
  case kPMTBenchTest: return "PMTBenchTest"; break;
  case kAll:          return "All"; break;
  default:            return "?Unknown?"; break;
  }
}
const char * Site::StringFromMask ( int  mask)

Definition at line 24 of file Site.cc.

{
  if(mask==0) return Site::AsString(Site::kUnknown);
  static std::string out;
  out="";
  int nout = 0;

  for (int i=0; i<32; i++) {
     Site::Site_t asite = (Site::Site_t)(1<<i);
     if (mask & asite) {
       if(nout > 0) out += ",";
       out += Site::AsString(asite);
       nout++;
     }
  }
  return out.c_str();
}
Site_t Site::FromString ( const char *  str)

Definition at line 42 of file Site.cc.

{
  if(strncasecmp("Unknown",str,7)==0) return kUnknown;
  if(strncasecmp("DayaBay",str,7)==0) return kDayaBay;
  if(strncasecmp("LingAo",str,6)==0) return kLingAo;
  if(strncasecmp("Mid",str,3)==0) return kMid;
  if(strncasecmp("Far",str,3)==0) return kFar;
  if(strncasecmp("Aberdeen",str,8)==0) return kAberdeen;
  if(strncasecmp("SAB",str,3)==0) return kSAB;
  if(strncasecmp("PMTBenchTest",str,12)==0) return kPMTBenchTest;
  if(strncasecmp("All",str,3)==0) return kAll;
  return kUnknown;
}
int Site::MaskFromString ( const char *  str)

Definition at line 56 of file Site.cc.

{
  assert(0); // Not implimented!
}
int Site::FullMask ( )

Definition at line 61 of file Site.cc.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:20 for Conventions by doxygen 1.7.4