version 1.38, 2004/05/18 11:03:38
|
version 1.41.2.1, 2004/11/12 17:48:28
|
|
|
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Carol Ann Krug Graves, Hewlett-Packard Company | // Carol Ann Krug Graves, Hewlett-Packard Company |
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
// Amit K Arora, IBM (amita@in.ibm.com) |
|
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#include "CIMObjectPath.h" | #include "CIMObjectPath.h" |
#include "Indentor.h" | #include "Indentor.h" |
#include "CIMName.h" | #include "CIMName.h" |
|
#include "Destroyer.h" |
#include "XmlWriter.h" | #include "XmlWriter.h" |
#include "XmlReader.h" | #include "XmlReader.h" |
#include "ArrayInternal.h" | #include "ArrayInternal.h" |
|
|
}; | }; |
| |
| |
CIMKeyBinding::CIMKeyBinding(): |
CIMKeyBinding::CIMKeyBinding() |
_rep(new CIMKeyBindingRep()) |
|
{ | { |
|
_rep = new CIMKeyBindingRep(); |
} | } |
| |
CIMKeyBinding::CIMKeyBinding(const CIMKeyBinding& x): |
CIMKeyBinding::CIMKeyBinding(const CIMKeyBinding& x) |
_rep(new CIMKeyBindingRep(*(x._rep.get()))) |
|
{ | { |
|
_rep = new CIMKeyBindingRep(*x._rep); |
} | } |
| |
CIMKeyBinding::CIMKeyBinding(const CIMName& name, const String& value, Type type) : |
CIMKeyBinding::CIMKeyBinding(const CIMName& name, const String& value, Type type) |
_rep(new CIMKeyBindingRep(name, value, type)) |
|
{ | { |
|
_rep = new CIMKeyBindingRep(name, value, type); |
} | } |
| |
CIMKeyBinding::CIMKeyBinding(const CIMName& name, const CIMValue& value) | CIMKeyBinding::CIMKeyBinding(const CIMName& name, const CIMValue& value) |
|
|
case CIMTYPE_REFERENCE: | case CIMTYPE_REFERENCE: |
kbType = REFERENCE; | kbType = REFERENCE; |
break; | break; |
|
case CIMTYPE_OBJECT: |
|
throw TypeMismatchException(); |
|
// From PEP 194: |
|
// Open Issue for the DMTF: Are EmbeddedObject properties permitted to be keys? |
|
break; |
default: | default: |
kbType = NUMERIC; | kbType = NUMERIC; |
break; | break; |
} | } |
| |
_rep.reset(new CIMKeyBindingRep(name, kbValue, kbType)); |
_rep = new CIMKeyBindingRep(name, kbValue, kbType); |
} | } |
| |
CIMKeyBinding::~CIMKeyBinding() | CIMKeyBinding::~CIMKeyBinding() |
{ | { |
|
delete _rep; |
} | } |
| |
CIMKeyBinding& CIMKeyBinding::operator=(const CIMKeyBinding& x) | CIMKeyBinding& CIMKeyBinding::operator=(const CIMKeyBinding& x) |
{ | { |
CIMKeyBindingRep *tmp = new CIMKeyBindingRep(*x._rep.get()); |
*_rep = *x._rep; |
_rep.reset(tmp); |
|
return *this; | return *this; |
} | } |
| |
|
|
kbValue = XmlReader::stringToValue(0, getValue().getCString(), | kbValue = XmlReader::stringToValue(0, getValue().getCString(), |
value.getType()); | value.getType()); |
break; | break; |
|
case CIMTYPE_OBJECT: |
|
return false; |
|
// From PEP 194: |
|
// Open Issue for the DMTF: Are EmbeddedObject properties permitted to be keys? |
|
break; |
default: // Numerics | default: // Numerics |
if (getType() != NUMERIC) return false; | if (getType() != NUMERIC) return false; |
kbValue = XmlReader::stringToValue(0, getValue().getCString(), | kbValue = XmlReader::stringToValue(0, getValue().getCString(), |
|
|
}; | }; |
| |
| |
CIMObjectPath::CIMObjectPath() : |
CIMObjectPath::CIMObjectPath() |
_rep(new CIMObjectPathRep()) |
|
{ | { |
|
_rep = new CIMObjectPathRep(); |
} | } |
| |
CIMObjectPath::CIMObjectPath(const CIMObjectPath& x) : |
CIMObjectPath::CIMObjectPath(const CIMObjectPath& x) |
_rep(new CIMObjectPathRep(*x._rep.get())) |
|
{ | { |
|
_rep = new CIMObjectPathRep(*x._rep); |
} | } |
| |
CIMObjectPath::CIMObjectPath(const String& objectName) | CIMObjectPath::CIMObjectPath(const String& objectName) |
|
|
CIMObjectPath tmpRef; | CIMObjectPath tmpRef; |
tmpRef.set(objectName); | tmpRef.set(objectName); |
| |
_rep.reset(new CIMObjectPathRep(*tmpRef._rep.get())); |
_rep = new CIMObjectPathRep(*tmpRef._rep); |
} | } |
| |
CIMObjectPath::CIMObjectPath( | CIMObjectPath::CIMObjectPath( |
|
|
CIMObjectPath tmpRef; | CIMObjectPath tmpRef; |
tmpRef.set(host, nameSpace, className, keyBindings); | tmpRef.set(host, nameSpace, className, keyBindings); |
| |
_rep.reset(new CIMObjectPathRep(*tmpRef._rep.get())); |
_rep = new CIMObjectPathRep(*tmpRef._rep); |
} | } |
| |
CIMObjectPath::~CIMObjectPath() | CIMObjectPath::~CIMObjectPath() |
{ | { |
|
delete _rep; |
} | } |
| |
CIMObjectPath& CIMObjectPath::operator=(const CIMObjectPath& x) | CIMObjectPath& CIMObjectPath::operator=(const CIMObjectPath& x) |
{ | { |
CIMObjectPathRep *tmp = new CIMObjectPathRep(*x._rep.get()); |
*_rep = *x._rep; |
_rep.reset(tmp); |
|
return *this; | return *this; |
} | } |
| |
|
|
type = CIMKeyBinding::REFERENCE; | type = CIMKeyBinding::REFERENCE; |
} | } |
} | } |
catch (Exception & e) |
catch (const Exception &) |
{ | { |
// Not a reference value; leave type as STRING | // Not a reference value; leave type as STRING |
} | } |
|
|
return !operator==(x, y); | return !operator==(x, y); |
} | } |
| |
#ifdef PEGASUS_USE_DEPRECATED_INTERFACES |
|
PEGASUS_STD(ostream)& operator<<( |
|
PEGASUS_STD(ostream)& os, |
|
const CIMObjectPath& x) |
|
{ |
|
return os << x.toString(); |
|
} |
|
#endif |
|
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |