Public Member Functions | Public Attributes | Private Attributes

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.

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

Detailed Description

Definition at line 135 of file cfg_rm.h.


Constructor & Destructor Documentation

cfg_RMPool::cfg_RMPool (  ) 
cfg_RMPool::cfg_RMPool ( const pf_File a_parsedFile  ) 

Definition at line 47 of file cfg_rmpool.cpp.

References log_FUNC_m, and Refresh().

                                                  {
    log_FUNC_m(cfg_RMPool);
    Refresh(a_parsedFile);
}

Here is the call graph for this function:

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

Definition at line 142 of file cfg_rm.h.

{};


Member Function Documentation

void cfg_RMPool::Refresh ( const pf_File a_parsedFile  ) 

(map?) Solution: if group already exists refresh element pmtree.refresh()

Definition at line 59 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().

                                                    {
    log_FUNC_m(Refresh);


    static const string c_name          ("Name");
    static const string c_mediaFamily   ("mediaFamily");
    static const string c_poolType      ("poolType");

    static const string c_maxMediaAge   ("maxMediaAge");
    static const string c_maxReadWrite  ("maxReadWrite");

    static const string c_blockSize     ("blockSize");
    static const string c_numOfVolumes  ("NumOfVolumes");
    static const string c_sysVolLocation("sysVolLocation");
    static const string c_sizeOfSysVol  ("SizeOfSysVol");
    static const string c_VolumeSize    ("VolumeSize");

    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;

    //common section
    rules.Add(
        new val_ObjectName( c_name,
                        val_Limit(cfg_MIN_POOL_NAME, cfg_MAX_POOL_NAME),
                        1,
                        1),
        this->name
    );

    rules.Add(
        new val_MediaFamilyType(    c_mediaFamily,
                                    val_Limit(cfg_MIN_MEDIAFAMILY_NAME, cfg_MAX_MEDIAFAMILY_NAME),
                                    1,
                                    1),
        this->mediaFamily
    );

    rules.Add(
        new val_PoolType(    c_poolType,
                            val_Limit(cfg_MIN_POOL_TYPE, cfg_MAX_POOL_TYPE),
                            1,
                            1),
        this->poolType);

    rules.Add(
        new val_Duration(   c_maxMediaAge,
                            val_Limit(cfg_MIN_MEDIA_AGE, cfg_MAX_MEDIA_AGE),
                            0,
                            1,
                            cfg_DEF_MEDIA_AGE),
        this->maxMediaAge
    );
    rules.Add(
        new val_Integer(    c_maxReadWrite,
                            val_Limit(cfg_MIN_READ_WRITE, cfg_MAX_READ_WRITE),
                            0,
                            1,
                            cfg_DEF_READ_WRITE),
        this->maxReadWrite
    );

    rules.Add(
        new val_Size(   c_blockSize,
                        val_Limit(cfg_MIN_BLOCK_SIZE, cfg_MAX_BLOCK_SIZE),
                        0,
                        1,
                        cfg_DEF_BLOCK_SIZE
        ),
        this->blockSize
    );

    rules.Add(
        new val_Integer(    c_numOfVolumes,
                            val_Limit(cfg_MIN_NUM_OF_VOL, cfg_MAX_NUM_OF_VOL),
                            0,
                            1,
                            cfg_DEF_NUM_OF_VOL),
        this->numOfVolumes
    );

    rules.Add(
        new val_SysVolLocationType(    c_sysVolLocation,
                            val_Limit(cfg_MIN_LOC_OF_SYS_VOL, cfg_MAX_LOC_OF_SYS_VOL),
                            0,
                            1,
                            cfg_DEF_LOC_OF_SYS_VOL),
        this->sysVolLocation
    );

    rules.Add(
        new val_Size(       c_sizeOfSysVol,
                            val_Limit(cfg_MIN_SYSTEM_VOL_SIZE, cfg_MAX_SYSTEM_VOL_SIZE),
                            0,
                            1,
                            cfg_DEF_SYSTEM_VOL_SIZE),
        this->sizeOfSysVol
    );

    rules.Add(
        new val_Size(       c_VolumeSize,
                            val_Limit(cfg_MIN_VOL_SIZE, cfg_MAX_VOL_SIZE),
                            0,
                            1,
                            cfg_DEF_VOL_SIZE),
        this->volumeSize
    );


    //Validate and convert common section
    Convert(a_parsedFile.m_common, rules);

    //Validate and convert other sections

    for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
        // if section name is needed here it is: i->first
        Convert(a_parsedFile.m_sections.m_vec[i] , rules);
    };
    CheckMandatory(rules);
}

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 164 of file cfg_rm.h.


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