version 1.1.2.23, 2009/10/13 09:36:35
|
version 1.1.2.30, 2009/10/27 18:38:08
|
|
|
Uint32& size ) const; | Uint32& size ) const; |
| |
/** | /** |
* Gets the property name, type, and value addressed by a positional index. |
|
* The property name and value has to be copied by the caller ! |
|
* @param pos The positional index of the property |
|
* @param pname Returns the property name as '\0' terminated string. |
|
* Has to be copied by caller. |
|
* It is set to NULL if rc != SCMO_OK. |
|
* @param value Returns an absolute pointer to the value of property. |
|
* Sub-pointers are NOT resolved! |
|
* The value has to be copied by the caller ! |
|
* It returns NULL if rc != SCMO_OK. |
|
* @param valueBase Returns an absolute pointer to the base of value, |
|
* because subsequent pointers in the value are NOT |
|
* resolved. |
|
* @param propDef Returns an absolute pointer to the property definition |
|
* Sub-pointers are NOT resolved! |
|
* It is invalid if rc == SCMO_INDEX_OUT_OF_BOUND. |
|
* |
|
* @return SCMO_OK |
|
* SCMO_NULL_VALUE : The value is a null value. |
|
* SCMO_INDEX_OUT_OF_BOUND : Given index not found |
|
* |
|
*/ |
|
SCMO_RC getPropertyAt( |
|
Uint32 pos, |
|
SCMBValue** value, |
|
const char ** valueBase, |
|
SCMBClassProperty ** propDef) const; |
|
|
|
/** |
|
* Gets the type and value of the named property. | * Gets the type and value of the named property. |
* The value has to be copied by the caller ! | * The value has to be copied by the caller ! |
* @param name The property name | * @param name The property name |
|
|
const SCMBUnion** keyvalue) const; | const SCMBUnion** keyvalue) const; |
| |
/** | /** |
* Determines whether the object has been initialized. |
* Determines whether the c++ object has been initialized. |
* @return True if the object has not been initialized, false otherwise. |
* @return True if the c++ object has not been initialized, false otherwise. |
*/ | */ |
Boolean isUninitialized( ) const {return (0 == inst.base); }; | Boolean isUninitialized( ) const {return (0 == inst.base); }; |
| |
/** | /** |
|
* Determines whether the instance is used as a class container. |
|
* @return True if the instance is used as a class container only. |
|
*/ |
|
Boolean getIsClassOnly( ) const |
|
{ |
|
return inst.hdr->flags.isClassOnly; |
|
} |
|
|
|
/** |
|
* To mark if this instance is a class only container. |
|
*/ |
|
void setIsClassOnly( Boolean b ) |
|
{ |
|
inst.hdr->flags.isClassOnly = b; |
|
} |
|
|
|
/** |
* Determies if two objects are referencing to the same instance | * Determies if two objects are referencing to the same instance |
* @return True if the objects are referencing to the some instance. | * @return True if the objects are referencing to the some instance. |
*/ | */ |
|
|
void setHostName(const char* hostName); | void setHostName(const char* hostName); |
| |
/** | /** |
|
* Sets the provided host name unchecked at the instance. |
|
* @param hostName The host name as UTF8. |
|
* @param len The strlen of the host name. |
|
*/ |
|
void setHostName_l(const char* hostName, Uint32 len); |
|
|
|
/** |
* Get the host name of the instance. The caller has to make a copy ! | * Get the host name of the instance. The caller has to make a copy ! |
* @return The host name as UTF8. | * @return The host name as UTF8. |
*/ | */ |
|
|
| |
/** | /** |
* Get the host name of the instance. | * Get the host name of the instance. |
* @param Return length of result string. |
* @param Return strlen of result string. |
* @return The class name as UTF8. | * @return The class name as UTF8. |
*/ | */ |
const char* getHostName_l(Uint64 & length) const; | const char* getHostName_l(Uint64 & length) const; |
|
|
void setClassName(const char* className); | void setClassName(const char* className); |
| |
/** | /** |
|
* Sets the provided class name at the instance. By caling this function |
|
* the instance is in an inconsitacne state and is maked as isCompromised. |
|
* @param className The class name as UTF8. |
|
* @param len The strlen of the name space. |
|
*/ |
|
void setClassName_l(const char* className, Uint64 len); |
|
|
|
/** |
* Get the class name of the instance. The caller has to make a copy ! | * Get the class name of the instance. The caller has to make a copy ! |
* @return The class name as UTF8. | * @return The class name as UTF8. |
*/ | */ |
|
|
| |
/** | /** |
* Get the class name of the instance. The caller has to make a copy ! | * Get the class name of the instance. The caller has to make a copy ! |
* @param Return length of result string. |
* @param Return strlen of result string. |
* @return The class name as UTF8. | * @return The class name as UTF8. |
*/ | */ |
const char* getClassName_l(Uint64 & length) const; | const char* getClassName_l(Uint64 & length) const; |
|
|
void setNameSpace(const char* nameSpace); | void setNameSpace(const char* nameSpace); |
| |
/** | /** |
|
* Sets the provided name space name unchecked at the instance. |
|
* By caling this function the instance is in an inconsitacne state and |
|
* is maked as isCompromised. |
|
* @param nameSpaceName The name space name as UTF8. |
|
* @param len The strlen of the name space. |
|
*/ |
|
void setNameSpace_l(const char* nameSpace, Uint32 len); |
|
|
|
/** |
* Get the name space of the instance. The caller has to make a copy ! | * Get the name space of the instance. The caller has to make a copy ! |
* @return The name space as UTF8. | * @return The name space as UTF8. |
*/ | */ |
|
|
| |
/** | /** |
* Get the class name of the instance. The caller has to make a copy ! | * Get the class name of the instance. The caller has to make a copy ! |
* @param Return length of result string. |
* @param Return strlen of result string. |
* @return The class name as UTF8. | * @return The class name as UTF8. |
*/ | */ |
const char* getNameSpace_l(Uint64 & length) const; | const char* getNameSpace_l(Uint64 & length) const; |
|
|
| |
void _setCIMInstance(const CIMInstance& cimInstance); | void _setCIMInstance(const CIMInstance& cimInstance); |
| |
|
void _getPropertyAt( |
|
Uint32 pos, |
|
SCMBValue** value, |
|
const char ** valueBase, |
|
SCMBClassProperty ** propDef) const; |
|
|
SCMO_RC _getPropertyAtNodeIndex( | SCMO_RC _getPropertyAtNodeIndex( |
Uint32 pos, | Uint32 pos, |
const char** pname, | const char** pname, |
|
|
friend class SCMOXmlWriter; | friend class SCMOXmlWriter; |
}; | }; |
| |
|
inline void SCMOInstance::_getPropertyAt( |
|
Uint32 pos, |
|
SCMBValue** value, |
|
const char ** valueBase, |
|
SCMBClassProperty ** propDef) const |
|
{ |
|
Uint32 node; |
|
// is filtering on ? |
|
if (inst.hdr->flags.isFiltered) |
|
{ |
|
// Get absolut pointer to property filter index map of the instance |
|
Uint32* propertyFilterIndexMap = |
|
(Uint32*)&(inst.base[inst.hdr->propertyFilterIndexMap.start]); |
|
// get the real node index of the property. |
|
node = propertyFilterIndexMap[pos]; |
|
} |
|
else |
|
{ |
|
// the index is used as node index. |
|
node = pos; |
|
} |
|
|
|
SCMBValue* theInstPropNodeArray = |
|
(SCMBValue*)&(inst.base[inst.hdr->propertyArray.start]); |
|
|
|
// create a pointer to property node array of the class. |
|
Uint64 idx = inst.hdr->theClass->cls.hdr->propertySet.nodeArray.start; |
|
SCMBClassPropertyNode* theClassPropNodeArray = |
|
(SCMBClassPropertyNode*)&(inst.hdr->theClass->cls.base)[idx]; |
|
|
|
// return the absolute pointer to the property definition |
|
*propDef= &(theClassPropNodeArray[node].theProperty); |
|
|
|
// need check if property set or not, if not set use the default value |
|
if (theInstPropNodeArray[node].flags.isSet) |
|
{ |
|
// return the absolute pointer to the property value in the instance |
|
*value = &(theInstPropNodeArray[node]); |
|
*valueBase = inst.base; |
|
} |
|
else |
|
{ |
|
// return the absolute pointer to |
|
*value = &(theClassPropNodeArray[node].theProperty.defaultValue); |
|
*valueBase = inst.hdr->theClass->cls.base; |
|
} |
|
} |
| |
#define PEGASUS_ARRAY_T SCMOInstance | #define PEGASUS_ARRAY_T SCMOInstance |
# include <Pegasus/Common/ArrayInter.h> | # include <Pegasus/Common/ArrayInter.h> |