OWBI1::CIMObjectPath Class Reference

The CIMOMObjectPath class represents the location of CIM classes and instances. More...

#include <OWBI1_CIMObjectPath.hpp>

Inheritance diagram for OWBI1::CIMObjectPath:

Inheritance graph
[legend]
Collaboration diagram for OWBI1::CIMObjectPath:

Collaboration graph
[legend]
List of all members.

Public Types

typedef detail::CIMObjectPathRepRef
CIMObjectPath::* 
safe_bool

Public Member Functions

 CIMObjectPath ()
 Create a new CIMObjectPath object.
 CIMObjectPath (CIMNULL_t)
 Create a NULL CIMObjectPath object.
 CIMObjectPath (const CIMName &className)
 Create an CIMObjectPath to access the specified object.
 CIMObjectPath (const char *className)
 Create an CIMObjectPath to access the specified object.
 CIMObjectPath (const CIMName &className, const String &nspace)
 Create an CIMObjectPath to access the specified object (a qualifier or a class) in a particular namespace.
 CIMObjectPath (const CIMName &className, const CIMPropertyArray &keys)
 Create an CIMObjectPath for an instance.
 CIMObjectPath (const String &ns, const CIMInstance &inst)
 Create an CIMObjectPath for an instance and namespace.
 CIMObjectPath (const CIMObjectPath &arg)
 Create a new CIMObject path from another.
 CIMObjectPath (const detail::CIMObjectPathRepRef &rep)
 ~CIMObjectPath ()
 Destroy this CIMObjectPath object.
virtual void setNull ()
 Set this to a null object.
CIMObjectPathoperator= (const CIMObjectPath &arg)
 Assignment operator.
CIMPropertyArray getKeys () const
 Get the keys for this object path.
CIMProperty getKey (const CIMName &keyName) const
 Get a key from this ObjectPath.
CIMProperty getKeyT (const CIMName &keyName) const
 Get a key from this ObjectPath.
CIMValue getKeyValue (const CIMName &name) const
 Gets a key's value.
bool keyHasValue (const CIMName &name) const
 Test whether a key exists and has a non-NULL value.
CIMObjectPathsetKeys (const CIMPropertyArray &newKeys)
 Set the keys of this object path.
CIMObjectPathsetKeys (const CIMInstance &instance)
 Set the keys of this object path from the key properties of an instance.
CIMObjectPathsetKeyValue (const CIMName &name, const CIMValue &value)
 Set a key value.
String getNameSpace () const
CIMUrl getNameSpaceUrl () const
String getHost () const
String getClassName () const
CIMObjectPathsetHost (const String &host)
 Set the host name on the name space for this object path.
CIMObjectPathsetNameSpace (const String &ns)
 Set the namespace for this object path.
CIMObjectPathsetClassName (const CIMName &className)
 Assign a class name to this object path.
bool equals (const CIMObjectPath &op) const
 Compare this object path with another.
 operator safe_bool () const
bool operator! () const
bool operator== (const CIMObjectPath &op) const
 Equality operator.
bool operator!= (const CIMObjectPath &op) const
 Not Equal operator.
CIMNameSpace getFullNameSpace () const
bool isClassPath () const
bool isInstancePath () const
virtual String toString () const
virtual String modelPath () const
virtual String toMOF () const
virtual void readObject (std::istream &istrm)
 Read this object from an input stream.
virtual void writeObject (std::ostream &ostrm) const
 Write this object to an output stream.
CIMObjectPathsyncWithClass (const CIMClass &theClass)
 Synchronize this object path with the given class.
detail::CIMObjectPathRepRef getRep () const

Static Public Member Functions

static String escape (const String &inString)
 Escapes quotes and '/'.
static String unEscape (const String &inString)
 Unescapes quotes and '/'.
static CIMObjectPath parse (const String &instanceName)
 Convert a string representation of an object path to an CIMObjectPath.

Private Attributes

detail::CIMObjectPathRepRef m_rep

Detailed Description

The CIMOMObjectPath class represents the location of CIM classes and instances.

CIMObjectPath is a ref counted, copy on write object. It is possible to have a NULL CIMObjectPath.

Definition at line 53 of file OWBI1_CIMObjectPath.hpp.


Member Typedef Documentation

typedef detail::CIMObjectPathRepRef CIMObjectPath::* OWBI1::CIMObjectPath::safe_bool
 

Definition at line 233 of file OWBI1_CIMObjectPath.hpp.


Constructor & Destructor Documentation

CIMObjectPath::CIMObjectPath  ) 
 

Create a new CIMObjectPath object.

Definition at line 61 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath CIMNULL_t   )  [explicit]
 

Create a NULL CIMObjectPath object.

Definition at line 66 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const CIMName className  )  [explicit]
 

Create an CIMObjectPath to access the specified object.

Parameters:
className The name of the CIM class this object path is for.

Definition at line 76 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const char *  className  )  [explicit]
 

Create an CIMObjectPath to access the specified object.

Parameters:
className The name of the CIM class this object path is for as a NULL terminated string.

Definition at line 71 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const CIMName className,
const String nspace
 

Create an CIMObjectPath to access the specified object (a qualifier or a class) in a particular namespace.

Parameters:
className The name of the CIM class this object refers to.
nspace The string representation of the name space (e.g. "root/cimv2")

Definition at line 81 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const CIMName className,
const CIMPropertyArray keys
 

Create an CIMObjectPath for an instance.

Parameters:
className The name of the class for the instance
keys An CIMPropertyArray that contains the keys for the instance.

Definition at line 86 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const String ns,
const CIMInstance inst
 

Create an CIMObjectPath for an instance and namespace.

Parameters:
ns The namespace
inst An instance.

Definition at line 91 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const CIMObjectPath arg  ) 
 

Create a new CIMObject path from another.

Parameters:
arg The CIMObjectPath this object will be a copy of.

Definition at line 96 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::CIMObjectPath const detail::CIMObjectPathRepRef rep  )  [explicit]
 

Definition at line 102 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath::~CIMObjectPath  ) 
 

Destroy this CIMObjectPath object.

Definition at line 108 of file OWBI1_CIMObjectPath.cpp.


Member Function Documentation

bool CIMObjectPath::equals const CIMObjectPath op  )  const
 

Compare this object path with another.

Parameters:
op The object path to compare to this one.
Returns:
true if the object paths are equal. Otherwise false.

Definition at line 222 of file OWBI1_CIMObjectPath.cpp.

References cop, and getNameSpace().

String CIMObjectPath::escape const String inString  )  [static]
 

Escapes quotes and '/'.

Parameters:
inString The string to escape
Returns:
The escaped string

Definition at line 560 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::String::c_str(), and OWBI1::String::length().

String CIMObjectPath::getClassName  )  const
 

Returns:
The class name for this object path

Definition at line 195 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::String::toString().

CIMNameSpace CIMObjectPath::getFullNameSpace  )  const
 

Returns:
The full namespace for this object path

Definition at line 270 of file OWBI1_CIMObjectPath.cpp.

String CIMObjectPath::getHost  )  const
 

Returns:
The host name from the name space for this object path.

Definition at line 189 of file OWBI1_CIMObjectPath.cpp.

CIMProperty CIMObjectPath::getKey const CIMName keyName  )  const
 

Get a key from this ObjectPath.

Parameters:
key The Name of the key to get
Returns:
An CIMProperty corresponding to key. If there is no key found, a NULL CIMProperty will be returned.

Definition at line 132 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::CIMName::getRep().

CIMPropertyArray CIMObjectPath::getKeys  )  const
 

Get the keys for this object path.

Returns:
An CIMPropertyArray containing the keys for this object path.

Definition at line 126 of file OWBI1_CIMObjectPath.cpp.

CIMProperty CIMObjectPath::getKeyT const CIMName keyName  )  const
 

Get a key from this ObjectPath.

Parameters:
key The Name of the key to get
Returns:
An CIMProperty corresponding to key. If there is no key found, an NoSuchPropertyException exception is thrown.
Exceptions:
NoSuchPropertyException if keyName is not a property

Definition at line 138 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::String::c_str(), OWBI1_THROW, and OWBI1::CIMName::toString().

CIMValue CIMObjectPath::getKeyValue const CIMName name  )  const
 

Gets a key's value.

Parameters:
name The name of the key value to retrieve.
Returns:
The CIMValue of the specified key. It will be NULL if the key doesn't exist or the key's value is NULL.

Definition at line 149 of file OWBI1_CIMObjectPath.cpp.

References name.

String CIMObjectPath::getNameSpace  )  const
 

Returns:
The namespace component of the CIMNameSpace for this object path

Definition at line 183 of file OWBI1_CIMObjectPath.cpp.

Referenced by equals().

CIMUrl CIMObjectPath::getNameSpaceUrl  )  const
 

Returns:
The URL component of the CIMNameSpace for this object path

Definition at line 553 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPathRepRef CIMObjectPath::getRep  )  const
 

Definition at line 716 of file OWBI1_CIMObjectPath.cpp.

bool CIMObjectPath::isClassPath  )  const
 

Returns:
true if this object is a class path

Definition at line 631 of file OWBI1_CIMObjectPath.cpp.

bool CIMObjectPath::isInstancePath  )  const
 

Returns:
true if this object is an instance path

Definition at line 636 of file OWBI1_CIMObjectPath.cpp.

bool CIMObjectPath::keyHasValue const CIMName name  )  const
 

Test whether a key exists and has a non-NULL value.

Parameters:
name The name of the key to test.
Returns:
bool true if the key exists and has a non-NULL value.

Definition at line 155 of file OWBI1_CIMObjectPath.cpp.

References name.

String CIMObjectPath::modelPath  )  const [virtual]
 

Returns:
The model path component of this CIMObjectPath as an String

Definition at line 276 of file OWBI1_CIMObjectPath.cpp.

References i.

CIMObjectPath::operator safe_bool  )  const
 

Returns:
true if this is not a null object.

Definition at line 702 of file OWBI1_CIMObjectPath.cpp.

bool CIMObjectPath::operator!  )  const
 

Definition at line 709 of file OWBI1_CIMObjectPath.cpp.

bool OWBI1::CIMObjectPath::operator!= const CIMObjectPath op  )  const [inline]
 

Not Equal operator.

Parameters:
op The object path to compare to this one.
Returns:
true if the object paths are not equal. Otherwise false.

Definition at line 254 of file OWBI1_CIMObjectPath.hpp.

CIMObjectPath & CIMObjectPath::operator= const CIMObjectPath arg  ) 
 

Assignment operator.

Parameters:
arg The CIMObjectPath to assign to this one.
Returns:
A reference to this object after the assignment has been made.

Definition at line 119 of file OWBI1_CIMObjectPath.cpp.

References m_rep.

bool OWBI1::CIMObjectPath::operator== const CIMObjectPath op  )  const [inline]
 

Equality operator.

Parameters:
op The object path to compare to this one.
Returns:
true if the object paths are equal. Otherwise false.

Definition at line 244 of file OWBI1_CIMObjectPath.hpp.

CIMObjectPath CIMObjectPath::parse const String instanceName  )  [static]
 

Convert a string representation of an object path to an CIMObjectPath.

Parameters:
instanceName The object path to convert. Assumed to be an instance path.
Returns:
An CIMObjectPath object on success.

Definition at line 374 of file OWBI1_CIMObjectPath.cpp.

References OW_NAMESPACE::CIMNULL, OWBI1::String::empty(), and OWBI1::String::trim().

virtual void OWBI1::CIMObjectPath::readObject std::istream &  istrm  )  [virtual]
 

Read this object from an input stream.

Parameters:
istrm The input stream to read this object from.

Implements OWBI1::SerializableIFC.

