Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SmbiosFactory Class Reference

AbstractFactory that produces ISmbiosTable objects. More...

#include <ISmbios.h>

Inheritance diagram for SmbiosFactory:

IFactory SmbiosXmlFactory List of all members.

Public Types

enum  { AutoDetectMode, UnitTestMode }
enum  { defaultMode = AutoDetectMode }

Public Member Functions

virtual ~SmbiosFactory () throw ()
virtual ISmbiosTablegetSingleton ()=0
 Recommended way to get an ISmbiosTable object.

virtual ISmbiosTablemakeNew ()=0
 Create a new ISmbiosTable object that the caller must delete. (NOT RECOMMENDED).

virtual void setParameter (const std::string name, const std::string value)=0
virtual void setParameter (const std::string name, const u32 value)=0
virtual void setMode (const int mode)=0
virtual void reset ()=0
virtual std::string getParameterString (const std::string name) const=0
virtual u32 getParameterNum (const std::string name) const=0
virtual int getMode () const=0

Static Public Member Functions

SmbiosFactorygetFactory ()
 Create a factory object that you can use to create ISmbiosTable objects.


Protected Member Functions

 SmbiosFactory ()
 Use getFactory() to get a factory.


Detailed Description

AbstractFactory that produces ISmbiosTable objects.

The SmbiosFactory class is based on the Factory design pattern. The SmbiosFactory is the recommended method to create ISmbiosTable objects.

The getSingleton() is the recommended method to call to create tables. You need not delete the pointer returned by this method, it will be delete by the factory when it is reset() or destructed.

Most users of the factory need call nothing more than getFactory() and then getSingleton() on the returned factory object.

Advanced users can call setParameter() to set up internal factory variables that control creation of tables.

Definition at line 71 of file ISmbios.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumeration values:
AutoDetectMode 
UnitTestMode 

Definition at line 57 of file IFactory.h.

anonymous enum [inherited]
 

Enumeration values:
defaultMode 

Definition at line 58 of file IFactory.h.


Constructor & Destructor Documentation

~SmbiosFactory  )  throw () [virtual]
 

Definition at line 34 of file SmbiosFactory.cpp.

SmbiosFactory  )  [protected]
 

Use getFactory() to get a factory.

Definition at line 36 of file SmbiosFactory.cpp.


Member Function Documentation

SmbiosFactory * getFactory  )  [static]
 

Create a factory object that you can use to create ISmbiosTable objects.

Factory entry point: This is the method to call to get a handle to the SmbiosFactory. The SmbiosFactory is the recommended method to create ISmbiosTable objects.

The getSingleton() is the recommended method to call to create tables. You need not delete the pointer returned by this method, it will be deleted by the factory when it is reset() or destructed.

Returns:
Singleton SmbiosFactory object pointer.

Reimplemented in SmbiosXmlFactory.

Definition at line 39 of file SmbiosFactory.cpp.

Referenced by couldBeBayonet(), smbios::getBits_FromItem(), smbios::getData_UsingXml(), getIdByteFromOEMItem(), getIdByteFromRevItem(), TokenTableFactoryImpl::getSingleton(), smbios::getString_FromItem(), getStringFromTable(), rbu::getSupportedPacketType(), testStandalone::resetFactoryToBuiltinXml(), testPlatform::resetFactoryToBuiltinXml(), testStandalone::setUp(), testRbu::setUp(), testPlatform::setUp(), smi::setupCallingInterfaceSmi(), testStandalone::tearDown(), testRbu::tearDown(), testPlatform::tearDown(), testStandalone::testConstIterator(), testPlatform::testConstructionOffset1(), testPlatform::testConstructionOffset2(), testStandalone::testEachItemAccessors(), testStandalone::testEntryCount(), testStandalone::testGetBoundaries(), testStandalone::testItem_GetBiosInfo(), testStandalone::testItem_GetSystemInfo(), testStandalone::testItemIdentity(), testStandalone::testNonXml(), testPlatform::testOutOfBounds(), testStandalone::testSmbiosXml(), testStandalone::testStreamify(), testStandalone::testSubscriptOperator1(), testStandalone::testSubscriptOperator3(), testStandalone::testTable_Subscript(), testStandalone::testTypeMismatch(), and testPlatform::testVariousAccessors().

virtual int getMode  )  const [pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

virtual u32 getParameterNum const std::string  name  )  const [pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

virtual std::string getParameterString const std::string  name  )  const [pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

virtual ISmbiosTable* getSingleton  )  [pure virtual]
 

Recommended way to get an ISmbiosTable object.

getSingleton() returns a pointer to a Singleton ISmbiosTable object. The user need not delete the pointer returned by this method. The singleton will be deleted when the factory is destructed or the reset() method is called

Returns:
(ISmbiosTable *) -- Factory manages lifetime, do not delete.

Referenced by couldBeBayonet(), smbios::getBits_FromItem(), smbios::getData_UsingXml(), getIdByteFromOEMItem(), getIdByteFromRevItem(), TokenTableFactoryImpl::getSingleton(), smbios::getString_FromItem(), getStringFromTable(), and rbu::getSupportedPacketType().

virtual ISmbiosTable* makeNew  )  [pure virtual]
 

Create a new ISmbiosTable object that the caller must delete. (NOT RECOMMENDED).

The makeNew() method returns a pointer to a newly allocated ISmbiosTable object. The caller is responsible for deleting this reference when it is finished with it. It is recommended that the caller store the pointer in an std::auto_ptr<ISmbiosTable>.

The getSingleton() method is preferred over this method.

Returns:
(ISmbiosTable *) -- caller must delete

Referenced by testPlatform::testConstructionOffset2(), and testStandalone::testNonXml().

virtual void reset  )  [pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

Referenced by testStandalone::testNonXml().

virtual void setMode const int  mode  )  [pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

virtual void setParameter const std::string  name,
const u32  value
[pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

virtual void setParameter const std::string  name,
const std::string  value
[pure virtual, inherited]
 

Implemented in TFactory< factory::IFactory >.

Referenced by testPlatform::testConstructionOffset2(), and testStandalone::testMemoryBadFiles().


The documentation for this class was generated from the following files:
Generated on Wed Apr 11 16:25:12 2007 for SMBIOS Library by doxygen 1.3.5