version 1.2, 2001/07/02 01:50:09
|
version 1.3, 2001/07/03 14:57:38
|
|
|
{ | { |
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. |
|
|
| |
CIMObjectWithPath(); | CIMObjectWithPath(); |
| |
CIMObjectWithPath(CIMReference& reference, CIMObject& object); |
CIMObjectWithPath(const CIMReference& reference, const CIMObject& object); |
| |
CIMObjectWithPath(const CIMObjectWithPath& x); | CIMObjectWithPath(const CIMObjectWithPath& x); |
| |
|
|
| |
CIMObjectWithPath& operator=(const CIMObjectWithPath& x); | CIMObjectWithPath& operator=(const CIMObjectWithPath& x); |
| |
void set(CIMReference& reference, CIMObject& object); |
void set(const CIMReference& reference, const CIMObject& object); |
| |
const CIMReference& getReference() const { return _reference; } | const CIMReference& getReference() const { return _reference; } |
| |