SpillStruct Namespace Reference

Typedefs

typedef enum
SpillStruct::ESpillStruct 
SpillStruct_t

Enumerations

enum  ESpillStruct {
  kUnknown = 0, k5batch, k6batch, k1p6slip,
  k2p6slip, k3p6slip, k4p6slip, k5p6slip,
  kEndOfSpillStruct
}

Functions

const char * AsString (SpillStruct_t)
SpillStruct::SpillStruct_t StringToEnum (const std::string &s)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
kUnknown 
k5batch 
k6batch 
k1p6slip 
k2p6slip 
k3p6slip 
k4p6slip 
k5p6slip 
kEndOfSpillStruct 

Definition at line 26 of file SpillStructureClassifier.h.

00026                             {
00027     kUnknown = 0,
00028     k5batch,
00029     k6batch,
00030     k1p6slip,
00031     k2p6slip,
00032     k3p6slip,
00033     k4p6slip,
00034     k5p6slip,
00035     kEndOfSpillStruct
00036   } SpillStruct_t;


Function Documentation

const char * SpillStruct::AsString ( SpillStruct::SpillStruct_t  ss  ) 

Definition at line 20 of file SpillStructureClassifier.cxx.

References k1p6slip, k2p6slip, k3p6slip, k4p6slip, k5batch, k5p6slip, k6batch, and kUnknown.

00021 {
00022   switch ( ss ) {
00023   case kUnknown:   return "UnknownSpillStruct";  break;
00024   case k5batch:    return "5-batch";             break;
00025   case k6batch:    return "6-batch";             break;
00026   case k1p6slip:   return "1+6-slip";            break;
00027   case k2p6slip:   return "2+6-slip";            break;
00028   case k3p6slip:   return "3+6-slip";            break;
00029   case k4p6slip:   return "4+6-slip";            break;
00030   case k5p6slip:   return "5+6-slip";            break;
00031   default:         return "UnknownSpillStruct?"; break;
00032   }
00033 
00034 }

SpillStruct::SpillStruct_t SpillStruct::StringToEnum ( const std::string &  s  ) 

convert a set of char to a valid enum

Definition at line 37 of file SpillStructureClassifier.cxx.

References k1p6slip, k2p6slip, k3p6slip, k4p6slip, k5batch, k5p6slip, k6batch, and kUnknown.

00038 {
00040   if (s.find("1+6") != std::string::npos ) return k1p6slip;
00041   if (s.find("2+6") != std::string::npos ) return k2p6slip;
00042   if (s.find("3+6") != std::string::npos ) return k3p6slip;
00043   if (s.find("4+6") != std::string::npos ) return k4p6slip;
00044   if (s.find("5+6") != std::string::npos ) return k5p6slip;
00045   if (s.find("5-")  != std::string::npos ) return k5batch;
00046   // this one must come after n+6 cases
00047   if (s.find("6-")  != std::string::npos ) return k6batch;
00048   return kUnknown;
00049 }


Generated on 15 Jul 2018 for loon by  doxygen 1.6.1