#include <OWBI1_CIMInstance.hpp>
Inheritance diagram for OWBI1::CIMInstance:
Public Types | |
typedef detail::CIMInstanceRepRef CIMInstance::* | safe_bool |
enum | { SERIALIZATION_VERSION = 1 } |
enum | EErrorCodes { E_INSTANCE_HAS_NO_SUCH_PROPERTY } |
Public Member Functions | |
CIMInstance () | |
Default ctor. | |
CIMInstance (CIMNULL_t) | |
This CIMInstance object will be NULL. | |
CIMInstance (const CIMInstance &arg) | |
Copy ctor. | |
CIMInstance (const CIMName &name) | |
Create an CIMInstance. | |
CIMInstance (const char *name) | |
Create an CIMInstance. | |
CIMInstance (const detail::CIMInstanceRepRef &rep) | |
~CIMInstance () | |
Destroy this CIMInstance object. | |
virtual void | setNull () |
Set this to a null object. | |
CIMInstance & | operator= (const CIMInstance &arg) |
Assignment operator. | |
CIMName | getClassName () const |
CIMInstance & | setKeys (const CIMPropertyArray &keys) |
Set the keys for this instance. | |
CIMInstance & | setClassName (const CIMName &name) |
Sets the class name for this instance. | |
String | getLanguage () const |
void | setLanguage (const String &language) |
Set the language this CIMClass is using. | |
CIMPropertyArray | getProperties (Int32 valueDataType=CIMDataType::INVALID) const |
Get all the properties of a specific datatype from this instance. | |
CIMInstance & | setProperties (const CIMPropertyArray &props) |
Set the properties associated with this instance. | |
CIMProperty | getProperty (const CIMName &name, const CIMName &originClass) const |
Get the property identified by a given name and origin class. | |
CIMProperty | getProperty (const CIMName &name) const |
Gets a property with the specified name. | |
CIMProperty | getPropertyT (const CIMName &name) const |
Gets a property with the specified name. | |
CIMValue | getPropertyValue (const CIMName &name) const |
Gets a property's value. | |
bool | propertyHasValue (const CIMName &name) const |
Test whether a property exists and has a non-NULL value. | |
CIMPropertyArray | getKeyValuePairs () const |
CIMInstance & | updatePropertyValues (const CIMPropertyArray &props) |
Update the property values for this instance. | |
CIMInstance & | updatePropertyValue (const CIMProperty &prop) |
Update a single property value. | |
CIMInstance & | updatePropertyValue (const CIMName &name, const CIMValue &cv) |
Update a single property value. | |
CIMInstance & | setProperty (const CIMName &name, const CIMValue &cv) |
Update the value of a property if it exists. | |
CIMInstance & | setProperty (const CIMProperty &prop) |
Update a property in the property list if it exists. | |
CIMInstance & | removeProperty (const CIMName &propName) |
Remove a property from this CIMInstance. | |
CIMInstance | clone (const CIMPropertyList &propertyList=CIMPropertyList()) const |
Create a new CIMInstance from this CIMInstance using the specified criteria. | |
CIMInstance & | syncWithClass (const CIMClass &cc) |
Synchronize this instance with the given class. | |
CIMInstance | createModifiedInstance (const CIMInstance &previousInstance, const CIMPropertyList &propertyList, const CIMClass &theClass) const |
Create an instance with the set of changes that will occur for a modifyInstance call. | |
virtual CIMName | getName () const |
virtual void | setName (const CIMName &name) |
Sets the class name for this instance. | |
virtual void | readObject (std::istream &istrm) |
Read this CIMInstance from an input stream. | |
virtual void | writeObject (std::ostream &ostrm) const |
Write this CIMInstance to an output stream. | |
virtual String | toMOF () const |
virtual String | toString () const |
bool | propertiesAreEqualTo (const CIMInstance &other) const |
This compares the properties of the instances, and returns true if they are equal. | |
operator safe_bool () const | |
bool | operator! () const |
detail::CIMInstanceRepRef | getRep () const |
Protected Member Functions | |
void | _buildKeys () |
Protected Attributes | |
detail::CIMInstanceRepRef | m_rep |
Friends | |
OWBI1_OWBI1PROVIFC_API bool | operator< (const CIMInstance &x, const CIMInstance &y) |
CIMInstances are ref counted, copy on write objects. It is possible to have an CIMInstance object that is NULL. The method to check for this condition is as follows:
CIMInstance ci = ch.getInstance(...); if (!ci) { // Null instance } else { // Valid instance }
Providers generally follow these steps to create a CIMInstance object:
1. Obtain a CIMOMHandleIFC object hdl.
2. Use hdl to create a CIMClass object of the desired CIM class:
CIMClass cc = hdl.getClass(namespace, class_name);
3. Use CIMClass cc to create a CIMInstance of the desired CIM class:
CIMInstance inst = cc.newInstance();
4. Assign properties of inst as desired using setProperty().
Definition at line 81 of file OWBI1_CIMInstance.hpp.
|
Definition at line 343 of file OWBI1_CIMInstance.hpp. |
|
Definition at line 84 of file OWBI1_CIMInstance.hpp. |
|
Reimplemented from OWBI1::CIMBase. Definition at line 86 of file OWBI1_CIMInstance.hpp. |
|
Default ctor.
Definition at line 56 of file OWBI1_CIMInstance.cpp. |
|
This CIMInstance object will be NULL. All subsequent operations on an instance of this type will fail. Definition at line 61 of file OWBI1_CIMInstance.cpp. |
|
Copy ctor.
Definition at line 76 of file OWBI1_CIMInstance.cpp. |
|
Create an CIMInstance.
Definition at line 71 of file OWBI1_CIMInstance.cpp. |
|
Create an CIMInstance.
Definition at line 66 of file OWBI1_CIMInstance.cpp. |
|
|
|
Destroy this CIMInstance object.
Definition at line 81 of file OWBI1_CIMInstance.cpp. |
|
Definition at line 214 of file OWBI1_CIMInstance.cpp. References i. |
|
Create a new CIMInstance from this CIMInstance using the specified criteria.
Definition at line 383 of file OWBI1_CIMInstance.cpp. References OWBI1::Array< T >::append(), i, m_rep, and propertyList. Referenced by OWBI1::BI1SimpleInstanceProviderIFC::getInstance(). |
|
Create an instance with the set of changes that will occur for a modifyInstance call. This instance is the new instance. The previous instance is passed in. The instance that is returned is what the new instance will be after modifyInstance is applied.
Definition at line 477 of file OWBI1_CIMInstance.cpp. References OWBI1::Array< T >::begin(), OWBI1::Array< T >::end(), getProperties(), OWBI1::CIMClass::getProperty(), getProperty(), OWBI1::CIMProperty::getQualifiers(), i, propertyList, removeProperty(), setProperties(), setProperty(), OWBI1::CIMProperty::setQualifiers(), and theClass. |
|
Definition at line 107 of file OWBI1_CIMInstance.cpp. |
|
Definition at line 229 of file OWBI1_CIMInstance.cpp. Referenced by OWBI1::CIMObjectPath::setKeys(). |
|
Definition at line 113 of file OWBI1_CIMInstance.cpp. |
|
Implements OWBI1::CIMElement. Definition at line 404 of file OWBI1_CIMInstance.cpp. |
|
Get all the properties of a specific datatype from this instance.
Definition at line 132 of file OWBI1_CIMInstance.cpp. References OWBI1::detail::unwrapArray(). Referenced by createModifiedInstance(), and propertiesAreEqualTo(). |
|
Gets a property with the specified name.
Definition at line 157 of file OWBI1_CIMInstance.cpp. References i. |
|
Get the property identified by a given name and origin class.
Definition at line 150 of file OWBI1_CIMInstance.cpp. References OWBI1::CIMName::getRep(), and name. Referenced by createModifiedInstance(). |
|
Gets a property with the specified name.
Definition at line 172 of file OWBI1_CIMInstance.cpp. References OWBI1::String::c_str(), OWBI1_THROW_ERR, and OWBI1::CIMName::toString(). |
|
Gets a property's value.
Definition at line 183 of file OWBI1_CIMInstance.cpp. References OW_NAMESPACE::CIMNULL, OWBI1::CIMProperty::getValue(), and name. |
|
Definition at line 711 of file OWBI1_CIMInstance.cpp. Referenced by OWBI1::detail::convertCIMInstance(). |
|
Definition at line 699 of file OWBI1_CIMInstance.cpp. References m_rep. |
|
Definition at line 705 of file OWBI1_CIMInstance.cpp. |
|
Assignment operator.
Definition at line 91 of file OWBI1_CIMInstance.cpp. References m_rep. |
|
This compares the properties of the instances, and returns true if they are equal. It will sort the properties before comparing, so the order of the properties is irrelevant.
Definition at line 668 of file OWBI1_CIMInstance.cpp. References getProperties(), and OWBI1::Array< T >::size(). |
|
Test whether a property exists and has a non-NULL value.
Definition at line 194 of file OWBI1_CIMInstance.cpp. References OWBI1::CIMProperty::getValue(), and name. |
|
Read this CIMInstance from an input stream.
Implements OWBI1::SerializableIFC. |
|
Remove a property from this CIMInstance.
Definition at line 362 of file OWBI1_CIMInstance.cpp. References i. Referenced by createModifiedInstance(). |
|
Sets the class name for this instance.
Definition at line 125 of file OWBI1_CIMInstance.cpp. References name. Referenced by OWBI1::CIMClass::newInstance(). |
|
Set the keys for this instance.
Definition at line 98 of file OWBI1_CIMInstance.cpp. References OWBI1::detail::unwrapArray(). |
|
Set the language this CIMClass is using.
Definition at line 119 of file OWBI1_CIMInstance.cpp. References OWBI1::String::c_str(). |
|
Sets the class name for this instance.
Implements OWBI1::CIMElement. Definition at line 518 of file OWBI1_CIMInstance.cpp. References name. |
|
Set this to a null object. All subsequent operation will fail after this call is made. Implements OWBI1::CIMBase. Definition at line 86 of file OWBI1_CIMInstance.cpp. |
|
Set the properties associated with this instance. Note: this will clobber qualifiers associated with the properties which may already exist on the instance. You may want to instead consider updatePropertyValues(), which does not overwrite qualifiers.
Definition at line 141 of file OWBI1_CIMInstance.cpp. References OWBI1::detail::unwrapArray(). Referenced by createModifiedInstance(). |
|
Update a property in the property list if it exists. Otherwise add a new one. In most cases, updatePropertyValue() should be called instead of this function, because it won't add a new property. An instance is initialized will all it's properties by CIMClass::newInstance().
Definition at line 327 of file OWBI1_CIMInstance.cpp. References OWBI1::CIMProperty::getName(), i, and OWBI1::CIMProperty::isKey(). |
|
Update the value of a property if it exists. Otherwise add a new one. In most cases, updatePropertyValue() should be called instead of this function, because it won't add a new property. An instance is initialized will all it's properties by CIMClass::newInstance().
Definition at line 288 of file OWBI1_CIMInstance.cpp. Referenced by createModifiedInstance(). |
|
Synchronize this instance with the given class. This will ensure that all properties found on the class exist on this instance. It will also optionally move all qualifiers from the class to the instance.
Definition at line 410 of file OWBI1_CIMInstance.cpp. References OWBI1::CIMClass::getAllProperties(), OWBI1::CIMClass::getProperty(), i, OWBI1::Array< T >::remove(), OWBI1::Array< T >::size(), and theClass. Referenced by OWBI1::CIMClass::newInstance(). |
|
Implements OWBI1::CIMBase. Definition at line 567 of file OWBI1_CIMInstance.cpp. References i. |
|
Implements OWBI1::CIMElement. Definition at line 633 of file OWBI1_CIMInstance.cpp. References i, and OWBI1::StringBuffer::toString(). |
|
Update a single property value. Does not add prop is it doesn't exist.
Definition at line 281 of file OWBI1_CIMInstance.cpp. References name. |
|
Update a single property value. Does not add prop is it doesn't exist.
Definition at line 246 of file OWBI1_CIMInstance.cpp. References OWBI1::CIMProperty::getName(), OWBI1::CIMProperty::getValue(), i, OWBI1::CIMProperty::isKey(), and name. |
|
Update the property values for this instance. Does not add properties if they don't exist.
Definition at line 235 of file OWBI1_CIMInstance.cpp. References i, and OWBI1::Array< T >::size(). |
|
Write this CIMInstance to an output stream.
Implements OWBI1::SerializableIFC. Definition at line 556 of file OWBI1_CIMInstance.cpp. References OWBI1_CIMINSTANCESIG_V, and OW_NAMESPACE::writeArray(). |
|
Definition at line 663 of file OWBI1_CIMInstance.cpp. |
|
Definition at line 356 of file OWBI1_CIMInstance.hpp. Referenced by clone(), operator safe_bool(), OWBI1::operator<(), and operator=(). |