NLLIGO::CZoneBankElement Class Reference

#include <zone_bank.h>


Public Member Functions

void addCategory (const std::string &CatType, const std::string &CatValue)
void convertSize ()
 Convert size in the categories to _SizeX, _SizeY.

 CZoneBankElement ()
const std::string & getCategory (const std::string &CatType)
 Return the CatValue or STRING_NO_CAT_TYPE if no category of that type found.

const std::vector< bool > & getMask ()
const std::string & getName ()
const std::string & getSize ()
uint8 getSizeX ()
uint8 getSizeY ()
void serial (NLMISC::IStream &f)
void setMask (const std::vector< bool > &mask, uint8 sizeX, uint8 sizeY)

Private Attributes

std::map< std::string, std::string > _CategoriesMap
std::vector< bool > _Mask
uint8 _SizeX
uint8 _SizeY

Static Private Attributes

std::string _NoCatTypeFound = "< NOCATTYPE >"

Friends

class CZoneBank


Constructor & Destructor Documentation

NLLIGO::CZoneBankElement::CZoneBankElement  ) 
 

Definition at line 47 of file zone_bank.cpp.

References _SizeX, and _SizeY.

00048 {
00049         _SizeX = _SizeY = 0;
00050 }


Member Function Documentation

void NLLIGO::CZoneBankElement::addCategory const std::string &  CatType,
const std::string &  CatValue
 

Definition at line 53 of file zone_bank.cpp.

References _CategoriesMap.

Referenced by NLLIGO::CZoneBank::debugInit().

00054 {
00055         _CategoriesMap.insert(pair<string,string>(CatType, CatValue));
00056 }

void NLLIGO::CZoneBankElement::convertSize  ) 
 

Convert size in the categories to _SizeX, _SizeY.

Definition at line 81 of file zone_bank.cpp.

References _SizeX, _SizeY, getSize(), and uint32.

Referenced by serial().

00082 {
00083         const string &sizeString =  getSize();
00084         string sTmp;
00085         uint32 i;
00086 
00087         for (i = 0; i < sizeString.size(); ++i)
00088         {
00089                 if (sizeString[i] == 'x')
00090                         break;
00091                 else
00092                         sTmp += sizeString[i];
00093         }
00094         _SizeX = atoi (sTmp.c_str());
00095 
00096         ++i; sTmp = "";
00097         for (; i < sizeString.size(); ++i)
00098         {
00099                 sTmp += sizeString[i];
00100         }
00101         _SizeY = atoi (sTmp.c_str());
00102 }

const string & NLLIGO::CZoneBankElement::getCategory const std::string &  CatType  ) 
 

Return the CatValue or STRING_NO_CAT_TYPE if no category of that type found.

Definition at line 71 of file zone_bank.cpp.

References _CategoriesMap, and _NoCatTypeFound.

Referenced by getName(), and getSize().

00072 {
00073         map<string,string>::iterator it = _CategoriesMap.find (CatType);
00074         if (it == _CategoriesMap.end())
00075                 return _NoCatTypeFound;
00076         else
00077                 return it->second;
00078 }

const std::vector<bool>& NLLIGO::CZoneBankElement::getMask  )  [inline]
 

Definition at line 85 of file zone_bank.h.

References _Mask.

00085 { return _Mask; }

const string & NLLIGO::CZoneBankElement::getName  ) 
 

Definition at line 59 of file zone_bank.cpp.

References getCategory().

Referenced by NLLIGO::CZoneBank::addElement(), and NLLIGO::CZoneBank::debugInit().

00060 {
00061         return getCategory ("zone");
00062 }

const string & NLLIGO::CZoneBankElement::getSize  ) 
 

Definition at line 65 of file zone_bank.cpp.

References getCategory().

Referenced by convertSize().

00066 {
00067         return getCategory ("size");
00068 }

uint8 NLLIGO::CZoneBankElement::getSizeX  )  [inline]
 

Definition at line 83 of file zone_bank.h.

References _SizeX, and uint8.

00083 { return _SizeX; }

uint8 NLLIGO::CZoneBankElement::getSizeY  )  [inline]
 

Definition at line 84 of file zone_bank.h.

References _SizeY, and uint8.

00084 { return _SizeY; }

void NLLIGO::CZoneBankElement::serial NLMISC::IStream f  ) 
 

Definition at line 105 of file zone_bank.cpp.

References _CategoriesMap, _Mask, convertSize(), NLMISC::IStream::serialCheck(), NLMISC::IStream::serialCont(), NLMISC::IStream::serialVersion(), sint, NLMISC::IStream::xmlPop(), and NLMISC::IStream::xmlPush().

Referenced by NLLIGO::CZoneBank::addElement(), and NLLIGO::CZoneBank::debugSaveInit().

00106 {
00107         f.xmlPush ("LIGOZONE");
00108         
00109         sint version = 1;
00110         f.serialVersion (version);
00111         string check = "LIGOZONE";
00112         f.serialCheck (check);
00113 
00114         f.xmlPush ("CATEGORIES");
00115                 f.serialCont (_CategoriesMap);
00116         f.xmlPop ();
00117         
00118         f.xmlPush ("MASK");
00119                 f.serialCont (_Mask);
00120         f.xmlPop ();
00121 
00122         f.xmlPop ();
00123 
00124         convertSize();
00125 }

void NLLIGO::CZoneBankElement::setMask const std::vector< bool > &  mask,
uint8  sizeX,
uint8  sizeY
 

Definition at line 129 of file zone_bank.cpp.

References _Mask, _SizeX, _SizeY, and uint8.

00130 {
00131         _SizeX = sizeX;
00132         _SizeY = sizeY;
00133         _Mask = mask;
00134 }


Friends And Related Function Documentation

friend class CZoneBank [friend]
 

Definition at line 94 of file zone_bank.h.


Field Documentation

std::map<std::string, std::string> NLLIGO::CZoneBankElement::_CategoriesMap [private]
 

Definition at line 63 of file zone_bank.h.

Referenced by NLLIGO::CZoneBank::addAndSwitch(), addCategory(), NLLIGO::CZoneBank::addOrSwitch(), NLLIGO::CZoneBank::debugInit(), NLLIGO::CZoneBank::getCategoriesType(), getCategory(), NLLIGO::CZoneBank::getCategoryValues(), and serial().

std::vector<bool> NLLIGO::CZoneBankElement::_Mask [private]
 

Definition at line 69 of file zone_bank.h.

Referenced by NLLIGO::CZoneBank::debugInit(), getMask(), serial(), and setMask().

string NLLIGO::CZoneBankElement::_NoCatTypeFound = "< NOCATTYPE >" [static, private]
 

Definition at line 44 of file zone_bank.cpp.

Referenced by getCategory().

uint8 NLLIGO::CZoneBankElement::_SizeX [private]
 

Definition at line 68 of file zone_bank.h.

Referenced by convertSize(), CZoneBankElement(), getSizeX(), and setMask().

uint8 NLLIGO::CZoneBankElement::_SizeY [private]
 

Definition at line 68 of file zone_bank.h.

Referenced by convertSize(), CZoneBankElement(), getSizeY(), and setMask().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 12:51:20 2004 for NeL by doxygen 1.3.6