Public Member Functions | Public Attributes | Private Attributes

cfg_RMDrive Class Reference
[Parser for config files; validation]

cfg_RMDrive is derived from val_Base to handle configuration of the IVD Resource Manager Configuration for Drive. More...

#include <cfg_rm.h>

Inheritance diagram for cfg_RMDrive:
Inheritance graph
[legend]
Collaboration diagram for cfg_RMDrive:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 cfg_RMDrive ()
 cfg_RMDrive (const pf_File &a_parsedFile)
virtual ~cfg_RMDrive ()
void Refresh (const pf_File &a_parsedFile)
virtual void ConvertGroup (const string &a_grpName, const pf_Group &a_group)

Public Attributes

string name
string library
vector< val_Element
< ivd_DriveCapab_e > > 
capabilities
vector< val_Element< string > > options
UInt32_t driveIndex
UInt32_t dataThroughput
UInt32_t loadTime
UInt32_t unLoadTime
UInt32_t aveSeekTime
UInt32_t rewindTime
vector< cfg_RMHosthosts
ivd_MediaFamily_e mediaFamily

Private Attributes

 log_CLASSID_m

Detailed Description

cfg_RMDrive is derived from val_Base to handle configuration of the IVD Resource Manager Configuration for Drive.

See also:
parser
val_Base
val_Value
pf_File

Definition at line 57 of file cfg_rm.h.


Constructor & Destructor Documentation

cfg_RMDrive::cfg_RMDrive (  ) 
cfg_RMDrive::cfg_RMDrive ( const pf_File a_parsedFile  ) 

Definition at line 62 of file cfg_rmdrive.cpp.

References log_FUNC_m, and Refresh().

Here is the call graph for this function:

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

Definition at line 61 of file cfg_rm.h.

{};


Member Function Documentation

void cfg_RMDrive::ConvertGroup ( const string &  a_grpName,
const pf_Group a_group 
) [virtual]

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

Reimplemented from cfg_Base.

Definition at line 197 of file cfg_rmdrive.cpp.

References cfg_FindGroupByName(), pf_Group::grpType, hosts, log_FUNC_A_m, log_WRN_m, and strcasecmp.

                                                                               {
    log_FUNC_A_m(ConvertGroup, "grpType" << a_group.grpType << "a_grpName " << a_grpName);

    static const string c_host ("Host");


    if ( strcasecmp(a_group.grpType.c_str(), c_host.c_str()) == 0 ) {
        int i = cfg_FindGroupByName(this->hosts, a_grpName);
        cfg_RMHost host(a_grpName, a_group);
        if (i == -1) {
            this->hosts.push_back(host);
        } else {
            this->hosts[i] = host;
        };
    }

    else {
        log_WRN_m("Unknown group type: " << a_group.grpType);
    }
}

Here is the call graph for this function:

void cfg_RMDrive::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 76 of file cfg_rmdrive.cpp.

References val_RuleVec::Add(), capabilities, cfg_MAX_CAPABILITIES_NAME, cfg_MAX_DRIVE_NAME, cfg_MAX_DRIVEIDX, cfg_MAX_LIBRARY_NAME, cfg_MAX_MEDIAFAMILY_NAME, cfg_MAX_OPTION_NAME, cfg_MIN_CAPABILITIES_NAME, cfg_MIN_DRIVE_NAME, cfg_MIN_DRIVEIDX, cfg_MIN_MEDIAFAMILY_NAME, cfg_MIN_OPTION_NAME, cfg_Base::CheckMandatory(), cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), driveIndex, library, log_FUNC_m, pf_File::m_common, pf_File::m_sections, pf_SectionList::m_vec, mediaFamily, name, options, and pf_SectionList::size().

Referenced by cfg_RMDrive().

                                                     {
    log_FUNC_m(Refresh);

    static const string c_name          ("Name");
    static const string c_library       ("Library");
    static const string c_mediaFamily   ("mediaFamily");
    static const string c_capabilities  ("Capabilities");
    static const string c_options       ("Options");
    static const string c_driveIndex    ("DriveIndex");

    static const string c_dataThroughput("dataThroughput");
    static const string c_loadTime      ("loadTime");
    static const string c_unLoadTime    ("unLoadTime");
    static const string c_aveSeekTime   ("aveSeekTime");
    static const string c_rewindTime    ("rewindTime");



    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;


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

    rules.Add(
        new val_StrictString(     c_library,
                            val_Limit(1, cfg_MAX_LIBRARY_NAME ),
                            0,
                            1),
        this->library);

    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_DriveCapabList( c_capabilities,
                            val_Limit(cfg_MIN_CAPABILITIES_NAME, cfg_MAX_CAPABILITIES_NAME),
                            1,
                            1),
        this->capabilities);

    rules.Add(
        new val_StrictStringList( c_options,
                            val_Limit(cfg_MIN_OPTION_NAME, cfg_MAX_OPTION_NAME  ),
                            0,
                            1),
        this->options);

    rules.Add(
        new val_Integer(    c_driveIndex,
                            val_Limit(cfg_MIN_DRIVEIDX, cfg_MAX_DRIVEIDX        ),
                            1,
                            1),
        this->driveIndex);

//     //Performance
//     rules.Add(
//         new val_Integer(    c_dataThroughput,
//                             val_Limit(cfg_MIN_DATATHRPUT, cfg_MAX_DATATHRPUT    ),
//                             1,
//                             1),
//         this->dataThroughput);
//
//     rules.Add(
//         new val_Integer(    c_loadTime,
//                             val_Limit(cfg_MIN_LOADTIME, cfg_MAX_LOADTIME        ),
//                             1,
//                             1),
//         this->loadTime);
//
//     rules.Add(
//         new val_Integer(    c_unLoadTime,
//                             val_Limit(cfg_MIN_UNLOADTIME, cfg_MAX_UNLOADTIME    ),
//                             1,
//                             1),
//         this->unLoadTime);
//     rules.Add(
//         new val_Integer(    c_aveSeekTime,
//                             val_Limit(cfg_MIN_AVESEEKTIME, cfg_MAX_AVESEEKTIME  ),
//                             1,
//                             1),
//         this->aveSeekTime);
//     rules.Add(
//         new val_Integer(    c_rewindTime,
//                             val_Limit(cfg_MIN_REWINDTIME, cfg_MAX_REWINDTIME    ),
//                             1,
//                             1),
//         this->rewindTime);
//

    //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

Definition at line 80 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 77 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 78 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Reimplemented from cfg_Base.

Definition at line 91 of file cfg_rm.h.

Definition at line 73 of file cfg_rm.h.

Referenced by Refresh().

Definition at line 81 of file cfg_rm.h.

Definition at line 79 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().


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