Public Member Functions | Private Attributes

data_Density Class Reference
[SCSI Library]

Results of report density support CDB. More...

#include <data.h>

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

List of all members.

Public Member Functions

 data_Density ()
virtual ~data_Density ()
const data_ReportDensitySupport_tGetDensityStruct () const
UInt16_t GetDensityCount () const
UInt8_t GetPrimaryCode (UInt16_t a_index=0) const
UInt8_t GetSecondaryCode (UInt16_t a_index=0) const
UInt32_t GetBitsPerMM (UInt16_t a_index=0) const
UInt16_t GetMediaWidth (UInt16_t a_index=0) const
UInt16_t GetTracks (UInt16_t a_index=0) const
UInt32_t GetCapacity (UInt16_t a_index=0) const
string GetAssigningOrg (UInt16_t a_index=0) const
string GetDensityName (UInt16_t a_index=0) const
string GetDescription (UInt16_t a_index=0) const

Private Attributes

 log_CLASSID_m
data_ReportDensitySupport_t m_density

Detailed Description

Results of report density support CDB.

Author:
Matej Kenda

Definition at line 111 of file data.h.


Constructor & Destructor Documentation

data_Density::data_Density (  ) 

Definition at line 48 of file data_density.cpp.

References m_density.

                          {
    memset (&m_density, 0, sizeof(m_density));
}

data_Density::~data_Density (  )  [virtual]

Definition at line 52 of file data_density.cpp.

                           {
}


Member Function Documentation

string data_Density::GetAssigningOrg ( UInt16_t  a_index = 0  )  const

Definition at line 118 of file data_density.cpp.

References data_RDSDescriptor_t::assigningOrg, data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, and m_density.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                           {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetAssigningOrg);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    const char* ao =
        reinterpret_cast<const char*>(
            &(m_density.density[a_index].assigningOrg[0]) );

    UInt32_t aolen = strlen(ao);
    UInt32_t maxlen = sizeof(m_density.density[a_index].assigningOrg);
    if (aolen < maxlen) {
        return string(ao);
    }
    else {
        return string(ao, maxlen);
    };
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t data_Density::GetBitsPerMM ( UInt16_t  a_index = 0  )  const

Definition at line 79 of file data_density.cpp.

References data_RDSDescriptor_t::bitsPerMM, data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, and ntoh24().

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                          {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetBitsPerMM);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    return ntoh24(m_density.density[a_index].bitsPerMM);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt32_t data_Density::GetCapacity ( UInt16_t  a_index = 0  )  const
Returns:
Medium capacity in MiB.
Warning:
Converts from 1000s of KB to MiB.

Definition at line 107 of file data_density.cpp.

References data_RDSDescriptor_t::capacity, data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, ntoh(), and size.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                         {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetCapacity);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }

    UInt64_t size = (ntoh(m_density.density[a_index].capacity)*1000)/1024;

    return static_cast<UInt32_t>(size);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt16_t data_Density::GetDensityCount (  )  const

Definition at line 59 of file data_density.cpp.

References data_ReportDensitySupport_t::hdr, data_RDSHdr_t::length, m_density, and ntoh().

Referenced by Dens(), GetAssigningOrg(), GetBitsPerMM(), GetCapacity(), GetCapacityInfo(), GetDensityName(), GetDescription(), GetMediaWidth(), GetPrimaryCode(), GetSecondaryCode(), GetTracks(), and bea_TapeMedium::RefreshTapeInfo().

                                             {
    return static_cast<UInt32_t>(ntoh(m_density.hdr.length) - 2) / sizeof(data_RDSDescriptor_t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

string data_Density::GetDensityName ( UInt16_t  a_index = 0  )  const

Definition at line 137 of file data_density.cpp.

References data_ReportDensitySupport_t::density, data_RDSDescriptor_t::densityName, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, and m_density.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                          {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetDensityName);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    const char* dn =
        reinterpret_cast<const char*>(
            &(m_density.density[a_index].densityName[0]) );

    UInt32_t dnlen = strlen(dn);
    UInt32_t maxlen = sizeof(m_density.density[a_index].densityName);
    if (dnlen < maxlen) {
        return string(dn);
    }
    else {
        return string(dn, maxlen);
    };
}

Here is the call graph for this function:

Here is the caller graph for this function:

const data_ReportDensitySupport_t & data_Density::GetDensityStruct (  )  const

Definition at line 55 of file data_density.cpp.

References m_density.

Referenced by cdb_ReportDensity::GetBufferPointer(), and cdb_ReportDensity::GetBufferSize().

                                                                        {
    return m_density;
}

Here is the caller graph for this function:

string data_Density::GetDescription ( UInt16_t  a_index = 0  )  const

Definition at line 156 of file data_density.cpp.

References data_ReportDensitySupport_t::density, data_RDSDescriptor_t::description, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, and m_density.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                          {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetDescription);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    const char* dd =
        reinterpret_cast<const char*>(
            &(m_density.density[a_index].description[0]) );

    UInt32_t ddlen = strlen(dd);
    UInt32_t maxlen = sizeof(m_density.density[a_index].description);
    if (ddlen < maxlen) {
        return string(dd);
    }
    else {
        return string(dd, maxlen);
    };
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt16_t data_Density::GetMediaWidth ( UInt16_t  a_index = 0  )  const

Definition at line 87 of file data_density.cpp.

References data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, data_RDSDescriptor_t::mediaWidth, and ntoh().

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                           {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetMediaWidth);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    return ntoh(m_density.density[a_index].mediaWidth);
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt8_t data_Density::GetPrimaryCode ( UInt16_t  a_index = 0  )  const

Definition at line 63 of file data_density.cpp.

References data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, and data_RDSDescriptor_t::primaryCode.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                           {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetPrimaryCode);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    return m_density.density[a_index].primaryCode;
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt8_t data_Density::GetSecondaryCode ( UInt16_t  a_index = 0  )  const

Definition at line 71 of file data_density.cpp.

References data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, and data_RDSDescriptor_t::secondaryCode.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                             {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetSecondaryCode);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    return m_density.density[a_index].secondaryCode;
}

Here is the call graph for this function:

Here is the caller graph for this function:

UInt16_t data_Density::GetTracks ( UInt16_t  a_index = 0  )  const

Definition at line 95 of file data_density.cpp.

References data_ReportDensitySupport_t::density, GetDensityCount(), ie_INVALID_ARG, ivd_Error, log_FUNC_m, m_density, ntoh(), and data_RDSDescriptor_t::tracks.

Referenced by Dens(), GetCapacityInfo(), ParseTapeMedium(), and bea_TapeMedium::RefreshTapeInfo().

                                                       {
    if (a_index >= GetDensityCount()) {
        log_FUNC_m(GetTracks);
        throw ivd_Error(ie_INVALID_ARG, "Density index overflow.");
    }
    return ntoh(m_density.density[a_index].tracks);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from scsi_Data.

Definition at line 130 of file data.h.


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