version 1.4.2.4, 2012/02/21 17:22:10
|
version 1.4.2.10, 2014/03/31 22:46:03
|
|
|
// | // |
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// |
// | // |
|
// This code implements part of PEP#348 - The CMPI infrastructure using SCMO |
|
// (Single Chunk Memory Objects). |
|
// The design document can be found on the OpenPegasus website openpegasus.org |
|
// at https://collaboration.opengroup.org/pegasus/pp/documents/21210/PEP_348.pdf |
|
// |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
|
|
Array<Uint32> emptyNodes; | Array<Uint32> emptyNodes; |
for (Uint32 i = 0, n = _scmoInstances.size(); i < n; i++) | for (Uint32 i = 0, n = _scmoInstances.size(); i < n; i++) |
{ | { |
SCMOXmlWriter::appendValueSCMOInstanceWithPathElement( |
SCMOXmlWriter::appendValueInstanceWithPathElement( |
out, | out, |
_scmoInstances[i], | _scmoInstances[i], |
false, | false, |
|
|
_scmoInstances[i], | _scmoInstances[i], |
propertyList); | propertyList); |
| |
SCMOXmlWriter::appendValueSCMOInstanceWithPathElement( |
SCMOXmlWriter::appendValueInstanceWithPathElement( |
out, | out, |
_scmoInstances[i], | _scmoInstances[i], |
true, | true, |
|
|
const SCMOInstance& scmoInstance, | const SCMOInstance& scmoInstance, |
bool filtered, | bool filtered, |
const Array<Uint32> & nodes) | const Array<Uint32> & nodes) |
|
|
{ | { |
out << STRLIT("<VALUE.NAMEDINSTANCE>\n"); | out << STRLIT("<VALUE.NAMEDINSTANCE>\n"); |
| |
|
|
out << STRLIT("</VALUE.NAMEDINSTANCE>\n"); | out << STRLIT("</VALUE.NAMEDINSTANCE>\n"); |
} | } |
| |
// EXP_PULL_BEGIN |
|
//------------------------------------------------------------------------------ |
|
// |
|
// appendValueInstanceWithPathElement() -- Pull Operation support |
|
// |
|
// <!ELEMENT VALUE.INSTANCEWITHPATH (INSTANCEPATH,INSTANCE)> |
|
// |
|
//------------------------------------------------------------------------------ |
|
|
|
// KS_TODO - Double check to be sure this not duplication |
|
void SCMOXmlWriter::appendValueSCMOInstanceWithPathElement( |
|
Buffer& out, |
|
const SCMOInstance& scmoInstance, |
|
bool filtered, |
|
const Array<Uint32> & nodes) |
|
{ |
|
out << STRLIT("<VALUE.INSTANCEWITHPATH>\n"); |
|
|
|
appendInstancePathElement(out,scmoInstance); |
|
appendInstanceElement(out, scmoInstance, filtered, nodes); |
|
|
|
out << STRLIT("</VALUE.INSTANCEWITHPATH>\n"); |
|
} |
|
//EXP_PULL_END |
|
|
|
void SCMOXmlWriter::appendInstanceNameElement( | void SCMOXmlWriter::appendInstanceNameElement( |
Buffer& out, | Buffer& out, |
const SCMOInstance& scmoInstance) | const SCMOInstance& scmoInstance) |
|
|
if (SCMO_OK == smrc) | if (SCMO_OK == smrc) |
{ | { |
SCMOInstance * ref = kbValue->extRefPtr; | SCMOInstance * ref = kbValue->extRefPtr; |
appendValueReferenceElement(out, *ref, true); |
appendValueReferenceElement(out, *ref); |
} | } |
} | } |
else | else |
|
|
SCMOInstance * ref = value.value.extRefPtr; | SCMOInstance * ref = value.value.extRefPtr; |
if (ref) | if (ref) |
{ | { |
appendValueReferenceElement(out, *ref, true); |
appendValueReferenceElement(out, *ref); |
} | } |
} | } |
else | else |
|
|
//------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ |
void SCMOXmlWriter::appendValueReferenceElement( | void SCMOXmlWriter::appendValueReferenceElement( |
Buffer& out, | Buffer& out, |
const SCMOInstance& ref, |
const SCMOInstance& ref) |
Boolean putValueWrapper) |
|
{ |
|
if (putValueWrapper) |
|
{ | { |
out << STRLIT("<VALUE.REFERENCE>\n"); | out << STRLIT("<VALUE.REFERENCE>\n"); |
|
|
|
appendClassOrInstancePathElement(out, ref); |
|
|
|
out << STRLIT("</VALUE.REFERENCE>\n"); |
} | } |
| |
|
// Append either a class or instance Path Element |
|
void SCMOXmlWriter::appendClassOrInstancePathElement( |
|
Buffer& out, |
|
const SCMOInstance& ref) |
|
{ |
// See if it is a class or instance reference (instance references have | // See if it is a class or instance reference (instance references have |
// key-bindings; class references do not). | // key-bindings; class references do not). |
| |
|
|
appendInstanceNameElement(out, ref); | appendInstanceNameElement(out, ref); |
} | } |
} | } |
if (putValueWrapper) |
|
{ |
|
out << STRLIT("</VALUE.REFERENCE>\n"); |
|
} |
|
} | } |
| |
// appendLocalInstancePathElement() | // appendLocalInstancePathElement() |
|
|
out << STRLIT("</LOCALINSTANCEPATH>\n"); | out << STRLIT("</LOCALINSTANCEPATH>\n"); |
} | } |
| |
// EXP_PULL_BEGIN ???? |
|
// appendInstancePathElement() | // appendInstancePathElement() |
// <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)> | // <!ELEMENT INSTANCEPATH (NAMESPACEPATH,INSTANCENAME)> |
void SCMOXmlWriter::appendInstancePathElement( | void SCMOXmlWriter::appendInstancePathElement( |
|
|
appendInstanceNameElement(out, instancePath); | appendInstanceNameElement(out, instancePath); |
out << STRLIT("</INSTANCEPATH>\n"); | out << STRLIT("</INSTANCEPATH>\n"); |
} | } |
//EXP_PULL_END??? |
|
| |
void SCMOXmlWriter::appendValueObjectWithPathElement( | void SCMOXmlWriter::appendValueObjectWithPathElement( |
Buffer& out, | Buffer& out, |
|
|
{ | { |
out << STRLIT("<VALUE.OBJECTWITHPATH>\n"); | out << STRLIT("<VALUE.OBJECTWITHPATH>\n"); |
| |
appendValueReferenceElement(out, objectWithPath, false); |
appendClassOrInstancePathElement(out, objectWithPath); |
appendObjectElement(out, objectWithPath,filtered,nodes); | appendObjectElement(out, objectWithPath,filtered,nodes); |
| |
out << STRLIT("</VALUE.OBJECTWITHPATH>\n"); | out << STRLIT("</VALUE.OBJECTWITHPATH>\n"); |
|
|
SCMOInstance * ref = arr->extRefPtr; | SCMOInstance * ref = arr->extRefPtr; |
if (ref) | if (ref) |
{ | { |
appendValueReferenceElement(out, *ref, true); |
appendValueReferenceElement(out, *ref); |
} | } |
arr++; | arr++; |
} | } |