libsmbios_c library
Public Types | Public Member Functions | Protected Member Functions | Friends
smbios::ISmbiosItem Class Referenceabstract

Interface definition for Smbios Item operations. More...

#include <ISmbios.h>

Public Types

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

Public Member Functions

virtual ~ISmbiosItem ()
 
 ISmbiosItem ()
 
virtual std::auto_ptr< const
ISmbiosItem
clone () const =0
 
virtual std::auto_ptr
< ISmbiosItem
clone ()=0
 
virtual u8 getType () const =0
 
virtual u8 getLength () const =0
 
virtual u16 getHandle () const =0
 
virtual void getData (unsigned int offset, u8 *out, size_t size) const =0
 
virtual const u8getBufferCopy (size_t &length) const =0
 
virtual size_t getBufferSize () const =0
 Returns the buffer size of the item. More...
 
virtual const char * getStringByStringNumber (u8) const =0
 

Protected Member Functions

virtual std::ostream & streamify (std::ostream &cout) const =0
 

Friends

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

Detailed Description

Interface definition for Smbios Item operations.

Member Enumeration Documentation

anonymous enum
Enumerator
FIELD_LEN_BYTE 
FIELD_LEN_WORD 
FIELD_LEN_DWORD 
FIELD_LEN_QWORD 

Constructor & Destructor Documentation

virtual smbios::ISmbiosItem::~ISmbiosItem ( )
virtual

Destructor

smbios::ISmbiosItem::ISmbiosItem ( )

Member Function Documentation

virtual std::auto_ptr<const ISmbiosItem> smbios::ISmbiosItem::clone ( ) const
pure virtual
virtual std::auto_ptr<ISmbiosItem> smbios::ISmbiosItem::clone ( )
pure virtual
virtual const u8* smbios::ISmbiosItem::getBufferCopy ( size_t &  length) const
pure virtual
virtual size_t smbios::ISmbiosItem::getBufferSize ( ) const
pure virtual

Returns the buffer size of the item.

virtual void smbios::ISmbiosItem::getData ( unsigned int  offset,
u8 out,
size_t  size 
) const
pure 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
offsetThe offset to the field within the Item.
outvoid pointer to where to store output data
sizesize 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.
virtual u16 smbios::ISmbiosItem::getHandle ( ) const
pure 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.
virtual u8 smbios::ISmbiosItem::getLength ( ) const
pure 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.
virtual const char* smbios::ISmbiosItem::getStringByStringNumber ( u8  ) const
pure 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().

virtual u8 smbios::ISmbiosItem::getType ( ) const
pure 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.
virtual std::ostream& smbios::ISmbiosItem::streamify ( std::ostream &  cout) const
protectedpure virtual

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

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

Friends And Related Function Documentation

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

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