CIMObjectPath & CIMObjectPath::setClassName const CIMName className  ) 
 

Assign a class name to this object path.

Parameters:
className The name of the class to assign to this object path.
Returns:
a reference to *this

Definition at line 215 of file OWBI1_CIMObjectPath.cpp.

References className.

CIMObjectPath & CIMObjectPath::setHost const String host  ) 
 

Set the host name on the name space for this object path.

Parameters:
host The new name of the host to set on the underlying name space.
Returns:
a reference to *this

Definition at line 201 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath & CIMObjectPath::setKeys const CIMInstance instance  ) 
 

Set the keys of this object path from the key properties of an instance.

Parameters:
instance The CIM instance to get the key properties from.
Returns:
a reference to *this

Definition at line 168 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::CIMInstance::getKeyValuePairs(), and OW_ASSERT.

CIMObjectPath & CIMObjectPath::setKeys const CIMPropertyArray newKeys  ) 
 

Set the keys of this object path.

Parameters:
newKeys An CIMPropertyArray that contains the keys for this object path.
Returns:
a reference to *this

Definition at line 161 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath & CIMObjectPath::setKeyValue const CIMName name,
const CIMValue value
 

Set a key value.

This will update an existing key, or add a new key if one with name doesn't already exist.

Parameters:
name The name of the key
value The value of the key
Returns:
a reference to *this

Definition at line 176 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::CIMValue::getRep(), and name.

CIMObjectPath & CIMObjectPath::setNameSpace const String ns  ) 
 

Set the namespace for this object path.

Parameters:
ns The string representation of the namespace.
Returns:
a reference to *this

Definition at line 208 of file OWBI1_CIMObjectPath.cpp.

References ns.

void CIMObjectPath::setNull  )  [virtual]
 

Set this to a null object.

Implements OWBI1::CIMBase.

Definition at line 113 of file OWBI1_CIMObjectPath.cpp.

CIMObjectPath & CIMObjectPath::syncWithClass const CIMClass theClass  ) 
 

Synchronize this object path with the given class.

This will ensure that all keys found on the class exist. All CIMValue types will be cast to the proper type, this is helpful because CIM-XML does not preserve the detailed type information of key-value pairs.

Parameters:
cc The class to synchronize with.
Returns:
a reference to *this

Definition at line 642 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::CIMClass::getKeys(), OWBI1::CIMClass::getProperty(), OWBI1::Array< T >::remove(), OWBI1::Array< T >::size(), and theClass.

String CIMObjectPath::toMOF  )  const [virtual]
 

Returns:
The MOF representation of this CIMObjectPath as an String

Implements OWBI1::CIMBase.

Definition at line 340 of file OWBI1_CIMObjectPath.cpp.

References OW_NAMESPACE::toString().

String CIMObjectPath::toString  )  const [virtual]
 

Returns:
The string representation of this CIMObjectPath.

Implements OWBI1::CIMBase.

Definition at line 303 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::CIMUrl::isLocal(), and OWBI1::StringBuffer::length().

Referenced by OWBI1::BI1SimpleInstanceProviderIFC::getInstance().

String CIMObjectPath::unEscape const String inString  )  [static]
 

Unescapes quotes and '/'.

Parameters:
inString The string in an escaped form
Returns:
The string with escape sequences removed

Definition at line 596 of file OWBI1_CIMObjectPath.cpp.

References OWBI1::String::c_str(), OWBI1::String::length(), and OWBI1::StringBuffer::releaseString().

virtual void OWBI1::CIMObjectPath::writeObject std::ostream &  ostrm  )  const [virtual]
 

Write this object to an output stream.

Parameters:
ostrm The output stream to write this object to.

Implements OWBI1::SerializableIFC.


Member Data Documentation

detail::CIMObjectPathRepRef OWBI1::CIMObjectPath::m_rep [private]
 

Definition at line 313 of file OWBI1_CIMObjectPath.hpp.

Referenced by operator=().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:18:10 2006 for openwbem by  doxygen 1.4.6