version 1.1.2.9, 2009/10/14 10:12:39
|
version 1.2.4.5, 2013/06/03 22:35:13
|
|
|
// | // |
////////////////////////////////////////////////////////////////////////// | ////////////////////////////////////////////////////////////////////////// |
// | // |
|
// 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 |
|
// |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_SCMOXmlWriter_h | #ifndef Pegasus_SCMOXmlWriter_h |
|
|
#include <Pegasus/Common/CIMDateTimeInline.h> | #include <Pegasus/Common/CIMDateTimeInline.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
typedef struct propertyFilterNodesArray_s |
|
{ |
|
SCMBClass_Main* classPtrMemBlock; |
|
Array<Uint32> nodes; |
|
}propertyFilterNodesArray_t; |
| |
class PEGASUS_COMMON_LINKAGE SCMOXmlWriter : public XmlWriter | class PEGASUS_COMMON_LINKAGE SCMOXmlWriter : public XmlWriter |
{ | { |
public: | public: |
|
//This function is used to build the propertyFilter node array. |
|
//this node array can be build once per class and reused for all |
|
//instances. |
|
static void buildPropertyFilterNodesArray( |
|
Array<Uint32> & nodes, |
|
const SCMOClass * classPtr, |
|
const CIMPropertyList & propertyList); |
|
|
|
//This function is used to get the propertyFilter node array. |
|
static const Array<Uint32> & getFilteredNodesArray( |
|
Array<propertyFilterNodesArray_t> & propFilterNodesArrays, |
|
const SCMOInstance& scmoInstance, |
|
const CIMPropertyList & propertyList); |
| |
static void appendValueSCMOInstanceElement( | static void appendValueSCMOInstanceElement( |
Buffer& out, | Buffer& out, |
const SCMOInstance& scmoInstance); |
const SCMOInstance& scmoInstance, |
|
bool filtered, |
|
const Array<Uint32> & nodes); |
|
|
|
static void appendValueSCMOInstanceElements( |
|
Buffer& out, |
|
const Array<SCMOInstance> & _scmoInstances, |
|
const CIMPropertyList & propertyList); |
|
|
|
// EXP_PULL_BEGIN |
|
static void appendValueSCMOInstanceWithPathElement( |
|
Buffer& out, |
|
const SCMOInstance& scmoInstance, |
|
bool filtered, |
|
const Array<Uint32> & nodes); |
|
|
|
static void appendValueSCMOInstanceWithPathElements( |
|
Buffer& out, |
|
const Array<SCMOInstance> & _scmoInstances, |
|
const CIMPropertyList & propertyList); |
|
//EXP_PULL_END |
| |
static void appendInstanceNameElement( | static void appendInstanceNameElement( |
Buffer& out, | Buffer& out, |
|
|
| |
static void appendInstanceElement( | static void appendInstanceElement( |
Buffer& out, | Buffer& out, |
const SCMOInstance& scmoInstance); |
const SCMOInstance& scmoInstance, |
|
bool filtered, |
|
const Array<Uint32> & nodes); |
| |
static void appendQualifierElement( | static void appendQualifierElement( |
Buffer& out, | Buffer& out, |
|
|
Buffer& out, | Buffer& out, |
const SCMOInstance& instancePath); | const SCMOInstance& instancePath); |
| |
|
static void appendValueObjectWithPathElement( |
|
Buffer& out, |
|
const Array<SCMOInstance> & objectWithPath, |
|
const CIMPropertyList& propertyList); |
|
|
|
//EXP_PULL_BEGIN |
|
static void appendValueInstanceWithPathElement( |
|
Buffer& out, |
|
const SCMOInstance& namedInstance, |
|
bool filtered, |
|
const Array<Uint32> & nodes); |
|
//EXP_PULL_END |
|
static void appendValueObjectWithPathElement( |
|
Buffer& out, |
|
const SCMOInstance& objectWithPath, |
|
bool filtered = false , |
|
const Array<Uint32> & nodes = Array<Uint32> (0)); |
|
|
|
static void appendObjectElement( |
|
Buffer& out, |
|
const SCMOInstance& object, |
|
bool filtered = false , |
|
const Array<Uint32> & nodes = Array<Uint32> (0)); |
|
|
|
static void appendClassElement( |
|
Buffer& out, |
|
const SCMOInstance& cimClass); |
|
|
static void appendLocalClassPathElement( | static void appendLocalClassPathElement( |
Buffer& out, | Buffer& out, |
const SCMOInstance& classPath); | const SCMOInstance& classPath); |
|
|
static void appendLocalNameSpacePathElement( | static void appendLocalNameSpacePathElement( |
Buffer& out, | Buffer& out, |
const char * nameSpace, | const char * nameSpace, |
Uint64 nameSpaceLength) |
Uint32 nameSpaceLength) |
{ | { |
// add one byte for the closing \0 | // add one byte for the closing \0 |
nameSpaceLength++; | nameSpaceLength++; |
|
|
static void appendNameSpacePathElement( | static void appendNameSpacePathElement( |
Buffer& out, | Buffer& out, |
const char* host, | const char* host, |
Uint64 hostLength, |
Uint32 hostLength, |
const char * nameSpace, | const char * nameSpace, |
Uint64 nameSpaceLength) |
Uint32 nameSpaceLength) |
{ | { |
out << STRLIT("<NAMESPACEPATH>\n""<HOST>"); | out << STRLIT("<NAMESPACEPATH>\n""<HOST>"); |
out.append(host, hostLength); | out.append(host, hostLength); |
|
|
static void appendClassNameElement( | static void appendClassNameElement( |
Buffer& out, | Buffer& out, |
const char* className, | const char* className, |
Uint64 classNameLength) |
Uint32 classNameLength) |
{ | { |
out << STRLIT("<CLASSNAME NAME=\""); | out << STRLIT("<CLASSNAME NAME=\""); |
out.append(className, classNameLength); | out.append(className, classNameLength); |