cfg_RMDrive Class Reference
[Parser for config files; validation]

#include <cfg_rm.h>

Inheritance diagram for cfg_RMDrive:

Inheritance graph
[legend]
Collaboration diagram for cfg_RMDrive:

Collaboration graph
[legend]

List of all members.


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


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

Constructor & Destructor Documentation

cfg_RMDrive::cfg_RMDrive (  ) 

cfg_RMDrive::cfg_RMDrive ( const pf_File a_parsedFile  ) 

Definition at line 48 of file cfg_rmdrive.cpp.

References log_FUNC_m, and Refresh().

00049        :driveIndex(0),
00050         dataThroughput(0),
00051         loadTime(0),
00052         unLoadTime(0),
00053         aveSeekTime(0),
00054         rewindTime(0),
00055         mediaFamily(mf_UNKNOWN)
00056 {
00057     log_FUNC_m(cfg_RMDrive);
00058     Refresh(a_parsedFile);
00059 }

Here is the call graph for this function:

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

Definition at line 47 of file cfg_rm.h.

00047 {};


Member Function Documentation

void cfg_RMDrive::Refresh ( const pf_File a_parsedFile  ) 

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

00062                                                      {
00063     log_FUNC_m(Refresh);
00064 
00065     static const string c_name          ("Name");
00066     static const string c_library       ("Library");
00067     static const string c_mediaFamily   ("mediaFamily");
00068     static const string c_capabilities  ("Capabilities");
00069     static const string c_options       ("Options");
00070     static const string c_driveIndex    ("DriveIndex");
00071 
00072     static const string c_dataThroughput("dataThroughput");
00073     static const string c_loadTime      ("loadTime");
00074     static const string c_unLoadTime    ("unLoadTime");
00075     static const string c_aveSeekTime   ("aveSeekTime");
00076     static const string c_rewindTime    ("rewindTime");
00077 
00078 
00079 
00080     ConvertFileHeader(a_parsedFile);
00081     val_RuleVec  rules;
00082 
00083 
00084     //common section
00085     rules.Add(
00086         new val_ObjectName(     c_name,
00087                             val_Limit(cfg_MIN_DRIVE_NAME, cfg_MAX_DRIVE_NAME),
00088                             1,
00089                             1),
00090         this->name);
00091 
00092     rules.Add(
00093         new val_StrictString(     c_library,
00094                             val_Limit(1, cfg_MAX_LIBRARY_NAME ),
00095                             0,
00096                             1),
00097         this->library);
00098 
00099     rules.Add(
00100         new val_MediaFamilyType(    c_mediaFamily,
00101                                     val_Limit(cfg_MIN_MEDIAFAMILY_NAME, cfg_MAX_MEDIAFAMILY_NAME),
00102                                     1,
00103                                     1),
00104         this->mediaFamily
00105     );
00106 
00107     rules.Add(
00108         new val_DriveCapabList( c_capabilities,
00109                             val_Limit(cfg_MIN_CAPABILITIES_NAME, cfg_MAX_CAPABILITIES_NAME),
00110                             1,
00111                             1),
00112         this->capabilities);
00113 
00114     rules.Add(
00115         new val_StrictStringList( c_options,
00116                             val_Limit(cfg_MIN_OPTION_NAME, cfg_MAX_OPTION_NAME  ),
00117                             0,
00118                             1),
00119         this->options);
00120 
00121     rules.Add(
00122         new val_Integer(    c_driveIndex,
00123                             val_Limit(cfg_MIN_DRIVEIDX, cfg_MAX_DRIVEIDX        ),
00124                             1,
00125                             1),
00126         this->driveIndex);
00127 
00128 //     //Performance
00129 //     rules.Add(
00130 //         new val_Integer(    c_dataThroughput,
00131 //                             val_Limit(cfg_MIN_DATATHRPUT, cfg_MAX_DATATHRPUT    ),
00132 //                             1,
00133 //                             1),
00134 //         this->dataThroughput);
00135 //
00136 //     rules.Add(
00137 //         new val_Integer(    c_loadTime,
00138 //                             val_Limit(cfg_MIN_LOADTIME, cfg_MAX_LOADTIME        ),
00139 //                             1,
00140 //                             1),
00141 //         this->loadTime);
00142 //
00143 //     rules.Add(
00144 //         new val_Integer(    c_unLoadTime,
00145 //                             val_Limit(cfg_MIN_UNLOADTIME, cfg_MAX_UNLOADTIME    ),
00146 //                             1,
00147 //                             1),
00148 //         this->unLoadTime);
00149 //     rules.Add(
00150 //         new val_Integer(    c_aveSeekTime,
00151 //                             val_Limit(cfg_MIN_AVESEEKTIME, cfg_MAX_AVESEEKTIME  ),
00152 //                             1,
00153 //                             1),
00154 //         this->aveSeekTime);
00155 //     rules.Add(
00156 //         new val_Integer(    c_rewindTime,
00157 //                             val_Limit(cfg_MIN_REWINDTIME, cfg_MAX_REWINDTIME    ),
00158 //                             1,
00159 //                             1),
00160 //         this->rewindTime);
00161 //
00162 
00163     //Validate and convert common section
00164     Convert(a_parsedFile.m_common, rules);
00165 
00166     //Validate and convert other sections
00167 
00168     for (unsigned int i = 0; i < a_parsedFile.m_sections.size(); i++) {
00169         // if section name is needed here it is: i->first
00170         Convert(a_parsedFile.m_sections.m_vec[i] , rules);
00171     };
00172     CheckMandatory(rules);
00173 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from cfg_Base.

Definition at line 183 of file cfg_rmdrive.cpp.

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

00183                                                                                {
00184     log_FUNC_A_m(ConvertGroup, "grpType" << a_group.grpType << "a_grpName " << a_grpName);
00185 
00186     static const string c_host ("Host");
00187 
00188 
00189     if ( strcasecmp(a_group.grpType.c_str(), c_host.c_str()) == 0 ) {
00190         int i = cfg_FindGroupByName(this->hosts, a_grpName);
00191         cfg_RMHost host(a_grpName, a_group);
00192         if (i == -1) {
00193             this->hosts.push_back(host);
00194         } else {
00195             this->hosts[i] = host;
00196         };
00197     }
00198 
00199     else {
00200         log_WRN_m("Unknown group type: " << a_group.grpType);
00201     }
00202 }

Here is the call graph for this function:


Member Data Documentation

Definition at line 59 of file cfg_rm.h.

Referenced by Refresh().

Definition at line 63 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 64 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 65 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 66 of file cfg_rm.h.

Referenced by i_ManagementInterface_i::AddDrive().

Definition at line 67 of file cfg_rm.h.

Reimplemented from cfg_Base.

Definition at line 77 of file cfg_rm.h.


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

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