OW_NAMESPACE::CIMBase Class Reference

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

#include <OW_CIMBase.hpp>

Inheritance diagram for OW_NAMESPACE::CIMBase:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::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 OW_CIMBase.hpp.


Member Enumeration Documentation

enum OW_NAMESPACE::CIMBase::EErrorCodes
 

Enumerator:
E_UNEXPECTED_SIGNATURE 
E_UNKNOWN_VERSION 

Reimplemented in OW_NAMESPACE::CIMInstance.

Definition at line 70 of file OW_CIMBase.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::CIMBase::~CIMBase  )  [virtual]
 

Definition at line 128 of file OW_CIMBase.cpp.


Member Function Documentation

UInt32 OW_NAMESPACE::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 OW_CIMBase.cpp.

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

static void OW_NAMESPACE::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 

Referenced by OW_NAMESPACE::MetaRepository::_getClassNameFromNode().

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

Set this object to NULL.

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

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

Referenced by OW_NAMESPACE::GenericHDBRepository::nodeToCIMObject().

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

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

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

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

Returns:
The String representation of this object.

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

Referenced by OW_NAMESPACE::operator<<().

void OW_NAMESPACE::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 OW_CIMBase.cpp.

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

static void OW_NAMESPACE::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:12:21 2006 for openwbem by  doxygen 1.4.6