version 1.10, 2001/12/13 14:53:55
|
version 1.16, 2002/05/15 23:14:20
|
|
|
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: |
// Modified By: Ramnath Ravindran (Ramnath.Ravindran@compaq.com) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
char16 CIMType::CHAR16 Char16 | char16 CIMType::CHAR16 Char16 |
string CIMType::STRING String | string CIMType::STRING String |
datetime CIMType::DATETIME CIMDateTime | datetime CIMType::DATETIME CIMDateTime |
reference CIMType::REFERENCE CIMReference |
reference CIMType::REFERENCE CIMObjectPath |
| |
</pre> | </pre> |
*/ | */ |
|
|
REFERENCE | REFERENCE |
}; | }; |
| |
CIMType() : _tag(NONE) { } |
/// Constructor |
|
CIMType(); |
| |
CIMType(Tag tag) : _tag(tag) { } |
/// Constructor |
|
CIMType(Tag tag); |
| |
PEGASUS_EXPLICIT CIMType(Uint32 tag) : _tag(Tag(tag)) { } |
#if 0 // ATTN-RK-P3-20020514: Why encourage/allow this? |
|
/// Constructor |
|
PEGASUS_EXPLICIT CIMType(Uint32 tag); |
|
#endif |
| |
CIMType(const CIMType& x) : _tag(x._tag) { } |
/// Constructor |
|
CIMType(const CIMType& x); |
| |
CIMType& operator=(Tag tag) { _tag = tag; return *this; } |
/// operator = |
|
CIMType& operator=(Tag tag); |
| |
operator Tag() const { return _tag; } |
/// |
|
operator Tag() const; |
| |
Boolean equal(const CIMType& x) const { return x._tag == _tag; } |
/// |
|
Boolean equal(const CIMType& x) const; |
|
|
|
/** Returns a string representation of the given type that may be useful |
|
for debugging. (Note: the current implementation returns a string |
|
matching the first column in the table above, but that is subject to |
|
change in later revisions. |
|
*/ |
|
const char* toString() const; |
| |
private: | private: |
| |
Tag _tag; | Tag _tag; |
}; | }; |
| |
|
#if 0 // ATTN-RK-P3-20020514: These shouldn't be necessary because the |
|
// compiler can convert CIMType to CIMType::Tag automatically |
inline Boolean operator==(CIMType x, CIMType y) | inline Boolean operator==(CIMType x, CIMType y) |
{ | { |
return CIMType::Tag(x) == CIMType::Tag(y); | return CIMType::Tag(x) == CIMType::Tag(y); |
|
|
{ | { |
return !operator==(x, y); | return !operator==(x, y); |
} | } |
|
#endif |
// ATTN: this doesn't seem necessary! |
|
|
|
inline Boolean operator==(CIMType x, CIMType::Tag y) |
|
{ |
|
return x.equal(y); |
|
} |
|
|
|
inline Boolean operator==(CIMType::Tag x, CIMType y) |
|
{ |
|
return y.equal(x); |
|
} |
|
|
|
inline Boolean operator!=(CIMType x, CIMType::Tag y) |
|
{ |
|
return !operator==(x, y); |
|
} |
|
|
|
inline Boolean operator!=(CIMType::Tag x, CIMType y) |
|
{ |
|
return !operator==(x, y); |
|
} |
|
|
|
// Returns a string representation of the given type. The string |
|
// is the same as the "CIM CIMType" column in the table above. |
|
|
|
PEGASUS_COMMON_LINKAGE const char* TypeToString(CIMType type); |
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |