cfg_RMPool Class Reference
[Parser for config files; validation]

#include <cfg_rm.h>

Inheritance diagram for cfg_RMPool:

Inheritance graph
[legend]
Collaboration diagram for cfg_RMPool:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 121 of file cfg_rm.h.


Public Member Functions

 cfg_RMPool ()
 cfg_RMPool (const pf_File &a_parsedFile)
void Refresh (const pf_File &a_parsedFile)
virtual ~cfg_RMPool ()

Public Attributes

string name
ivd_MediaFamily_e mediaFamily
ivd_PoolType_e poolType
UInt32_t maxMediaAge
UInt32_t maxReadWrite
UInt32_t blockSize
UInt16_t numOfVolumes
ivd_SysVolLocation_e sysVolLocation
UInt32_t sizeOfSysVol
UInt64_t volumeSize

Private Attributes

 log_CLASSID_m

Constructor & Destructor Documentation

cfg_RMPool::cfg_RMPool (  ) 

cfg_RMPool::cfg_RMPool ( const pf_File a_parsedFile  ) 

Definition at line 33 of file cfg_rmpool.cpp.

References log_FUNC_m, and Refresh().

00033                                                   {
00034     log_FUNC_m(cfg_RMPool);
00035     Refresh(a_parsedFile);
00036 }

Here is the call graph for this function:

virtual cfg_RMPool::~cfg_RMPool (  )  [inline, virtual]

Definition at line 128 of file cfg_rm.h.

00128 {};


Member Function Documentation

void cfg_RMPool::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 45 of file cfg_rmpool.cpp.

References val_RuleVec::Add(), blockSize, cfg_DEF_BLOCK_SIZE, cfg_DEF_LOC_OF_SYS_VOL, cfg_DEF_MEDIA_AGE, cfg_DEF_NUM_OF_VOL, cfg_DEF_READ_WRITE, cfg_DEF_SYSTEM_VOL_SIZE, cfg_DEF_VOL_SIZE, cfg_MAX_BLOCK_SIZE, cfg_MAX_LOC_OF_SYS_VOL, cfg_MAX_MEDIA_AGE, cfg_MAX_MEDIAFAMILY_NAME, cfg_MAX_NUM_OF_VOL, cfg_MAX_POOL_NAME, cfg_MAX_POOL_TYPE, cfg_MAX_READ_WRITE, cfg_MAX_SYSTEM_VOL_SIZE, cfg_MAX_VOL_SIZE, cfg_MIN_BLOCK_SIZE, cfg_MIN_LOC_OF_SYS_VOL, cfg_MIN_MEDIA_AGE, cfg_MIN_MEDIAFAMILY_NAME, cfg_MIN_NUM_OF_VOL, cfg_MIN_POOL_NAME, cfg_MIN_POOL_TYPE, cfg_MIN_READ_WRITE, cfg_MIN_SYSTEM_VOL_SIZE, cfg_MIN_VOL_SIZE, cfg_Base::CheckMandatory(), cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), log_FUNC_m, pf_File::m_common, pf_File::m_sections, pf_SectionList::m_vec, maxMediaAge, maxReadWrite, mediaFamily, name, numOfVolumes, poolType, pf_SectionList::size(), sizeOfSysVol, sysVolLocation, and volumeSize.

Referenced by cfg_RMPool().

