OW_NAMESPACE::CIMDataType Class Reference

The CIMDataType is used to represent the CIM data type of underlying data in other CIM objects, such as CIMValue objects. More...

#include <OW_CIMDataType.hpp>

Inheritance diagram for OW_NAMESPACE::CIMDataType:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::CIMDataType:

Collaboration graph
[legend]
List of all members.

Public Types

typedef COWIntrusiveReference<
DTData > CIMDataType::* 
safe_bool
enum  { SIZE_SINGLE, SIZE_UNLIMITED, SIZE_LIMITED }
enum  Type {
  CIMNULL = 0, UINT8 = 1, SINT8 = 2, UINT16 = 3,
  SINT16 = 4, UINT32 = 5, SINT32 = 6, UINT64 = 7,
  SINT64 = 8, STRING = 9, BOOLEAN = 10, REAL32 = 11,
  REAL64 = 12, DATETIME = 13, CHAR16 = 14, REFERENCE = 15,
  EMBEDDEDCLASS = 16, EMBEDDEDINSTANCE = 17, MAXDATATYPE = 18, INVALID = 99
}

Public Member Functions

 CIMDataType ()
 Create an CIMDataType.
 CIMDataType (CIMNULL_t)
 Create a NULL CIMDataType No operations should be attempted on a NULL CIMDataType.
 CIMDataType (Type type)
 Create a new CIMDataType object represent the given type.
 CIMDataType (Type type, Int32 size)
 Create a new CIMDataType object representing the given type.
 CIMDataType (const CIMName &refClassName)
 Create a new CIMDataType object that represents a REFERENCE data type.
 CIMDataType (const CIMDataType &arg)
 Copy constructor.
 ~CIMDataType ()
 Destroy this CIMDataType object.
virtual void setNull ()
 Set this to a null object.
CIMDataTypeoperator= (const CIMDataType &arg)
 Assignment operator.
bool syncWithValue (const CIMValue &value)
 Set this CIMDataType to represent a given CIMValue.
bool setToArrayType (Int32 size)
 Set this datatype to an array type.
bool isArrayType () const
bool isNumericType () const
bool isReferenceType () const
bool isEmbeddedObjectType () const
Type getType () const
Int32 getSize () const
String getRefClassName () const
 operator safe_bool () const
bool operator! () const
bool equals (const CIMDataType &arg) const
 Check a given CIMDataType with this one for equality.
virtual void readObject (std::istream &istrm)
 Read this CIMDataType from an inputstream.
virtual void writeObject (std::ostream &ostrm) const
 Write this CIMDataType to an output stream.
virtual String toString () const
virtual String toMOF () const
String getArrayMOF () const

Static Public Member Functions

static CIMDataType getDataType (const String &strType)
 Create an CIMDataType object represented by a given string.
static Type strToSimpleType (const String &strType)
 Determine the int data type associated with a name of a data type.
static bool isNumericType (Type type)
 Determine if a given data type is numeric.

Private Attributes

COWIntrusiveReference< DTDatam_pdata

Friends

bool operator< (const CIMDataType &x, const CIMDataType &y)
bool operator== (const CIMDataType &x, const CIMDataType &y)

Classes

struct  DTData

Detailed Description

The CIMDataType is used to represent the CIM data type of underlying data in other CIM objects, such as CIMValue objects.

Definition at line 55 of file OW_CIMDataType.hpp.


Member Typedef Documentation

typedef COWIntrusiveReference<DTData> CIMDataType::* OW_NAMESPACE::CIMDataType::safe_bool
 

Definition at line 180 of file OW_CIMDataType.hpp.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
SIZE_SINGLE 
SIZE_UNLIMITED 
SIZE_LIMITED 

Definition at line 59 of file OW_CIMDataType.hpp.

enum OW_NAMESPACE::CIMDataType::Type
 

