SmbiosItem Class Reference

#include <SmbiosImpl.h>

Inheritance diagram for SmbiosItem:

ISmbiosItem List of all members.

Public Types

 FIELD_LEN_BYTE = 1
 FIELD_LEN_WORD = 2
 FIELD_LEN_DWORD = 4
 FIELD_LEN_QWORD = 8
enum  { FIELD_LEN_BYTE = 1, FIELD_LEN_WORD = 2, FIELD_LEN_DWORD = 4, FIELD_LEN_QWORD = 8 }

Public Member Functions

 SmbiosItem (const SmbiosItem &source)
 SmbiosItem (const smbiosLowlevel::smbios_structure_header *header=0)
virtual ~SmbiosItem ()
virtual std::auto_ptr< const
ISmbiosItem
clone () const
virtual std::auto_ptr< ISmbiosItemclone ()
virtual std::ostream & streamify (std::ostream &cout) const
u8 getType () const
u8 getLength () const
u16 getHandle () const
virtual void getData (unsigned int offset, u8 *out, size_t size) const
virtual const u8getBufferCopy (size_t &length) const
virtual size_t getBufferSize () const
 Returns the buffer size of the item.
virtual const char * getStringByStringNumber (u8) const
virtual void fixup (const SmbiosWorkaroundTable *workaround) const

Protected Attributes

const smbiosLowlevel::smbios_structure_headerheader
size_t header_size

Private Member Functions

SmbiosItemoperator= (const SmbiosItem &source)

Friends

std::ostream & operator<< (std::ostream &cout, const ISmbiosItem &item)

Detailed Description

Definition at line 181 of file SmbiosImpl.h.


Member Enumeration Documentation

anonymous enum [inherited]

Enumerator:
FIELD_LEN_BYTE 
FIELD_LEN_WORD 
FIELD_LEN_DWORD 
FIELD_LEN_QWORD 

Definition at line 310 of file ISmbios.h.


Constructor & Destructor Documentation

SmbiosItem ( const SmbiosItem source  ) 

Definition at line 44 of file SmbiosItem.cpp.

References _, SmbiosItem::header, and SmbiosItem::header_size.

Referenced by SmbiosItem::clone().

SmbiosItem ( const smbiosLowlevel::smbios_structure_header header = 0  )  [explicit]

Definition at line 68 of file SmbiosItem.cpp.

References _, SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length.

~SmbiosItem (  )  [virtual]

Definition at line 111 of file SmbiosItem.cpp.

References SmbiosItem::header.


Member Function Documentation

std::auto_ptr< ISmbiosItem > clone (  )  [virtual]

Implements ISmbiosItem.

Definition at line 191 of file SmbiosItem.cpp.

References SmbiosItem::SmbiosItem().

std::auto_ptr< const ISmbiosItem > clone (  )  const [virtual]

Implements ISmbiosItem.

Definition at line 196 of file SmbiosItem.cpp.

References SmbiosItem::SmbiosItem().

void fixup ( const SmbiosWorkaroundTable workaround  )  const [virtual]

Definition at line 273 of file SmbiosItem.cpp.

References SmbiosWorkaroundTable::fixupItem(), SmbiosItem::header, and SmbiosItem::header_size.

const u8 * getBufferCopy ( size_t &  length  )  const [virtual]

Implements ISmbiosItem.

Definition at line 259 of file SmbiosItem.cpp.

References SmbiosItem::header, and SmbiosItem::header_size.

size_t getBufferSize (  )  const [virtual]

Returns the buffer size of the item.

Implements ISmbiosItem.

Definition at line 268 of file SmbiosItem.cpp.

References SmbiosItem::header_size.

void getData ( unsigned int  offset,
u8 out,
size_t  size 
) const [virtual]

Set of accessor functions: getU8(), getU16(), getU32(), and getU64() Returns a (byte|word|dword|qword) field from the Item.

The offset specified is an int representing the a valid offset within the table. Method will return a u8/u16/u32/u64 (depending on function called).

These methods all check the offset parameter for out of bounds conditions. They will throw exceptions on attempts to access data outside the length of the present item.

Parameters:
offset The offset to the field within the Item.
out void pointer to where to store output data
size size of data to return
Returns:
The (byte|word|dword|qword) at offset. Throws smbios::SmbiosItemDataOutOfBounds or smbios::SmbiosParseException on error.
Warning:
These methods are unchecked access. There is no verification that (for example) when you use getU8() that the location you are trying to access is actually a U8.

Implements ISmbiosItem.

Definition at line 253 of file SmbiosItem.cpp.

References smbios::checkItemBounds(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length.

u16 getHandle (  )  const [virtual]

Returns the Handle field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.

Returns:
The Handle value.

Implements ISmbiosItem.

Definition at line 211 of file SmbiosItem.cpp.

References smbios_structure_header::handle, and SmbiosItem::header.

u8 getLength (  )  const [virtual]

Returns the Length field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.

Returns:
The Length value.

Implements ISmbiosItem.

Definition at line 206 of file SmbiosItem.cpp.

References SmbiosItem::header, and smbios_structure_header::length.

const char * getStringByStringNumber ( u8   )  const [virtual]

Not likely to be useful to regular client code. It is public mainly to help in writing Unit Tests. Clients should normally use getString().

Implements ISmbiosItem.

Definition at line 142 of file SmbiosItem.cpp.

References _, smbios::force_u64_to_u32(), SmbiosItem::header, SmbiosItem::header_size, and smbios_structure_header::length.

u8 getType (  )  const [virtual]

Returns the Type field of the SMBIOS Item. This field is standard for all SMBIOS tables and is defined in the SMBIOS standard.

Returns:
The Type value.

Implements ISmbiosItem.

Definition at line 201 of file SmbiosItem.cpp.

References SmbiosItem::header, and smbios_structure_header::type.

SmbiosItem& operator= ( const SmbiosItem source  )  [private]

virtual std::ostream& streamify ( std::ostream &  cout  )  const [virtual]

Used by 'stdostream &smbios::operator <<( std::ostream &, ISmbiosItem&)' to print out the item info.

Not particularly useful for clients. Use operator<< instead.

Implements ISmbiosItem.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  cout,
const ISmbiosItem item 
) [friend, inherited]


Member Data Documentation

const smbiosLowlevel::smbios_structure_header* header [protected]

Definition at line 206 of file SmbiosImpl.h.

Referenced by SmbiosItem::fixup(), SmbiosItem::getBufferCopy(), SmbiosItem::getData(), SmbiosItem::getHandle(), SmbiosItem::getLength(), SmbiosItem::getStringByStringNumber(), SmbiosItem::getType(), SmbiosItem::SmbiosItem(), and SmbiosItem::~SmbiosItem().

size_t header_size [protected]

Definition at line 207 of file SmbiosImpl.h.

Referenced by SmbiosItem::fixup(), SmbiosItem::getBufferCopy(), SmbiosItem::getBufferSize(), SmbiosItem::getData(), SmbiosItem::getStringByStringNumber(), and SmbiosItem::SmbiosItem().


The documentation for this class was generated from the following files:
Generated on Tue Feb 26 14:53:00 2008 for SMBIOS Library by  doxygen 1.4.7