smbios::ISmbiosTable Class Reference

Interface definition for Smbios Table operations. More...

#include <ISmbios.h>

Public Types

typedef SmbiosTableIterator iterator
typedef ConstSmbiosTableIterator const_iterator

Public Member Functions

 ISmbiosTable ()
virtual ~ISmbiosTable ()
virtual iterator begin ()=0
 Standard iterator interface. Points to first table item.
virtual const_iterator begin () const =0
 Standard iterator interface. Points to first table item.
virtual iterator end ()=0
 Standard iterator interface. Points to one-past-the-last table item.
virtual const_iterator end () const =0
 Standard iterator interface. Points to one-past-the-last table item.
virtual iterator operator[] (const int)=0
 Standard indexed access by integer item type.
virtual const_iterator operator[] (const int) const =0
 Standard indexed access by integer item type.
virtual void rawMode (bool m=true) const =0
 Disables all workarounds for _new_ items created by the table.
virtual void clearItemCache () const =0
 Clears out any cached SmbiosItem entries in the cache.
virtual int getNumberOfEntries () const =0
 Returns the number of table items, per SMBIOS table header.
virtual
smbiosLowlevel::smbios_table_entry_point 
getTableEPS () const =0
 Returns the table entry point structure.

Protected Member Functions

virtual const ISmbiosItemgetSmbiosItem (const u8 *current) const =0
virtual ISmbiosItemgetSmbiosItem (const u8 *current)=0
virtual const u8nextSmbiosStruct (const u8 *current=0) const =0
virtual std::ostream & streamify (std::ostream &cout) const =0
 Used by operator << (std::ostream & cout, const ISmbiosTable & ) to.

Friends

class SmbiosTableIteratorBase
std::ostream & operator<< (std::ostream &cout, const ISmbiosTable &item)

Detailed Description

Interface definition for Smbios Table operations.


Member Typedef Documentation


Constructor & Destructor Documentation

smbios::ISmbiosTable::ISmbiosTable (  ) 
virtual smbios::ISmbiosTable::~ISmbiosTable (  )  [virtual]

Member Function Documentation

virtual const_iterator smbios::ISmbiosTable::begin (  )  const [pure virtual]

Standard iterator interface. Points to first table item.

Standard iterator interface. Points to first table item.

Returns:
iterator or const_iterator Example Iterator Usage:
    smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
    smbios::ISmbiosTable::iterator item = table->begin();
    while( item != table->end() )
    {
        cout << "Type of Item: " << item->getType();
        ++item;
    }

virtual iterator smbios::ISmbiosTable::begin (  )  [pure virtual]

Standard iterator interface. Points to first table item.

Returns:
iterator or const_iterator Example Iterator Usage:
    smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
    smbios::ISmbiosTable::iterator item = table->begin();
    while( item != table->end() )
    {
        cout << "Type of Item: " << item->getType();
        ++item;
    }
virtual void smbios::ISmbiosTable::clearItemCache (  )  const [pure virtual]

Clears out any cached SmbiosItem entries in the cache.

This API is useful for two instances. First, you can use this to reduce memory usage if you know that you do not need any ISmbiosItem(s) out of the table for a while. The cached ISmbiosItem(s) will be deleted and then re-populated on demand when queries are made for them.

Next, this API is used internally when reReadTable() is called to clear out all old ISmbiosItems.

Warning:
All previous references or pointers to ISmbiosItem objects created from this table become invalid and attempts to access them will cause undefined behaviour (most likely your code will crash.)
Todo:
clearItemCache() needs to be made an abstract function and the definition needs to be moved to the SmbiosItem class. This needs to happen at the same time that itemList is moved.
virtual const_iterator smbios::ISmbiosTable::end (  )  const [pure virtual]

Standard iterator interface. Points to one-past-the-last table item.

Used by const_iterator. Standard iterator interface. Points to first table item.

Returns:
iterator or const_iterator Example Iterator Usage:
    smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
    smbios::ISmbiosTable::iterator item = table->begin();
    while( item != table->end() )
    {
        cout << "Type of Item: " << item->getType();
        ++item;
    }

virtual iterator smbios::ISmbiosTable::end (  )  [pure virtual]

Standard iterator interface. Points to one-past-the-last table item.

Standard iterator interface. Points to first table item.

Returns:
iterator or const_iterator Example Iterator Usage:
    smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
    smbios::ISmbiosTable::iterator item = table->begin();
    while( item != table->end() )
    {
        cout << "Type of Item: " << item->getType();
        ++item;
    }

virtual int smbios::ISmbiosTable::getNumberOfEntries (  )  const [pure virtual]

Returns the number of table items, per SMBIOS table header.

virtual ISmbiosItem& smbios::ISmbiosTable::getSmbiosItem ( const u8 current  )  [protected, pure virtual]
virtual const ISmbiosItem& smbios::ISmbiosTable::getSmbiosItem ( const u8 current  )  const [protected, pure virtual]
virtual smbiosLowlevel::smbios_table_entry_point smbios::ISmbiosTable::getTableEPS (  )  const [pure virtual]

Returns the table entry point structure.

virtual const u8* smbios::ISmbiosTable::nextSmbiosStruct ( const u8 current = 0  )  const [protected, pure virtual]
virtual const_iterator smbios::ISmbiosTable::operator[] ( const   int  )  const [pure virtual]

Standard indexed access by integer item type.

Standard indexed access by integer item type. The operator[] method returns an iterator that can be used to iterator over all items in the table of the supplied type. So, for example, if you want to perform an operation on all SMBIOS type 0x01 (System Information Block) structures, just index the table object using the [] operator.

Returns:
iterator or const_iterator Sample usage:
// Integer indexing example
smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
smbios::ISmbiosTable::iterator item1 = (*table)[0];
cout << "The BIOS Version is: " << item1->getString(0x05) << endl;
See also:
operator[]( const std::string & ) const

virtual iterator smbios::ISmbiosTable::operator[] ( const   int  )  [pure virtual]

Standard indexed access by integer item type.

The operator[] method returns an iterator that can be used to iterator over all items in the table of the supplied type. So, for example, if you want to perform an operation on all SMBIOS type 0x01 (System Information Block) structures, just index the table object using the [] operator.

Returns:
iterator or const_iterator Sample usage:
// Integer indexing example
smbios::ISmbiosTable *table = smbios::SmbiosFactory::getFactory()->getSingleton();
smbios::ISmbiosTable::iterator item1 = (*table)[0];
cout << "The BIOS Version is: " << item1->getString(0x05) << endl;
See also:
operator[]( const std::string & ) const
virtual void smbios::ISmbiosTable::rawMode ( bool  m = true  )  const [pure virtual]

Disables all workarounds for _new_ items created by the table.

Any new item generated by the table will not have workarounds applied to them. However, any previously-existing items that have had workarounds applied still exist. If this is not what you want, recommend calling clearItemCache() prior to calling rawMode().

Parameters:
m pass in a bool value to turn raw mode on or off.
virtual std::ostream& smbios::ISmbiosTable::streamify ( std::ostream &  cout  )  const [protected, pure virtual]

Used by operator << (std::ostream & cout, const ISmbiosTable & ) to.

Users normally would not need or want to call this API. The normal operator<<() has been overloaded to call this function internally.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  cout,
const ISmbiosTable item 
) [friend]
friend class SmbiosTableIteratorBase [friend]

The documentation for this class was generated from the following file:
Generated on Wed Jul 28 08:16:09 2010 for libsmbios_c library by  doxygen 1.6.3