Enumerator:
CIMNULL 
UINT8 
SINT8 
UINT16 
SINT16 
UINT32 
SINT32 
UINT64 
SINT64 
STRING 
BOOLEAN 
REAL32 
REAL64 
DATETIME 
CHAR16 
REFERENCE 
EMBEDDEDCLASS 
EMBEDDEDINSTANCE 
MAXDATATYPE 
INVALID 

Definition at line 65 of file OW_CIMDataType.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::CIMDataType::CIMDataType  ) 
 

Create an CIMDataType.

Definition at line 80 of file OW_CIMDataType.cpp.

References CIMNULL, and m_pdata.

Referenced by getDataType().

OW_NAMESPACE::CIMDataType::CIMDataType CIMNULL_t   )  [explicit]
 

Create a NULL CIMDataType No operations should be attempted on a NULL CIMDataType.

Definition at line 87 of file OW_CIMDataType.cpp.

OW_NAMESPACE::CIMDataType::CIMDataType Type  type  ) 
 

Create a new CIMDataType object represent the given type.

This constructor is for non-array and non-reference types.

Parameters:
type An integer specifying the data type of this object.

Definition at line 92 of file OW_CIMDataType.cpp.

References CIMNULL, m_pdata, MAXDATATYPE, OW_ASSERT, and SIZE_SINGLE.

OW_NAMESPACE::CIMDataType::CIMDataType Type  type,
Int32  size
 

Create a new CIMDataType object representing the given type.

Parameters:
type An integer specifying the data type of this object.
size The size of the type if it is an array type. Pass 0 if the size is unlimited.
Exceptions:
CIMException if the type is invalid for this method.

Definition at line 101 of file OW_CIMDataType.cpp.

References CIMNULL, m_pdata, MAXDATATYPE, OW_ASSERT, SIZE_LIMITED, and SIZE_UNLIMITED.

OW_NAMESPACE::CIMDataType::CIMDataType const CIMName refClassName  )  [explicit]
 

Create a new CIMDataType object that represents a REFERENCE data type.

Parameters:
refClassName The name of the reference class.

Definition at line 262 of file OW_CIMDataType.cpp.

References m_pdata, REFERENCE, and SIZE_SINGLE.

OW_NAMESPACE::CIMDataType::CIMDataType const CIMDataType arg  ) 
 

Copy constructor.

Parameters:
arg The CIMDataType to make a copy of

Definition at line 111 of file OW_CIMDataType.cpp.

OW_NAMESPACE::CIMDataType::~CIMDataType  ) 
 

Destroy this CIMDataType object.

Definition at line 114 of file OW_CIMDataType.cpp.


Member Function Documentation

bool OW_NAMESPACE::CIMDataType::equals const CIMDataType arg  )  const
 

Check a given CIMDataType with this one for equality.

Parameters:
arg The CIMDataType to compare with this one.
Returns:
true if the given CIMDataType is equal to this one.

Definition at line 272 of file OW_CIMDataType.cpp.

References m_pdata.

String OW_NAMESPACE::CIMDataType::getArrayMOF  )  const
 

Returns:
The MOF representation of the array element. This can be either: "" "[]" "[<size>]" This is mainly used by CIMProperty::toMOF()

Definition at line 400 of file OW_CIMDataType.cpp.

References getSize(), isArrayType(), m_pdata, OW_NAMESPACE::StringBuffer::releaseString(), and SIZE_UNLIMITED.

CIMDataType OW_NAMESPACE::CIMDataType::getDataType const String strType  )  [static]
 

Create an CIMDataType object represented by a given string.

Parameters:
arg An String that contains a valid name of a CIM data type. (i.e. "uint8", "sint8", "real32", etc...)
Returns:
The CIMDataType represented by the given string.

Definition at line 881 of file OW_CIMDataType.cpp.

References CIMDataType(), and OW_NAMESPACE::String::empty().

Referenced by OW_NAMESPACE::MOF::CIMOMVisitor::VisitQualifierType().

String OW_NAMESPACE::CIMDataType::getRefClassName  )  const
 

Returns:
the class name for reference if this is a REFERENCE type.

Definition at line 191 of file OW_CIMDataType.cpp.

References m_pdata.

