cfg_DriveSettings Class Reference
[Parser for config files; validation]

#include <cfg_drive.h>

Inheritance diagram for cfg_DriveSettings:

Inheritance graph
[legend]
Collaboration diagram for cfg_DriveSettings:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 80 of file cfg_drive.h.


Public Member Functions

 cfg_DriveSettings ()
 cfg_DriveSettings (const pf_File &a_parsedFile)
virtual ~cfg_DriveSettings ()
void Refresh (const pf_File &a_parsedFile)
virtual void ConvertGroup (const string &a_prodID, const pf_Group &a_group)
UInt64_t FindThreshold (const string &a_vendor, const string &a_product, ivd_MediaType_e a_type) const

Private Attributes

 log_CLASSID_m
vector< cfg_DriveVendorm_vendors

Static Private Attributes

static const string m_drvFileType_c

Constructor & Destructor Documentation

cfg_DriveSettings::cfg_DriveSettings (  ) 

Definition at line 169 of file cfg_drive.cpp.

00169                                      {
00170     // Empty
00171 }

cfg_DriveSettings::cfg_DriveSettings ( const pf_File a_parsedFile  ) 

Definition at line 175 of file cfg_drive.cpp.

References log_FUNC_m, and Refresh().

00175                                                                 {
00176     log_FUNC_m(cfg_DriveSettings);
00177     Refresh(a_parsedFile);
00178 }

Here is the call graph for this function:

cfg_DriveSettings::~cfg_DriveSettings (  )  [virtual]

Definition at line 182 of file cfg_drive.cpp.

References log_FUNC_m.

00182                                       {
00183     log_FUNC_m(~cfg_DriveSettings);
00184 }


Member Function Documentation

void cfg_DriveSettings::Refresh ( const pf_File a_parsedFile  ) 

Definition at line 188 of file cfg_drive.cpp.

References cfg_Base::Convert(), cfg_Base::ConvertFileHeader(), dbg_NORM, log_DBG_m, log_FUNC_m, log_WRN_m, pf_File::m_common, m_drvFileType_c, cfg_Base::m_fileType, and m_vendors.

Referenced by cfg_DriveSettings(), and i_BackEndAgent_i::i_BackEndAgent_i().

00188                                                            {
00189     log_FUNC_m(Refresh);
00190 
00191     m_vendors.clear();
00192 
00193     ConvertFileHeader(a_parsedFile);
00194     val_RuleVec  rules;
00195 
00196     if (m_fileType != m_drvFileType_c) {
00197         log_WRN_m("Invalid file type in header for drive settings: " << m_fileType);
00198     }
00199 
00200     Convert(a_parsedFile.m_common, rules);
00201 
00202     log_DBG_m(dbg_NORM, "Parsed " << m_vendors.size() << " vendor/product/types.");
00203 }

Here is the call graph for this function:

Here is the caller graph for this function:

void cfg_DriveSettings::ConvertGroup ( const string &  a_prodID,
const pf_Group a_group 
) [virtual]

Reimplemented from cfg_Base.

Definition at line 207 of file cfg_drive.cpp.

References log_FUNC_m, and m_vendors.

00207                                                                                     {
00208     log_FUNC_m(ConvertGroup);
00209 
00210     cfg_DriveVendor vendor(a_prodID, a_group);
00211     m_vendors.push_back(vendor);
00212 }

UInt64_t cfg_DriveSettings::FindThreshold ( const string &  a_vendor,
const string &  a_product,
ivd_MediaType_e  a_type 
) const

Definition at line 216 of file cfg_drive.cpp.

References dbg_DETAIL, ivd_MediaTypeToText(), log_DBG_m, log_FUNC_m, and m_vendors.

Referenced by i_BackEndAgent_i::GetSeekThreshold().

00219                                   {
00220 
00221     log_FUNC_m(FindThreshold);
00222 
00223     vector<cfg_DriveVendor>::const_iterator drvVend_i;
00224     for (drvVend_i = m_vendors.begin(); drvVend_i != m_vendors.end(); ++drvVend_i) {
00225         UInt64_t th = drvVend_i->GetThreshold(a_vendor, a_product, a_type);
00226         if (th != 0) {
00227             log_DBG_m(dbg_DETAIL,
00228                 "Value for vnd/prod/type: "
00229                 << a_vendor << "/" << a_product << "/"
00230                 << ivd_MediaTypeToText(a_type)
00231                 << " = " << th);
00232             return th;
00233         }
00234     }
00235     // Threshold not found.
00236     return 0;
00237 }

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 96 of file cfg_drive.h.

const string cfg_DriveSettings::m_drvFileType_c [static, private]

Definition at line 97 of file cfg_drive.h.

Referenced by Refresh().

Definition at line 99 of file cfg_drive.h.

Referenced by ConvertGroup(), FindThreshold(), and Refresh().


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

Generated on Mon Feb 27 19:03:47 2012 for OPENARCHIVE by  doxygen 1.5.6