#include <OW_CIMInstance.hpp>
Inheritance diagram for OW_NAMESPACE::CIMInstance:
Public Types | |
typedef COWIntrusiveReference< INSTData > CIMInstance::* | safe_bool |
enum | { SERIALIZATION_VERSION = 2 } |
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 () | |
Destroy this CIMInstance object. | |
virtual void | setNull () |
Set this to a null object. | |
CIMInstance & | operator= (const CIMInstance &arg) |
Assignment operator. | |
String | 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 |
CIMInstance & | setLanguage (const String &language) |
Set the language this CIMClass is using. | |
CIMQualifierArray | getQualifiers () const |
CIMQualifier | getQualifier (const CIMName &qualName) const |
Get the qualifier associated with the given name. | |
CIMInstance & | removeQualifier (const CIMName &qualName) |
Remove the named qualifier from this CIMInstance. | |
CIMInstance & | setQualifiers (const CIMQualifierArray &quals) |
Set the qualifiers for this instance. | |
CIMInstance & | setQualifier (const CIMQualifier &qual) |
Set/Add a qualifier to this instance's qualifier list. | |
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 | filterProperties (const StringArray &propertyList, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, bool ignorePropertyList=false) const |
Create an CIMInstance with properties and qualifiers from this instance based on filtering criteria. | |
CIMInstance | clone (WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray &propertyList=StringArray(), bool noProps=false) const |
Create a new CIMInstance from this CIMInstance using the specified criteria. | |
CIMInstance | clone (WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray *propertyList) const |
Create a new CIMInstance from this CIMInstance using the specified criteria. | |
CIMInstance | clone (WBEMFlags::ELocalOnlyFlag localOnly, WBEMFlags::EDeepFlag deep, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, WBEMFlags::EIncludeClassOriginFlag includeClassOrigin, const StringArray *propertyList, const CIMClass &requestedClass, const CIMClass &cimClass) const |
Create a new CIMInstance from this CIMInstance using the specified criteria. | |
CIMInstance & | syncWithClass (const CIMClass &cc, WBEMFlags::EIncludeQualifiersFlag includeQualifiers=WBEMFlags::E_INCLUDE_QUALIFIERS) |
Synchronize this instance with the given class. | |
CIMInstance | createModifiedInstance (const CIMInstance &previousInstance, WBEMFlags::EIncludeQualifiersFlag includeQualifiers, const StringArray *propertyList, const CIMClass &theClass) const |
Create an instance with the set of changes that will occur for a modifyInstance call. | |
virtual String | getName () const |
virtual void | setName (const CIMName &name) |
Sets the class name for this instance. | |
CIMInstance & | setNameSpace (const String &ns) |
Set the namespace on this instance. | |
String | getNameSpace () const |
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 |
Protected Member Functions | |
void | _buildKeys () |
Protected Attributes | |
COWIntrusiveReference< INSTData > | m_pdata |
Friends | |
OW_COMMON_API bool | operator< (const CIMInstance &x, const CIMInstance &y) |
Classes | |
struct | INSTData |
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 82 of file OW_CIMInstance.hpp.
|
Definition at line 474 of file OW_CIMInstance.hpp. |
|
Definition at line 87 of file OW_CIMInstance.hpp. |
|
Reimplemented from OW_NAMESPACE::CIMBase. Definition at line 89 of file OW_CIMInstance.hpp. |
|
Default ctor.
Definition at line 78 of file OW_CIMInstance.cpp. |
|
This CIMInstance object will be NULL. All subsequent operations on an instance of this type will fail. Definition at line 83 of file OW_CIMInstance.cpp. |
|
Copy ctor.
Definition at line 100 of file OW_CIMInstance.cpp. |
|
Create an CIMInstance.
Definition at line 94 of file OW_CIMInstance.cpp. |
|
Create an CIMInstance.
Definition at line 88 of file OW_CIMInstance.cpp. References m_pdata. |
|
Destroy this CIMInstance object.
Definition at line 105 of file OW_CIMInstance.cpp. |
|
Definition at line 330 of file OW_CIMInstance.cpp. References i. |
|
Create a new CIMInstance from this CIMInstance using the specified criteria. This is useful for implementing enumInstances correctly for the localOnly and deep parameters.
Definition at line 584 of file OW_CIMInstance.cpp. References cimClass, clone(), OW_NAMESPACE::WBEMFlags::E_DEEP, OW_NAMESPACE::WBEMFlags::E_INCLUDE_QUALIFIERS, OW_NAMESPACE::WBEMFlags::E_NOT_LOCAL_ONLY, OW_NAMESPACE::CIMClass::getName(), OW_NAMESPACE::CIMProperty::getOriginClass(), getProperties(), OW_NAMESPACE::CIMClass::getProperty(), i, propertyList, OW_NAMESPACE::Array< T >::push_back(), requestedClass, OW_NAMESPACE::Array< T >::size(), and syncWithClass(). |
|
Create a new CIMInstance from this CIMInstance using the specified criteria.
Definition at line 499 of file OW_CIMInstance.cpp. References propertyList, and OW_NAMESPACE::Array< T >::size(). |
|
|
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 767 of file OW_CIMInstance.cpp. References getProperties(), OW_NAMESPACE::CIMClass::getProperty(), getProperty(), OW_NAMESPACE::CIMProperty::getQualifiers(), getQualifiers(), i, propertyList, removeProperty(), setProperties(), setProperty(), OW_NAMESPACE::CIMProperty::setQualifiers(), setQualifiers(), and theClass. Referenced by OW_NAMESPACE::PerlInstanceProviderProxy::modifyInstance(), OW_NAMESPACE::NPIInstanceProviderProxy::modifyInstance(), and OW_NAMESPACE::InstanceRepository::modifyInstance(). |
|
Create an CIMInstance with properties and qualifiers from this instance based on filtering criteria. All properties and qualifiers that designate keys will be retained.
Definition at line 640 of file OW_CIMInstance.cpp. References OW_NAMESPACE::WBEMFlags::E_NOT_LOCAL_ONLY, propertyList, and OW_NAMESPACE::Array< T >::size(). |
|
Definition at line 129 of file OW_CIMInstance.cpp. References OW_NAMESPACE::String::toString(). Referenced by OW_NAMESPACE::IndicationServerImplThread::_processIndication(), OW_NAMESPACE::AssocDb2::addOrDeleteEntries(), OW_NAMESPACE::AssocDbHandle::addOrDeleteEntries(), OW_NAMESPACE::CIMInstancetoXML(), OW_NAMESPACE::CIMObjectPath::CIMObjectPath(), OW_NAMESPACE::ProviderAgentCIMOMHandle::createInstance(), OW_NAMESPACE::InstanceRepository::createInstance(), OW_NAMESPACE::CIMServer::createInstance(), OW_NAMESPACE::CIMRepository::createInstance(), OW_NAMESPACE::BinaryRequestHandler::createInstance(), OW_NAMESPACE::WQLFilterRep::enumInstances(), OW_NAMESPACE::WQLInstancePropertySource::evaluateISAAux(), OW_NAMESPACE::CppIndicationExportXMLHTTPProvider::exportIndication(), OW_NAMESPACE::WQLProcessor::instanceIsDerivedFrom(), OW_NAMESPACE::ProviderAgentCIMOMHandle::modifyInstance(), and OW_NAMESPACE::CIMServer::modifyInstance(). |
|
Definition at line 345 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::CIMObjectPath::CIMObjectPath(), OW_NAMESPACE::InstanceRepository::modifyInstance(), OW_NAMESPACE::CIMServer::modifyInstance(), and OW_NAMESPACE::CIMObjectPath::setKeys(). |
|
Definition at line 149 of file OW_CIMInstance.cpp. |
|
Implements OW_NAMESPACE::CIMElement. Definition at line 650 of file OW_CIMInstance.cpp. |
|
Definition at line 142 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::CIM_NamespaceInManagerInstProv::getInstance(), and OW_NAMESPACE::BinaryRequestHandler::getInstance(). |
|
Get all the properties of a specific datatype from this instance.
Definition at line 229 of file OW_CIMInstance.cpp. References OW_NAMESPACE::Array< T >::append(), and i. Referenced by OW_NAMESPACE::AssocDb2::addOrDeleteEntries(), OW_NAMESPACE::AssocDbHandle::addOrDeleteEntries(), clone(), OW_NAMESPACE::CIMRepository::createInstance(), createModifiedInstance(), propertiesAreEqualTo(), and OW_NAMESPACE::WQLProcessor::visit_insertRest_VALUES_LEFTPAREN_targetList_RIGHTPAREN(). |
|
Gets a property with the specified name.
Definition at line 273 of file OW_CIMInstance.cpp. References i. |
|
Get the property identified by a given name and origin class.
Definition at line 256 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::IndicationServerImplThread::_processIndication(), OW_NAMESPACE::NameSpaceProvider::createInstance(), OW_NAMESPACE::BinaryRequestHandler::createInstance(), createModifiedInstance(), OW_NAMESPACE::IndicationServerImplThread::createSubscription(), and OW_NAMESPACE::CppIndicationExportXMLHTTPProvider::exportIndication(). |
|
Gets a property with the specified name.
Definition at line 288 of file OW_CIMInstance.cpp. References OW_NAMESPACE::String::c_str(), OW_THROW_ERR, and OW_NAMESPACE::CIMName::toString(). Referenced by OW_NAMESPACE::CIM_NamespaceInstProv::createInstance(), OW_NAMESPACE::getSourceNameSpace(), and OW_NAMESPACE::CIMServer::modifyInstance(). |
|
Gets a property's value.
Definition at line 299 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMNULL, OW_NAMESPACE::CIMProperty::getValue(), and name. |
|
Get the qualifier associated with the given name.
Definition at line 175 of file OW_CIMInstance.cpp. References i. |
|
Definition at line 169 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::InstanceRepository2::_removeDuplicatedQualifiers(), OW_NAMESPACE::InstanceRepository::_removeDuplicatedQualifiers(), and createModifiedInstance(). |
|
Definition at line 475 of file OW_CIMInstance.hpp. References m_pdata. |
|
Definition at line 477 of file OW_CIMInstance.hpp. |
|
Assignment operator.
Definition at line 115 of file OW_CIMInstance.cpp. References m_pdata. |
|
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 973 of file OW_CIMInstance.cpp. References getProperties(), and OW_NAMESPACE::Array< T >::size(). |
|
Test whether a property exists and has a non-NULL value.
Definition at line 310 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMProperty::getValue(), and name. |
|
Read this CIMInstance from an input stream.
Implements OW_NAMESPACE::SerializableIFC. |
|
Remove a property from this CIMInstance.
Definition at line 478 of file OW_CIMInstance.cpp. References i. Referenced by createModifiedInstance(). |
|
Remove the named qualifier from this CIMInstance.
Definition at line 189 of file OW_CIMInstance.cpp. References i. |
|
Sets the class name for this instance.
Definition at line 162 of file OW_CIMInstance.cpp. References name. Referenced by OW_NAMESPACE::PerlInstanceProviderProxy::enumInstances(), OW_NAMESPACE::NPIInstanceProviderProxy::enumInstances(), OW_NAMESPACE::PerlInstanceProviderProxy::getInstance(), OW_NAMESPACE::NPIInstanceProviderProxy::getInstance(), OW_NAMESPACE::IndicationRepLayerImpl::invokeMethod(), OW_NAMESPACE::CIMClass::newInstance(), and OW_NAMESPACE::LifecycleIndicationPoller::poll(). |
|
Set the keys for this instance.
Definition at line 122 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::CIMServer::modifyInstance(). |
|
Set the language this CIMClass is using.
Definition at line 155 of file OW_CIMInstance.cpp. |
|
Sets the class name for this instance.
Implements OW_NAMESPACE::CIMElement. Definition at line 815 of file OW_CIMInstance.cpp. References name. |
|
Set the namespace on this instance. This allows providers to provide additional namespace information about an instance when the instance returned comes from a namespace that is different from the namespace specified on the client's request. Typically used in an associators call.
Definition at line 135 of file OW_CIMInstance.cpp. References ns. Referenced by OW_NAMESPACE::BinaryRequestHandler::getInstance(). |
|
Set this to a null object. All subsequent operation will fail after this call is made. Implements OW_NAMESPACE::CIMBase. Definition at line 110 of file OW_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 248 of file OW_CIMInstance.cpp. Referenced by createModifiedInstance(), and OW_NAMESPACE::CIMServer::modifyInstance(). |
|
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 443 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMProperty::getName(), i, and OW_NAMESPACE::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 404 of file OW_CIMInstance.cpp. Referenced by OW_NAMESPACE::CIMNameSpaceUtils::create__Namespace(), OW_NAMESPACE::BinaryRequestHandler::createInstance(), createModifiedInstance(), OW_NAMESPACE::OpenWBEM_ConfigSettingDataInstProv::doReferences(), OW_NAMESPACE::OpenWBEM_UnitaryComputerSystem::doSimpleEnumInstances(), OW_NAMESPACE::IndicationRepLayerImpl::invokeMethod(), and OW_NAMESPACE::LifecycleIndicationPoller::poll(). |
|
Set/Add a qualifier to this instance's qualifier list.
Definition at line 203 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMQualifier::getName(), and i. Referenced by OW_NAMESPACE::MOF::CIMOMVisitor::VisitInstanceDeclaration(). |
|
Set the qualifiers for this instance. Any old qualifiers will removed.
Definition at line 222 of file OW_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 656 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMClass::getAllProperties(), OW_NAMESPACE::CIMClass::getProperty(), i, OW_NAMESPACE::Array< T >::remove(), OW_NAMESPACE::Array< T >::size(), and theClass. Referenced by clone(), OW_NAMESPACE::CIMServer::modifyInstance(), and OW_NAMESPACE::CIMClass::newInstance(). |
|
Implements OW_NAMESPACE::CIMBase. Definition at line 872 of file OW_CIMInstance.cpp. References i. Referenced by OW_NAMESPACE::IndicationServerImplThread::addTrans(), OW_NAMESPACE::CIMRepository2::createInstance(), and OW_NAMESPACE::CIMRepository::createInstance(). |
|
Reimplemented from OW_NAMESPACE::CIMElement. Definition at line 938 of file OW_CIMInstance.cpp. References i, and OW_NAMESPACE::StringBuffer::toString(). Referenced by OW_NAMESPACE::IndicationServerImplThread::_processIndication(), OW_NAMESPACE::CIMInstanceSortCriterion(), OW_NAMESPACE::IndicationServerImplThread::createSubscription(), OW_NAMESPACE::CppIndicationExportXMLHTTPProvider::exportIndication(), and OW_NAMESPACE::WQLProcessor::visit_aExpr_aExpr_ISA_aExpr(). |
|
Update a single property value. Does not add prop is it doesn't exist.
Definition at line 397 of file OW_CIMInstance.cpp. References name. |
|
Update a single property value. Does not add prop is it doesn't exist.
Definition at line 362 of file OW_CIMInstance.cpp. References OW_NAMESPACE::CIMProperty::getName(), OW_NAMESPACE::CIMProperty::getValue(), i, OW_NAMESPACE::CIMProperty::isKey(), and name. |
|
Update the property values for this instance. Does not add properties if they don't exist.
Definition at line 351 of file OW_CIMInstance.cpp. References i, and OW_NAMESPACE::Array< T >::size(). Referenced by OW_NAMESPACE::OpenWBEM_ConfigSettingDataInstProv::getInstance(). |
|
Write this CIMInstance to an output stream.
Implements OW_NAMESPACE::SerializableIFC. Definition at line 859 of file OW_CIMInstance.cpp. References OW_CIMINSTANCESIG_V, and OW_NAMESPACE::writeArray(). Referenced by OW_NAMESPACE::InstanceRepository::createInstance(). |
|
Definition at line 968 of file OW_CIMInstance.cpp. |
|
Definition at line 488 of file OW_CIMInstance.hpp. Referenced by CIMInstance(), clone(), operator safe_bool(), OW_NAMESPACE::operator<(), and operator=(). |