version 1.8, 2002/07/30 22:03:00
|
version 1.9, 2002/07/31 15:45:25
|
|
|
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// 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 |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
_rep->_type = type; | _rep->_type = type; |
} | } |
| |
const char* KeyBinding::typeToString(KeyBinding::Type type) |
|
{ |
|
switch (type) |
|
{ |
|
case KeyBinding::BOOLEAN: |
|
return "boolean"; |
|
|
|
case KeyBinding::STRING: |
|
return "string"; |
|
|
|
case KeyBinding::NUMERIC: |
|
return "numeric"; |
|
|
|
case KeyBinding::REFERENCE: |
|
default: |
|
PEGASUS_ASSERT(false); |
|
} |
|
|
|
return "unknown"; |
|
} |
|
|
|
Boolean operator==(const KeyBinding& x, const KeyBinding& y) | Boolean operator==(const KeyBinding& x, const KeyBinding& y) |
{ | { |
return | return |
|
|
_rep = new CIMObjectPathRep(*tmpRef._rep); | _rep = new CIMObjectPathRep(*tmpRef._rep); |
} | } |
| |
CIMObjectPath::CIMObjectPath(const char* objectName) |
|
{ |
|
// Test the objectName out to see if we get an exception |
|
CIMObjectPath tmpRef; |
|
tmpRef.set(objectName); |
|
|
|
_rep = new CIMObjectPathRep(*tmpRef._rep); |
|
} |
|
|
|
CIMObjectPath::CIMObjectPath( | CIMObjectPath::CIMObjectPath( |
const String& host, | const String& host, |
const CIMNamespaceName& nameSpace, | const CIMNamespaceName& nameSpace, |
|
|
Boolean CIMObjectPath::_parseHostElement( | Boolean CIMObjectPath::_parseHostElement( |
const String& objectName, | const String& objectName, |
char*& p, | char*& p, |
String& host) throw(IllformedObjectName) |
String& host) |
{ | { |
// See if there is a host name (true if it begins with "//"): | // See if there is a host name (true if it begins with "//"): |
// Host is of the from <hostname>-<port> and begins with "//" | // Host is of the from <hostname>-<port> and begins with "//" |
|
|
void CIMObjectPath::_parseKeyBindingPairs( | void CIMObjectPath::_parseKeyBindingPairs( |
const String& objectName, | const String& objectName, |
char*& p, | char*& p, |
Array<KeyBinding>& keyBindings) throw(IllformedObjectName) |
Array<KeyBinding>& keyBindings) |
{ | { |
// Get the key-value pairs: | // Get the key-value pairs: |
| |
|
|
_BubbleSort(keyBindings); | _BubbleSort(keyBindings); |
} | } |
| |
void CIMObjectPath::set(const String& objectName) throw(IllformedObjectName) |
void CIMObjectPath::set(const String& objectName) |
{ | { |
clear(); | clear(); |
| |
|
|
return *this; | return *this; |
} | } |
| |
CIMObjectPath& CIMObjectPath::operator=(const char* objectName) |
|
{ |
|
set(objectName); |
|
return *this; |
|
} |
|
|
|
const String& CIMObjectPath::getHost() const | const String& CIMObjectPath::getHost() const |
{ | { |
return _rep->_host; | return _rep->_host; |
|
|
| |
objectName.append(getClassName()); | objectName.append(getClassName()); |
| |
if (isInstanceName()) |
// |
|
// ATTN-CAKG-P2-20020726: The following condition does not correctly |
|
// distinguish instanceNames from classNames in every case |
|
// The instanceName of a singleton instance of a keyless class has no |
|
// key bindings |
|
// |
|
if (_rep->_keyBindings.size () != 0) |
{ | { |
objectName.append('.'); | objectName.append('.'); |
| |
|
|
return ref.toString(includeHost); | return ref.toString(includeHost); |
} | } |
| |
CIMObjectPath CIMObjectPath::clone() const |
|
{ |
|
return CIMObjectPath(*this); |
|
} |
|
|
|
Boolean CIMObjectPath::identical(const CIMObjectPath& x) const | Boolean CIMObjectPath::identical(const CIMObjectPath& x) const |
{ | { |
return | return |
|
|
return HashFunc<String>::hash(toStringCanonical()); | return HashFunc<String>::hash(toStringCanonical()); |
} | } |
| |
Boolean CIMObjectPath::isInstanceName() const |
|
{ |
|
return _rep->_keyBindings.size() != 0; |
|
} |
|
|
|
KeyBindingArray CIMObjectPath::getKeyBindingArray() |
|
{ |
|
return KeyBindingArray(); |
|
} |
|
|
|
|
|
Boolean operator==(const CIMObjectPath& x, const CIMObjectPath& y) | Boolean operator==(const CIMObjectPath& x, const CIMObjectPath& y) |
{ | { |
return x.identical(y); | return x.identical(y); |