OWBI1::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 <OWBI1_CIMDataType.hpp>

Inheritance diagram for OWBI1::CIMDataType:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef detail::CIMDataTypeRepRef
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 (const detail::CIMDataTypeRepRef &rep)
 ~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
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
detail::CIMDataTypeRepRef getRep () 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

detail::CIMDataTypeRepRef m_rep

Friends

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

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


Member Typedef Documentation

typedef detail::CIMDataTypeRepRef CIMDataType::* OWBI1::CIMDataType::safe_bool
 

Definition at line 176 of file OWBI1_CIMDataType.hpp.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
SIZE_SINGLE 
SIZE_UNLIMITED 
SIZE_LIMITED 

Definition at line 58 of file OWBI1_CIMDataType.hpp.

enum OWBI1::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 64 of file OWBI1_CIMDataType.hpp.


Constructor & Destructor Documentation

OWBI1::CIMDataType::CIMDataType  ) 
 

Create an CIMDataType.

Definition at line 51 of file OWBI1_CIMDataType.cpp.

Referenced by getDataType().

OWBI1::CIMDataType::CIMDataType CIMNULL_t   )  [explicit]
 

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

Definition at line 56 of file OWBI1_CIMDataType.cpp.

OWBI1::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 61 of file OWBI1_CIMDataType.cpp.

OWBI1::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 66 of file OWBI1_CIMDataType.cpp.

OWBI1::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 164 of file OWBI1_CIMDataType.cpp.

OWBI1::CIMDataType::CIMDataType const CIMDataType arg  ) 
 

Copy constructor.

Parameters:
arg The CIMDataType to make a copy of

Definition at line 71 of file OWBI1_CIMDataType.cpp.

OWBI1::CIMDataType::CIMDataType const detail::CIMDataTypeRepRef rep  )  [explicit]
 

Definition at line 75 of file OWBI1_CIMDataType.cpp.

OWBI1::CIMDataType::~CIMDataType  ) 
 

Destroy this CIMDataType object.

Definition at line 81 of file OWBI1_CIMDataType.cpp.


Member Function Documentation

bool OWBI1::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 170 of file OWBI1_CIMDataType.cpp.

References m_rep.

String OWBI1::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 201 of file OWBI1_CIMDataType.cpp.

References m_rep.

CIMDataType OWBI1::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 215 of file OWBI1_CIMDataType.cpp.

References OWBI1::String::c_str(), and CIMDataType().

String OWBI1::CIMDataType::getRefClassName  )  const
 

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

Definition at line 136 of file OWBI1_CIMDataType.cpp.

References m_rep.

CIMDataTypeRepRef OWBI1::CIMDataType::getRep  )  const
 

Definition at line 222 of file OWBI1_CIMDataType.cpp.

References m_rep.

Referenced by OWBI1::CIMValueCast::castValueToDataType(), and OWBI1::CIMQualifierType::setDataType().

Int32 OWBI1::CIMDataType::getSize  )  const
 

Returns:
the number of elements for this CIMDataType

Definition at line 130 of file OWBI1_CIMDataType.cpp.

References m_rep.

CIMDataType::Type OWBI1::CIMDataType::getType  )  const
 

Returns:
the type of this CIMDataType

Definition at line 124 of file OWBI1_CIMDataType.cpp.

References m_rep.

bool OWBI1::CIMDataType::isArrayType  )  const
 

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

Definition at line 99 of file OWBI1_CIMDataType.cpp.

References m_rep.

bool OWBI1::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 112 of file OWBI1_CIMDataType.cpp.

bool OWBI1::CIMDataType::isNumericType  )  const
 

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

Definition at line 105 of file OWBI1_CIMDataType.cpp.

References m_rep.

bool OWBI1::CIMDataType::isReferenceType  )  const
 

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

Definition at line 118 of file OWBI1_CIMDataType.cpp.

References m_rep.

OWBI1::CIMDataType::operator CIMDataType::safe_bool  )  const
 

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

Definition at line 141 of file OWBI1_CIMDataType.cpp.

References m_rep.

bool OWBI1::CIMDataType::operator!  )  const
 

Definition at line 147 of file OWBI1_CIMDataType.cpp.

References m_rep.

CIMDataType & OWBI1::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 92 of file OWBI1_CIMDataType.cpp.

References m_rep.

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

Read this CIMDataType from an inputstream.

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

Implements OWBI1::SerializableIFC.

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

Set this to a null object.

Implements OWBI1::CIMBase.

Definition at line 86 of file OWBI1_CIMDataType.cpp.

References m_rep.

bool OWBI1::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 153 of file OWBI1_CIMDataType.cpp.

References m_rep.

CIMDataType::Type OWBI1::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 208 of file OWBI1_CIMDataType.cpp.

References OWBI1::String::c_str().

bool OWBI1::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 159 of file OWBI1_CIMDataType.cpp.

References OWBI1::CIMValue::getRep(), and m_rep.

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

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

Implements OWBI1::CIMBase.

Definition at line 194 of file OWBI1_CIMDataType.cpp.

References m_rep.

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

Returns:
The string representation of this CIMDataType object.

Implements OWBI1::CIMBase.

Definition at line 188 of file OWBI1_CIMDataType.cpp.

References m_rep.

virtual void OWBI1::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 OWBI1::SerializableIFC.


Friends And Related Function Documentation

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

Definition at line 228 of file OWBI1_CIMDataType.cpp.

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

Definition at line 234 of file OWBI1_CIMDataType.cpp.


Member Data Documentation

detail::CIMDataTypeRepRef OWBI1::CIMDataType::m_rep [private]
 

Definition at line 245 of file OWBI1_CIMDataType.hpp.

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


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