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

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

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. More...
 

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 iterator smbios::ISmbiosTable::begin ( )
pure virtual

Standard iterator interface. Points to first table item.

Returns
iterator or const_iterator Example Iterator Usage:
while( item != table->end() )
{
cout << "Type of Item: " << item->getType();
++item;
}
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.

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 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.

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.

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

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

virtual const ISmbiosItem& smbios::ISmbiosTable::getSmbiosItem ( const u8 current) const
protectedpure virtual
virtual ISmbiosItem& smbios::ISmbiosTable::getSmbiosItem ( const u8 current)
protectedpure 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
protectedpure virtual
virtual iterator smbios::ISmbiosTable::operator[] ( const int  )
pure virtual

Standard indexed access by integer item type.

        The operator[] method returns an \a iterator that can be used to
       iterator over all items in the table of the supplied \a 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::iterator item1 = (*table)[0];
cout << "The BIOS Version is: " << item1->getString(0x05) << endl;
See Also
operator[]( const std::string & ) const
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.

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
mpass in a bool value to turn raw mode on or off.
virtual std::ostream& smbios::ISmbiosTable::streamify ( std::ostream &  cout) const
protectedpure 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: