(file) Return to CIMResponseData.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMResponseData.h between version 1.6.2.3 and 1.6.2.7

version 1.6.2.3, 2012/02/15 17:47:06 version 1.6.2.7, 2013/09/14 23:08:17
Line 27 
Line 27 
 // //
 ////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
 // //
   // Class CIMResponseData encapsulates the possible types of response data
   // representations and supplies conversion methods between these types.
   // PEP#348 - The CMPI infrastructure using SCMO (Single Chunk Memory Objects)
   // describes its usage in the server flow.
   // 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_CIMResponseData_h #ifndef Pegasus_CIMResponseData_h
Line 39 
Line 46 
 #include <Pegasus/Common/SCMOClass.h> #include <Pegasus/Common/SCMOClass.h>
 #include <Pegasus/Common/SCMOInstance.h> #include <Pegasus/Common/SCMOInstance.h>
 #include <Pegasus/Common/SCMODump.h> #include <Pegasus/Common/SCMODump.h>
   #include <Pegasus/Common/Mutex.h>           // KS_TODO  Remove
 #include <Pegasus/Common/Magic.h> #include <Pegasus/Common/Magic.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 55 
Line 63 
 # include <Pegasus/Common/ArrayInter.h> # include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T
  
 // KS_TODO _Temp test for size validity DELETE when done  //// KS_TODO REMOVE THIS _Temp test for size validity DELETE when done
 #define PSVALID PEGASUS_ASSERT(sizeValid())  #define PSVALID PEGASUS_ASSERT(sizeValid());
   /*
   #define PSVALID {printf("PSVALID Error line %u\n",__LINE__); \
    PEGASUS_ASSERT(sizeValid());}
   #define PSVALID {if(!sizeValid(){printf("PSVALID Error line %u\n",__LINE__);
   PEGASUS_ASSERT(false);}}
   */
 class PEGASUS_COMMON_LINKAGE CIMResponseData class PEGASUS_COMMON_LINKAGE CIMResponseData
 { {
 public: public:
Line 78 
Line 91 
     };     };
     //includeClassOrigin & _includeQualifiers are set to true by default.     //includeClassOrigin & _includeQualifiers are set to true by default.
     //_propertyList is initialized to an empty propertylist to enable     //_propertyList is initialized to an empty propertylist to enable
     // sending all properties by default.      // sending all properties by default. _isClassOperation set false and
       // only reset by selected operations (ex. associator response builder)
     CIMResponseData(ResponseDataContent content):     CIMResponseData(ResponseDataContent content):
         _encoding(0),_dataType(content), _size(0),_includeQualifiers(true),         _encoding(0),_dataType(content), _size(0),_includeQualifiers(true),
         _includeClassOrigin(true),_propertyList(CIMPropertyList())          _includeClassOrigin(true),
           _isClassOperation(false),
           _propertyList(CIMPropertyList())
     {     {
           /// KS_TODO the following is all test code.
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid()); // KS_TEMP          PEGASUS_ASSERT(valid()); // KS_TEMP KS_TODO DELETE THIS
           size();
     }     }
  
     CIMResponseData(const CIMResponseData & x):     CIMResponseData(const CIMResponseData & x):
Line 105 
Line 123 
         _scmoInstances(x._scmoInstances),         _scmoInstances(x._scmoInstances),
         _includeQualifiers(x._includeQualifiers),         _includeQualifiers(x._includeQualifiers),
         _includeClassOrigin(x._includeClassOrigin),         _includeClassOrigin(x._includeClassOrigin),
           _isClassOperation(x._isClassOperation),
         _propertyList(x._propertyList),         _propertyList(x._propertyList),
         _magic(x._magic)         _magic(x._magic)
     {     {
         TRACELINE;         TRACELINE;
         /////PEGASUS_ASSERT(x.valid());     // KS_TEMP  
         PEGASUS_ASSERT(valid());            // KS_TEMP         PEGASUS_ASSERT(valid());            // KS_TEMP
           size();
     }     }
  
     // Construct an empty object.  Issue here in that we would like to     // Construct an empty object.  Issue here in that we would like to
