Public Member Functions | Public Attributes | Private Attributes

cfg_RMLibrary Class Reference
[Parser for config files; validation]

cfg_RMLibrary 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_RMLibrary:
Inheritance graph
[legend]
Collaboration diagram for cfg_RMLibrary:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Public Attributes

string name
ivd_LibraryType_e libType
string host
string controlDevice
vector< val_Element< string > > capabilities
vector< val_Element< string > > options
ivd_MediaFamily_e mediaFamily
vector< val_Element< string > > slotList
vector< val_Element< string > > mailSlots
UInt32_t auditTime
UInt32_t mediaAccessTime
UInt32_t mediaExchangeTime

Private Attributes

 log_CLASSID_m

Detailed Description

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


Constructor & Destructor Documentation

cfg_RMLibrary::cfg_RMLibrary (  )  [inline]

Definition at line 101 of file cfg_rm.h.

{};

cfg_RMLibrary::cfg_RMLibrary ( const pf_File a_parsedFile  ) 

Definition at line 60 of file cfg_rmlib.cpp.

References log_FUNC_m, and Refresh().

Here is the call graph for this function:

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

Definition at line 106 of file cfg_rm.h.

{};


Member Function Documentation

void cfg_RMLibrary::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 72 of file cfg_rmlib.cpp.

References val_RuleVec::Add(), capabilities, cfg_MAX_CAPABILITIES_NAME, cfg_MAX_CTRLDEVICE, cfg_MAX_HOSTNAME, cfg_MAX_LIBRARY_NAME, cfg_MAX_LIBRARY_TYPE, cfg_MAX_MAILSLOTS_NAME, cfg_MAX_MEDIAFAMILY_NAME, cfg_MAX_OPTION_NAME, cfg_MAX_SLOTS_NAME, cfg_MIN_CAPABILITIES_NAME, cfg_MIN_CTRLDEVICE, cfg_MIN_HOSTNAME, cfg_MIN_LIBRARY_NAME, cfg_MIN_LIBRARY_TYPE, cfg_MIN_MAILSLOTS_NAME, cfg_MIN_MEDIAFAMILY_NAME, cfg_MIN_OPTION_NAME, cfg_MIN_SLOTS_NAME, cfg_Base::CheckMandatory(), controlDevice, cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), host, libType, log_FUNC_m, pf_File::m_common, pf_File::m_sections, pf_SectionList::m_vec, mailSlots, mediaFamily, name, options, pf_SectionList::size(), and slotList.

Referenced by cfg_RMLibrary().

                                                       {
    log_FUNC_m(Refresh);

    static const string c_name              ("Name");
    static const string c_libType           ("Libtype");
    static const string c_host              ("Host");
    static const string c_controlDevice     ("ControlDevice");
    static const string c_capabilities      ("Capabilities");
    static const string c_options           ("Options");
    static const string c_mediaFamily       ("MediaFamily");

    static const string c_slots             ("Slots");
    static const string c_mailSlots         ("MailSlots");

    static const string c_auditTime         ("AuditTime");
    static const string c_mediaAccessTime   ("MediaAccessTime");
    static const string c_mediaExchangeTime ("MediaExchangeTime");



    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;

    //common section
    rules.Add(
        new val_ObjectName(     c_name,
                            val_Limit(cfg_MIN_LIBRARY_NAME, cfg_MAX_LIBRARY_NAME),
                            1,
                            1),
        this->name);
    rules.Add(
        new val_LibType(    c_libType,
                            val_Limit(cfg_MIN_LIBRARY_TYPE, cfg_MAX_LIBRARY_TYPE),
                            1,
                            1),
        this->libType);

    rules.Add(
        new val_Hostname(   c_host,
                            val_Limit(cfg_MIN_HOSTNAME, cfg_MAX_HOSTNAME),
                            1,
                            1),
        this->host);

    rules.Add(
        new val_StrictString(     c_controlDevice,
                            val_Limit(cfg_MIN_CTRLDEVICE, cfg_MAX_CTRLDEVICE),
                            1,
                            1),
        this->controlDevice);

    rules.Add(
        new val_StrictStringList( c_capabilities,
                            val_Limit(cfg_MIN_CAPABILITIES_NAME, cfg_MAX_CAPABILITIES_NAME),
                            0,
                            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_MediaFamilyType(
                            c_mediaFamily,
                            val_Limit(cfg_MIN_MEDIAFAMILY_NAME, cfg_MAX_MEDIAFAMILY_NAME),
                            1,
                            1),
        this->mediaFamily);

    rules.Add(
        new val_SlotList(   c_slots,
                            val_Limit(cfg_MIN_SLOTS_NAME, cfg_MAX_SLOTS_NAME),
                            1,
                            1),
        this->slotList);

    rules.Add(
        new val_SlotList(   c_mailSlots,
                            val_Limit(cfg_MIN_MAILSLOTS_NAME, cfg_MAX_MAILSLOTS_NAME),
                            0,
                            1),
        this->mailSlots);

    //Connectivity
//     rules.Add(
//         new val_Integer(    c_auditTime,
//                             val_Limit(cfg_MIN_AUDITTIME, cfg_MAX_AUDITTIME)),
//         this->auditTime);
//     rules.Add(
//         new val_Integer(    c_mediaAccessTime,
//                             val_Limit(cfg_MIN_MEDACCESSTIME, cfg_MAX_MEDACCESSTIME)),
//         this->mediaAccessTime);
//     rules.Add(
//         new val_Integer(    c_mediaExchangeTime,
//                             val_Limit(cfg_MIN_MEDEXCHTIME, cfg_MAX_MEDEXCHTIME)),
//         this->mediaExchangeTime);

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

/* TODO
    Use wrapper for slots to expand slots after they are validated
*/
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 115 of file cfg_rm.h.

Referenced by Refresh().

Reimplemented from cfg_Base.

Definition at line 131 of file cfg_rm.h.

Definition at line 116 of file cfg_rm.h.

Referenced by Refresh().


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