OWBI1::CIMBase Class Reference

The CIMBase class is used as the base class for all CIM related classes. More...

#include <OWBI1_CIMBase.hpp>

Inheritance diagram for OWBI1::CIMBase:

Inheritance graph
[legend]
Collaboration diagram for OWBI1::CIMBase:

Collaboration graph
[legend]
List of all members.

Public Types

enum  EErrorCodes { E_UNEXPECTED_SIGNATURE, E_UNKNOWN_VERSION }

Public Member Functions

virtual ~CIMBase ()
virtual void setNull ()=0
 Set this object to NULL.
virtual String toString () const =0
virtual String toMOF () const =0

Static Public Member Functions

static void readSig (std::istream &istrm, const char *const sig)
 Read the specified signature from the input stream.
static UInt32 readSig (std::istream &istrm, const char *const sig, const char *const verSig, UInt32 maxVersion)
 Read one of two given signatures from the input stream.
static void writeSig (std::ostream &ostrm, const char *const sig)
 Write the given class signature to an output stream.
static void writeSig (std::ostream &ostrm, const char *const sig, UInt32 version)
 Write the given class signature and version to the output stream.

Detailed Description

The CIMBase class is used as the base class for all CIM related classes.

(i.e. CIMClass, CIMInstance, etc...). It ensures that all derived class will support the specified interface.

Definition at line 52 of file OWBI1_CIMBase.hpp.


Member Enumeration Documentation

enum OWBI1::CIMBase::EErrorCodes
 

Enumerator:
E_UNEXPECTED_SIGNATURE 
E_UNKNOWN_VERSION 

Reimplemented in OWBI1::CIMInstance.

Definition at line 70 of file OWBI1_CIMBase.hpp.


Constructor & Destructor Documentation

OWBI1::CIMBase::~CIMBase  )  [virtual]
 

Definition at line 128 of file OWBI1_CIMBase.cpp.


Member Function Documentation

UInt32 OWBI1::CIMBase::readSig std::istream &  istrm,
const char *const   sig,
const char *const   verSig,
UInt32  maxVersion
[static]
 

Read one of two given signatures from the input stream.

Each class derived from CIMBase must have a uniqe signature associated with it. Older class signatures represent a data format that do not have a format version associated with it. If the older signature is read then the format version is assumed to be zero. If the new signature is read, then the version is read as well. This version will be given to the caller so the object can be read in it's proper form.

Parameters:
istrm The input stream to read the signature from.
sig The old signature. This will be the signature that was used before versioning was implemented on the derived class. Must be a NULL terminated string. If the signature read does not match then verSig will be checked.
verSig The new signature. This will be the signature that is used after implementing versioning on the derived class. Must be a NULL terminated string. If the signature read does not match then a BadCIMSignatureException will be thrown. Otherwise this method will read the version data that follows the signature.
maxVersion The largest version that is supported.
Returns:
Version number for the derived class. If version returned == 0, then the old signature was the match. If version returned > 0, then the derived class has implemented versioning.
Exceptions:
BadCIMSignatureException If the signature doesn't match sig or verSig, or if the version read is > maxVersion.

Definition at line 70 of file OWBI1_CIMBase.cpp.

References ch, E_UNEXPECTED_SIGNATURE, E_UNKNOWN_VERSION, OW_ASSERT, OWBI1_THROW_ERR, OW_NAMESPACE::BinarySerialization::read(), and OW_NAMESPACE::BinarySerialization::readLen().

static void OWBI1::CIMBase::readSig std::istream &  istrm,
const char *const   sig
[static]
 

Read the specified signature from the input stream.

Each class derived from CIMBase must have a unique signature associated with it. If the signature that is being read from the stream doesn't match the one provided, an BadCIMSignatureException will be thrown.

Parameters:
istrm The input stream to read the signature from.
sig The signature to compare the signature read to. This must be a NULL terminated string. If the signature read does not match this string, an BadCIMSignatureException will be thrown.
Exceptions:
BadCIMSignatureException 

virtual void OWBI1::CIMBase::setNull  )  [pure virtual]
 

Set this object to NULL.

This should invalidate the CIMBase object, so that subsequent operation will fail.

Implemented in OWBI1::CIMClass, OWBI1::CIMDataType, OWBI1::CIMFlavor, OWBI1::CIMInstance, OWBI1::CIMMethod, OWBI1::CIMNameSpace, OWBI1::CIMObjectPath, OWBI1::CIMParameter, OWBI1::CIMParamValue, OWBI1::CIMProperty, OWBI1::CIMQualifier, OWBI1::CIMQualifierType, OWBI1::CIMScope, OWBI1::CIMUrl, and OWBI1::CIMValue.

virtual String OWBI1::CIMBase::toMOF  )  const [pure virtual]
 

Returns:
The MOF representation of this object as an String.

Implemented in OWBI1::CIMClass, OWBI1::CIMDataType, OWBI1::CIMFlavor, OWBI1::CIMInstance, OWBI1::CIMMethod, OWBI1::CIMNameSpace, OWBI1::CIMObjectPath, OWBI1::CIMParameter, OWBI1::CIMParamValue, OWBI1::CIMProperty, OWBI1::CIMQualifier, OWBI1::CIMQualifierType, OWBI1::CIMScope, OWBI1::CIMUrl, and OWBI1::CIMValue.

virtual String OWBI1::CIMBase::toString  )  const [pure virtual]
 

Returns:
The String representation of this object.

Implemented in OWBI1::CIMClass, OWBI1::CIMDataType, OWBI1::CIMElement, OWBI1::CIMFlavor, OWBI1::CIMInstance, OWBI1::CIMMethod, OWBI1::CIMNameSpace, OWBI1::CIMObjectPath, OWBI1::CIMParameter, OWBI1::CIMParamValue, OWBI1::CIMProperty, OWBI1::CIMQualifier, OWBI1::CIMQualifierType, OWBI1::CIMScope, OWBI1::CIMUrl, and OWBI1::CIMValue.

Referenced by OWBI1::operator<<().

void OWBI1::CIMBase::writeSig std::ostream &  ostrm,
const char *const   sig,
UInt32  version
[static]
 

Write the given class signature and version to the output stream.

Parameters:
ostrm The output stream to write the signature to.
sig The signature to write to the output stream as a NULL terminated string.
version The version value to write to the output stream.

Definition at line 113 of file OWBI1_CIMBase.cpp.

References OW_ASSERT, OW_NAMESPACE::BinarySerialization::write(), and OW_NAMESPACE::BinarySerialization::writeLen().

static void OWBI1::CIMBase::writeSig std::ostream &  ostrm,
const char *const   sig
[static]
 

Write the given class signature to an output stream.

Parameters:
ostrm The output stream to write the signature to.
sig The signature to write to the output stream as a NULL terminated string.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:18:01 2006 for openwbem by  doxygen 1.4.6