Public Member Functions | Private Attributes | Static Private Attributes

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.

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

Detailed Description

Definition at line 94 of file cfg_drive.h.


Constructor & Destructor Documentation

cfg_DriveSettings::cfg_DriveSettings (  ) 

Definition at line 183 of file cfg_drive.cpp.

                                     {
    // Empty
}

cfg_DriveSettings::cfg_DriveSettings ( const pf_File a_parsedFile  ) 

Definition at line 189 of file cfg_drive.cpp.

References log_FUNC_m, and Refresh().

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

Here is the call graph for this function:

cfg_DriveSettings::~cfg_DriveSettings (  )  [virtual]

Definition at line 196 of file cfg_drive.cpp.

References log_FUNC_m.


Member Function Documentation

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

Reimplemented from cfg_Base.

Definition at line 221 of file cfg_drive.cpp.

References log_FUNC_m, and m_vendors.

                                                                                    {
    log_FUNC_m(ConvertGroup);

    cfg_DriveVendor vendor(a_prodID, a_group);
    m_vendors.push_back(vendor);
}

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

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

                                  {

    log_FUNC_m(FindThreshold);

    vector<cfg_DriveVendor>::const_iterator drvVend_i;
    for (drvVend_i = m_vendors.begin(); drvVend_i != m_vendors.end(); ++drvVend_i) {
        UInt64_t th = drvVend_i->GetThreshold(a_vendor, a_product, a_type);
        if (th != 0) {
            log_DBG_m(dbg_DETAIL,
                "Value for vnd/prod/type: "
                << a_vendor << "/" << a_product << "/"
                << ivd_MediaTypeToText(a_type)
                << " = " << th);
            return th;
        }
    }
    // Threshold not found.
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cfg_DriveSettings::Refresh ( const pf_File a_parsedFile  ) 

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

                                                           {
    log_FUNC_m(Refresh);

    m_vendors.clear();

    ConvertFileHeader(a_parsedFile);
    val_RuleVec  rules;

    if (m_fileType != m_drvFileType_c) {
        log_WRN_m("Invalid file type in header for drive settings: " << m_fileType);
    }

    Convert(a_parsedFile.m_common, rules);

    log_DBG_m(dbg_NORM, "Parsed " << m_vendors.size() << " vendor/product/types.");
}

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

const string cfg_DriveSettings::m_drvFileType_c [static, private]

Definition at line 111 of file cfg_drive.h.

Referenced by Refresh().

Definition at line 113 of file cfg_drive.h.

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


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