version 1.3, 2001/02/20 05:16:57
|
version 1.4, 2001/02/20 07:25:57
|
|
|
// Author: | // Author: |
// | // |
// $Log$ | // $Log$ |
|
// Revision 1.4 2001/02/20 07:25:57 mike |
|
// Added basic create-instance in repository and in client. |
|
// |
// Revision 1.3 2001/02/20 05:16:57 mike | // Revision 1.3 2001/02/20 05:16:57 mike |
// Implemented CIMInstance::getInstanceName() | // Implemented CIMInstance::getInstanceName() |
// | // |
|
|
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
class CIMConstInstance; |
class ConstCIMInstance; |
| |
/** Class CIMInstance - The CIMInstance class represents the instance of | /** Class CIMInstance - The CIMInstance class represents the instance of |
a CIM class in Pegasus. It is used manipulate instances and the | a CIM class in Pegasus. It is used manipulate instances and the |
|
|
/** CIMMethod | /** CIMMethod |
| |
*/ | */ |
Boolean identical(const CIMConstInstance& x) const; |
Boolean identical(const ConstCIMInstance& x) const; |
| |
/** CIMMethod | /** CIMMethod |
| |
|
|
is all lowercase; the keys-value pairs appear in sorted order by | is all lowercase; the keys-value pairs appear in sorted order by |
key name). | key name). |
*/ | */ |
String getInstanceName(ConstCIMClass& cimClass) const |
String getInstanceName(const ConstCIMClass& cimClass) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getInstanceName(cimClass); | return _rep->getInstanceName(cimClass); |
|
|
} | } |
| |
CIMInstanceRep* _rep; | CIMInstanceRep* _rep; |
friend class CIMConstInstance; |
friend class ConstCIMInstance; |
}; | }; |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
// | // |
// CIMConstInstance |
// ConstCIMInstance |
// | // |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
| |
class PEGASUS_COMMON_LINKAGE CIMConstInstance |
class PEGASUS_COMMON_LINKAGE ConstCIMInstance |
{ | { |
public: | public: |
| |
CIMConstInstance() : _rep(0) |
ConstCIMInstance() : _rep(0) |
{ | { |
| |
} | } |
| |
CIMConstInstance(const CIMConstInstance& x) |
ConstCIMInstance(const ConstCIMInstance& x) |
{ | { |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
} | } |
| |
CIMConstInstance(const CIMInstance& x) |
ConstCIMInstance(const CIMInstance& x) |
{ | { |
Inc(_rep = x._rep); | Inc(_rep = x._rep); |
} | } |
| |
CIMConstInstance& operator=(const CIMConstInstance& x) |
ConstCIMInstance& operator=(const ConstCIMInstance& x) |
{ | { |
if (x._rep != _rep) | if (x._rep != _rep) |
{ | { |
|
|
return *this; | return *this; |
} | } |
| |
CIMConstInstance& operator=(const CIMInstance& x) |
ConstCIMInstance& operator=(const CIMInstance& x) |
{ | { |
if (x._rep != _rep) | if (x._rep != _rep) |
{ | { |
|
|
| |
// Throws IllegalName if className argument not legal CIM identifier. | // Throws IllegalName if className argument not legal CIM identifier. |
| |
CIMConstInstance(const String& className) |
ConstCIMInstance(const String& className) |
{ | { |
_rep = new CIMInstanceRep(className); | _rep = new CIMInstanceRep(className); |
} | } |
| |
~CIMConstInstance() |
~ConstCIMInstance() |
{ | { |
Dec(_rep); | Dec(_rep); |
} | } |
|
|
_rep->print(); | _rep->print(); |
} | } |
| |
Boolean identical(const CIMConstInstance& x) const |
Boolean identical(const ConstCIMInstance& x) const |
{ | { |
x._checkRep(); | x._checkRep(); |
_checkRep(); | _checkRep(); |
|
|
return CIMInstance(_rep->clone()); | return CIMInstance(_rep->clone()); |
} | } |
| |
String getInstanceName(ConstCIMClass& cimClass) const |
String getInstanceName(const ConstCIMClass& cimClass) const |
{ | { |
_checkRep(); | _checkRep(); |
return _rep->getInstanceName(cimClass); | return _rep->getInstanceName(cimClass); |