version 1.2, 2001/07/02 01:50:09
|
version 1.5, 2001/07/10 06:43:23
|
|
|
{ | { |
public: | public: |
| |
CIMObject() : _rep(0) |
CIMObject() : _rep(0), _type(TYPE_NONE) |
{ | { |
| |
} | } |
| |
CIMObject(const CIMObject& x) |
CIMObject(const CIMObject& x) : _type(x._type) |
{ | { |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
} | } |
| |
CIMObject(const CIMClass& x) |
CIMObject(const CIMClass& x) : _type(TYPE_CLASS) |
{ | { |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
} | } |
| |
CIMObject(const CIMInstance& x) |
CIMObject(const CIMInstance& x) : _type(TYPE_INSTANCE) |
{ | { |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
} | } |
|
|
{ | { |
Dec(_rep); | Dec(_rep); |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
|
_type = x._type; |
} | } |
return *this; | return *this; |
} | } |
|
|
{ | { |
Dec(_rep); | Dec(_rep); |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
|
_type = TYPE_CLASS; |
} | } |
return *this; | return *this; |
} | } |
|
|
{ | { |
Dec(_rep); | Dec(_rep); |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
|
_type = TYPE_INSTANCE; |
} | } |
return *this; | return *this; |
} | } |
|
|
| |
Boolean isClass() const | Boolean isClass() const |
{ | { |
_checkRep(); |
return _type == TYPE_CLASS; |
return dynamic_cast<CIMClassRep*>(_rep) != 0; |
|
} | } |
| |
Boolean isInstance() const | Boolean isInstance() const |
{ | { |
_checkRep(); |
return _type == TYPE_INSTANCE; |
return dynamic_cast<CIMInstanceRep*>(_rep) != 0; |
|
} | } |
| |
/** Returns the class contained by this object (if an class). | /** Returns the class contained by this object (if an class). |
|
|
// Point to either a CIMClass or CIMInstance: | // Point to either a CIMClass or CIMInstance: |
| |
Sharable* _rep; | Sharable* _rep; |
|
|
|
enum Type { TYPE_CLASS, TYPE_INSTANCE, TYPE_NONE }; |
|
Type _type; |
}; | }; |
| |
/** The CIMObjectWithPath encapsulates a CIMReference and CIMObject. | /** The CIMObjectWithPath encapsulates a CIMReference and CIMObject. |
|
|
{ | { |
public: | public: |
| |
|
/** Constructor |
|
*/ |
CIMObjectWithPath(); | CIMObjectWithPath(); |
| |
CIMObjectWithPath(CIMReference& reference, CIMObject& object); |
/** constructor |
|
*/ |
|
CIMObjectWithPath(const CIMReference& reference, const CIMObject& object); |
| |
|
/** Constructor - Constructs a CIMObjectWithPath Object from |
|
another CimObjectWithPath |
|
@param - ATTN |
|
*/ |
CIMObjectWithPath(const CIMObjectWithPath& x); | CIMObjectWithPath(const CIMObjectWithPath& x); |
| |
~CIMObjectWithPath(); | ~CIMObjectWithPath(); |
| |
CIMObjectWithPath& operator=(const CIMObjectWithPath& x); | CIMObjectWithPath& operator=(const CIMObjectWithPath& x); |
| |
void set(CIMReference& reference, CIMObject& object); |
/** set - |
|
*/ |
|
void set(const CIMReference& reference, const CIMObject& object); |
| |
|
/** |
|
*/ |
const CIMReference& getReference() const { return _reference; } | const CIMReference& getReference() const { return _reference; } |
| |
|
/** |
|
*/ |
const CIMObject& getObject() const { return _object; } | const CIMObject& getObject() const { return _object; } |
| |
|
/** |
|
*/ |
CIMReference& getReference() { return _reference; } | CIMReference& getReference() { return _reference; } |
| |
|
/** |
|
*/ |
CIMObject& getObject() { return _object; } | CIMObject& getObject() { return _object; } |
| |
|
/** |
|
*/ |
void toXml(Array<Sint8>& out) const; | void toXml(Array<Sint8>& out) const; |
| |
private: | private: |