Line 125 
Line 144 
         _propertyList(CIMPropertyList())         _propertyList(CIMPropertyList())
     {     {
         TRACELINE;         TRACELINE;
           size();   //// TODO remove temp
     }     }
  
     /**     /**
Line 151 
Line 171 
     {     {
     }     }
  
     // This one may be a hack but we have issue with pull and other operations      // Issue with pull and other operations
     // in that the other assoc operations return objects and objectPaths     // in that the other assoc operations return objects and objectPaths
     // and the pulls return instances and instancePaths). The pull operation      // and the pulls return instances and instancePaths. The pull operation
     // must be able to handle either so we use this to reset the datatype     // must be able to handle either so we use this to reset the datatype
     // KS_TODO -- This should check size and only allow if nothing in the     // KS_TODO -- This should check size and only allow if nothing in the
     // object.     // object.
Line 180 
Line 200 
  
     void setInstanceNames(const Array<CIMObjectPath>& x)     void setInstanceNames(const Array<CIMObjectPath>& x)
     {     {
          ////  AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         _instanceNames=x;         _instanceNames=x;
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
Line 191 
Line 212 
  
     void setInstance(const CIMInstance& x)     void setInstance(const CIMInstance& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PSVALID;         PSVALID;
         _instances.clear();         _instances.clear();
Line 217 
Line 239 
  
     void setInstances(const Array<CIMInstance>& x)     void setInstances(const Array<CIMInstance>& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PSVALID;         PSVALID;
         _instances=x;         _instances=x;
Line 227 
Line 250 
  
     void appendInstance(const CIMInstance& x)     void appendInstance(const CIMInstance& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid());         PEGASUS_ASSERT(valid());
         _instances.append(x);         _instances.append(x);
Line 236 
Line 260 
  
     void appendInstances(const Array<CIMInstance>& x)     void appendInstances(const Array<CIMInstance>& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid());         PEGASUS_ASSERT(valid());
         _instances.appendArray(x);         _instances.appendArray(x);
Line 247 
Line 272 
     Array<CIMObject>& getObjects();     Array<CIMObject>& getObjects();
     void setObjects(const Array<CIMObject>& x)     void setObjects(const Array<CIMObject>& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid());         PEGASUS_ASSERT(valid());
         _objects=x;         _objects=x;
Line 255 
Line 281 
     }     }
     void appendObject(const CIMObject& x)     void appendObject(const CIMObject& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid());         PEGASUS_ASSERT(valid());
         _objects.append(x);         _objects.append(x);
Line 270 
Line 297 
  
     void appendSCMO(const Array<SCMOInstance>& x)     void appendSCMO(const Array<SCMOInstance>& x)
     {     {
           //// AutoMutex autoMut(testLock);
         TRACELINE;         TRACELINE;
         PEGASUS_ASSERT(valid());         PEGASUS_ASSERT(valid());
         _scmoInstances.appendArray(x);         _scmoInstances.appendArray(x);
Line 321 
Line 349 
     void encodeXmlResponse(Buffer& out, Boolean isPull);     void encodeXmlResponse(Buffer& out, Boolean isPull);
  
     // diagnostic tests magic number in context to see if valid object     // diagnostic tests magic number in context to see if valid object
     Boolean valid();      Boolean valid() const;
  
     // official Xml format(CIM over Http) used to communicate to clients     // official Xml format(CIM over Http) used to communicate to clients
     void encodeXmlResponse(Buffer& out);     void encodeXmlResponse(Buffer& out);
Line 334 
Line 362 
         const Boolean includeClassOrigin,         const Boolean includeClassOrigin,
         const CIMPropertyList& propertyList);         const CIMPropertyList& propertyList);
  
       // Used with association and reference operations (i.e. operations that
       // return CIMObject or CIMObjectPath to set a parameter to define whether
       // responseData is for operation on a class or instance.
       // Allows building the correct path (classPath or instancePath) and
       // object type (Class or Instance) on response.
       void setIsClassOperation(Boolean b);
   
     void setPropertyList(const CIMPropertyList& propertyList)     void setPropertyList(const CIMPropertyList& propertyList)
     {     {
         TRACELINE;         TRACELINE;
Line 345 
Line 380 
         return _propertyList;         return _propertyList;
     }     }
  
     bool sizeValid();                   //KS_TEMP      bool sizeValid();                   //KS_TEMP KS_TODO REMOVE
  
 private: private:
  
Line 369 
Line 404 
     SCMOInstance _getSCMOFromCIMObject(const CIMObject& cimObj);     SCMOInstance _getSCMOFromCIMObject(const CIMObject& cimObj);
     SCMOInstance _getSCMOFromCIMObjectPath(const CIMObjectPath& cimPath);     SCMOInstance _getSCMOFromCIMObjectPath(const CIMObjectPath& cimPath);
     SCMOClass* _getSCMOClass(const char* ns,const char* cls);     SCMOClass* _getSCMOClass(const char* ns,const char* cls);
       void _deserializeInstance(Uint32 idx,CIMInstance& cimInstance);
       void _deserializeObject(Uint32 idx,CIMObject& cimObject);
       Boolean _deserializeReference(Uint32 idx,CIMObjectPath& cimObjectPath);
       Boolean _deserializeInstanceName(Uint32 idx,CIMObjectPath& cimObjectPath);
  
     // Bitflags in this integer will reflect what data representation types     // Bitflags in this integer will reflect what data representation types
     // are currently stored in this CIMResponseData object     // are currently stored in this CIMResponseData object
Line 410 
Line 449 
  
     // SCMO encoding     // SCMO encoding
     Array<SCMOInstance> _scmoInstances;     Array<SCMOInstance> _scmoInstances;
   
       // Request characteristics that are carried through operation for
       // modification of response generation.
     Boolean _includeQualifiers;     Boolean _includeQualifiers;
     Boolean _includeClassOrigin;     Boolean _includeClassOrigin;
       // Defines whether response CIMObjects or ObjectPaths are class or instance.
       // because associators, etc. operations provide both class and instance
       // responses. Default is false and should only be set to true by
       // operation requests such as associators (which could return either
       // instances or classes) when the operation is to return class information.
       Boolean _isClassOperation;
     CIMPropertyList _propertyList;     CIMPropertyList _propertyList;
  
       Mutex testLock;
   
     // magic number to use with valid function to confirm validity     // magic number to use with valid function to confirm validity
     // of response data.     // of response data.
     Magic<0x57D11323> _magic;     Magic<0x57D11323> _magic;


Legend:
Removed from v.1.6.2.3  
changed lines
  Added in v.1.6.2.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2