Referenced by OW_NAMESPACE::AssocDb2::addOrDeleteEntries(), and OW_NAMESPACE::AssocDbHandle::addOrDeleteEntries().

Int32 OW_NAMESPACE::CIMDataType::getSize  )  const
 

Returns:
the number of elements for this CIMDataType

Definition at line 185 of file OW_CIMDataType.cpp.

References m_pdata.

Referenced by getArrayMOF().

CIMDataType::Type OW_NAMESPACE::CIMDataType::getType  )  const
 

Returns:
the type of this CIMDataType

Definition at line 179 of file OW_CIMDataType.cpp.

References m_pdata.

Referenced by OW_NAMESPACE::AssocDb2::addOrDeleteEntries(), OW_NAMESPACE::AssocDbHandle::addOrDeleteEntries(), OW_NAMESPACE::CIMValueCast::castValueToDataType(), OW_NAMESPACE::CIMtoXML(), and OW_NAMESPACE::convertArray().

bool OW_NAMESPACE::CIMDataType::isArrayType  )  const
 

Returns:
true if this data type represents an array type.

Definition at line 132 of file OW_CIMDataType.cpp.

References m_pdata, and SIZE_SINGLE.

Referenced by OW_NAMESPACE::CIMValueCast::castValueToDataType(), OW_NAMESPACE::convertArray(), getArrayMOF(), OW_NAMESPACE::outputKEYVALUE(), and syncWithValue().

bool OW_NAMESPACE::CIMDataType::isEmbeddedObjectType  )  const
 

Returns:
true if this data type represents an embedded object (EMBEDDEDCLASS or EMBEDDEDINSTANCE) data type.

Definition at line 173 of file OW_CIMDataType.cpp.

References EMBEDDEDCLASS, EMBEDDEDINSTANCE, and m_pdata.

Referenced by OW_NAMESPACE::CIMParamValueToXML().

bool OW_NAMESPACE::CIMDataType::isNumericType Type  type  )  [static]
 

Determine if a given data type is numeric.

Parameters:
type The data type to check
Returns:
true if 'type' is a numeric data type.

Definition at line 145 of file OW_CIMDataType.cpp.

References REAL32, REAL64, SINT16, SINT32, SINT64, SINT8, UINT16, UINT32, UINT64, and UINT8.

bool OW_NAMESPACE::CIMDataType::isNumericType  )  const
 

Returns:
true if this data type represents a numeric data type

Definition at line 138 of file OW_CIMDataType.cpp.

References m_pdata.

bool OW_NAMESPACE::CIMDataType::isReferenceType  )  const
 

Returns:
true if this data type represents a reference data type.

Definition at line 167 of file OW_CIMDataType.cpp.

References m_pdata, and REFERENCE.

OW_NAMESPACE::CIMDataType::operator CIMDataType::safe_bool  )  const
 

Returns:
true if this CIMDataType is a valid CIM data type

Definition at line 196 of file OW_CIMDataType.cpp.

References CIMNULL, INVALID, and m_pdata.

bool OW_NAMESPACE::CIMDataType::operator!  )  const
 

Definition at line 208 of file OW_CIMDataType.cpp.

References CIMNULL, INVALID, and m_pdata.

CIMDataType & OW_NAMESPACE::CIMDataType::operator= const CIMDataType arg  ) 
 

Assignment operator.

Parameters:
arg The CIMDataType to assign to this one.
Returns:
A reference to this CIMDataType object.

Definition at line 125 of file OW_CIMDataType.cpp.

References m_pdata.

virtual void OW_NAMESPACE::CIMDataType::readObject std::istream &  istrm  )  [virtual]
 

Read this CIMDataType from an inputstream.

Parameters:
istrm The input stream to read this object from.

Implements OW_NAMESPACE::SerializableIFC.

void OW_NAMESPACE::CIMDataType::setNull  )  [virtual]
 

Set this to a null object.

Implements OW_NAMESPACE::CIMBase.

Definition at line 119 of file OW_CIMDataType.cpp.

References m_pdata.