00045                                                     {
00046     log_FUNC_m(Refresh);
00047 
00048 
00049     static const string c_name          ("Name");
00050     static const string c_mediaFamily   ("mediaFamily");
00051     static const string c_poolType      ("poolType");
00052 
00053     static const string c_maxMediaAge   ("maxMediaAge");
00054     static const string c_maxReadWrite  ("maxReadWrite");
00055 
00056     static const string c_blockSize     ("blockSize");
00057     static const string c_numOfVolumes  ("NumOfVolumes");
00058     static const string c_sysVolLocation("sysVolLocation");
00059     static const string c_sizeOfSysVol  ("SizeOfSysVol");
00060     static const string c_VolumeSize    ("VolumeSize");
00061 
00062     ConvertFileHeader(a_parsedFile);
00063     val_RuleVec  rules;
00064 
00065     //common section
00066     rules.Add(
00067         new val_ObjectName( c_name,
00068                         val_Limit(cfg_MIN_POOL_NAME, cfg_MAX_POOL_NAME),
00069                         1,
00070                         1),
00071         this->name
00072     );
00073 
00074     rules.Add(
00075         new val_MediaFamilyType(    c_mediaFamily,
00076                                     val_Limit(cfg_MIN_MEDIAFAMILY_NAME, cfg_MAX_MEDIAFAMILY_NAME),
00077                                     1,
00078                                     1),
00079         this->mediaFamily
00080     );
00081 
00082     rules.Add(
00083         new val_PoolType(    c_poolType,
00084                             val_Limit(cfg_MIN_POOL_TYPE, cfg_MAX_POOL_TYPE),
00085                             1,
00086                             1),
00087         this->poolType);
00088 
00089     rules.Add(
00090         new val_Duration(   c_maxMediaAge,
00091                             val_Limit(cfg_MIN_MEDIA_AGE, cfg_MAX_MEDIA_AGE),
00092                             0,
00093                             1,
00094                             cfg_DEF_MEDIA_AGE),
00095         this->maxMediaAge
00096     );
00097     rules.Add(
00098         new val_Integer(    c_maxReadWrite,
00099                             val_Limit(cfg_MIN_READ_WRITE, cfg_MAX_READ_WRITE),
00100                             0,
00101                             1,
00102                             cfg_DEF_READ_WRITE),
00103         this->maxReadWrite
00104     );
00105 
00106     rules.Add(
00107         new val_Size(   c_blockSize,
00108                         val_Limit(cfg_MIN_BLOCK_SIZE, cfg_MAX_BLOCK_SIZE),
00109                         0,
00110                         1,
00111                         cfg_DEF_BLOCK_SIZE
00112         ),
00113         this->blockSize
00114     );
00115 
00116     rules.Add(
00117         new val_Integer(    c_numOfVolumes,
00118                             val_Limit(cfg_MIN_NUM_OF_VOL, cfg_MAX_NUM_OF_VOL),
00119                             0,
00120                             1,
00121                             cfg_DEF_NUM_OF_VOL),
00122         this->numOfVolumes
00123     );
00124 
00125     rules.Add(
00126         new val_SysVolLocationType(    c_sysVolLocation,
00127                             val_Limit(cfg_MIN_LOC_OF_SYS_VOL, cfg_MAX_LOC_OF_SYS_VOL),
00128                             0,
00129                             1,
00130                             cfg_DEF_LOC_OF_SYS_VOL),
00131         this->sysVolLocation
00132     );
00133 
00134     rules.Add(
00135         new val_Size(       c_sizeOfSysVol,
00136                             val_Limit(cfg_MIN_SYSTEM_VOL_SIZE, cfg_MAX_SYSTEM_VOL_SIZE),
00137                             0,
00138                             1,
00139                             cfg_DEF_SYSTEM_VOL_SIZE),
00140         this->sizeOfSysVol
00141     );
00142 
00143     rules.Add(
00144         new val_Size(       c_VolumeSize,
00145                             val_Limit(cfg_MIN_VOL_SIZE, cfg_MAX_VOL_SIZE),
00146                             0,
00147                             1,
00148                             cfg_DEF_VOL_SIZE),
00149         this->volumeSize
00150     );
00151 
00152 
00153     //Validate and convert common section
00154     Convert(a_parsedFile.m_common, rules);
00155 
00156     //Validate and convert other sections
00157 
00158     for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
00159         // if section name is needed here it is: i->first
00160         Convert(a_parsedFile.m_sections.m_vec[i] , rules);
00161     };
00162     CheckMandatory(rules);
00163 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from cfg_Base.

Definition at line 150 of file cfg_rm.h.


The documentation for this class was generated from the following files:

Generated on Mon Feb 27 19:04:11 2012 for OPENARCHIVE by  doxygen 1.5.6