bool OW_NAMESPACE::CIMDataType::setToArrayType Int32  size  ) 
 

Set this datatype to an array type.

Parameters:
size If 0 or -1 then the array is marked as unlimited in size. Otherwise the size is set at the given size.
Returns:
true on success. Otherwise false.

Definition at line 219 of file OW_CIMDataType.cpp.

References m_pdata, SIZE_LIMITED, and SIZE_UNLIMITED.

Referenced by OW_NAMESPACE::XMLCIMFactory::createParameter(), and OW_NAMESPACE::CIMValue::CIMValueImpl::getCIMDataType().

CIMDataType::Type OW_NAMESPACE::CIMDataType::strToSimpleType const String strType  )  [static]
 

Determine the int data type associated with a name of a data type.

Parameters:
strType An String that contains a valid name of a CIM data type. (i.e. "uint8", "sint8", "real32", etc...)
Returns:
An integer representation of the data type (i.e. UINT8, SINT8, REAL32, etc...)

Definition at line 418 of file OW_CIMDataType.cpp.

References INVALID.

bool OW_NAMESPACE::CIMDataType::syncWithValue const CIMValue value  ) 
 

Set this CIMDataType to represent a given CIMValue.

Parameters:
value The CIMValue object to sync this CIMDataType with.
Returns:
true if this CIMDataType changed during this method call. Otherwise false indicates this CIMDataType already represented the given value.

Definition at line 228 of file OW_CIMDataType.cpp.

References CIMNULL, OW_NAMESPACE::CIMValue::getType(), OW_NAMESPACE::CIMValue::isArray(), isArrayType(), m_pdata, SIZE_SINGLE, and SIZE_UNLIMITED.

String OW_NAMESPACE::CIMDataType::toMOF  )  const [virtual]
 

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

Implements OW_NAMESPACE::CIMBase.

Definition at line 386 of file OW_CIMDataType.cpp.

References m_pdata, REFERENCE, and toString().

String OW_NAMESPACE::CIMDataType::toString  )  const [virtual]
 

Returns:
The string representation of this CIMDataType object.

Implements OW_NAMESPACE::CIMBase.

Definition at line 311 of file OW_CIMDataType.cpp.

References BOOLEAN, CHAR16, DATETIME, EMBEDDEDCLASS, EMBEDDEDINSTANCE, m_pdata, REAL32, REAL64, REFERENCE, SINT16, SINT32, SINT64, SINT8, STRING, UINT16, UINT32, UINT64, and UINT8.

Referenced by OW_NAMESPACE::CIMValueCast::castValueToDataType(), OW_NAMESPACE::CIMParamValueToXML(), OW_NAMESPACE::CIMtoXML(), OW_NAMESPACE::convertString(), OW_NAMESPACE::CIMXMLCIMOMHandle::invokeMethod(), and toMOF().

virtual void OW_NAMESPACE::CIMDataType::writeObject std::ostream &  ostrm  )  const [virtual]
 

Write this CIMDataType to an output stream.

Parameters:
ostrm The output stream to write this object to.

Implements OW_NAMESPACE::SerializableIFC.


Friends And Related Function Documentation

bool operator< const CIMDataType x,
const CIMDataType y
[friend]
 

Definition at line 896 of file OW_CIMDataType.cpp.

bool operator== const CIMDataType x,
const CIMDataType y
[friend]
 

Definition at line 902 of file OW_CIMDataType.cpp.


Member Data Documentation

COWIntrusiveReference<DTData> OW_NAMESPACE::CIMDataType::m_pdata [private]
 

Definition at line 246 of file OW_CIMDataType.hpp.

Referenced by CIMDataType(), equals(), getArrayMOF(), getRefClassName(), getSize(), getType(), isArrayType(), isEmbeddedObjectType(), isNumericType(), isReferenceType(), operator safe_bool(), operator!(), OW_NAMESPACE::operator<(), operator=(), OW_NAMESPACE::operator==(), setNull(), setToArrayType(), syncWithValue(), toMOF(), and toString().


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