(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.2 and 1.7

version 1.6.2.2, 2011/10/11 18:18:08 version 1.7, 2011/01/25 11:24:24
Line 39 
Line 39 
 #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/Magic.h>  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD;  
 typedef Array<Sint8> ArraySint8; typedef Array<Sint8> ArraySint8;
 #define PEGASUS_ARRAY_T ArraySint8 #define PEGASUS_ARRAY_T ArraySint8
 # include <Pegasus/Common/ArrayInter.h> # include <Pegasus/Common/ArrayInter.h>
 #undef PEGASUS_ARRAY_T #undef PEGASUS_ARRAY_T
  
   
 class PEGASUS_COMMON_LINKAGE CIMResponseData class PEGASUS_COMMON_LINKAGE CIMResponseData
 { {
 public: public:
Line 70 
Line 70 
     //_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.
     CIMResponseData(ResponseDataContent content):     CIMResponseData(ResponseDataContent content):
         _encoding(0),_mapObjectsToIntances(false),_dataType(content), _size(0),          _encoding(0),_dataType(content),_includeQualifiers(true),
          _includeQualifiers(true),_includeClassOrigin(true),          _includeClassOrigin(true),_propertyList(CIMPropertyList())
         _propertyList(CIMPropertyList())  
     {     {
         PEGASUS_ASSERT(valid()); // KS_TEMP  
     }     }
  
     CIMResponseData(const CIMResponseData & x):     CIMResponseData(const CIMResponseData & x):
         _encoding(x._encoding),         _encoding(x._encoding),
         _mapObjectsToIntances(x._mapObjectsToIntances),  
         _dataType(x._dataType),         _dataType(x._dataType),
         _size(x._size),  
         _referencesData(x._referencesData),         _referencesData(x._referencesData),
         _instanceData(x._instanceData),         _instanceData(x._instanceData),
         _hostsData(x._hostsData),         _hostsData(x._hostsData),
Line 93 
Line 89 
         _instances(x._instances),         _instances(x._instances),
         _objects(x._objects),         _objects(x._objects),
         _scmoInstances(x._scmoInstances),         _scmoInstances(x._scmoInstances),
         _includeQualifiers(x._includeQualifiers),          _includeQualifiers(true),
         _includeClassOrigin(x._includeClassOrigin),          _includeClassOrigin(true),
         _propertyList(x._propertyList),          _propertyList(CIMPropertyList())
         _magic(x._magic)  
     {     {
         /////PEGASUS_ASSERT(x.valid());     // KS_TEMP  
         PEGASUS_ASSERT(valid());            // KS_TEMP  
     }     }
  
     // Construct an empty object.  Issue here in that we would like to  
     // assure that this is invalid but if we add the _dataType parameter  
     // it must be a valid one.  The alternative would be to define an  
     // invalid enum but that would cost us in all case/if statements.  
     // Therefore up to the user to create and then use correctly.  
     // KS_TODO fix this so that the empty state is somehow protected.  
     CIMResponseData():  
         _encoding(0),_mapObjectsToIntances(false), _size(0),  
         _includeQualifiers(true), _includeClassOrigin(true),  
         _propertyList(CIMPropertyList())  
     {}  
   
     /**  
      * Move CIM objects from another CIMResponse data object to this  
      * CIMResponseData object. Moves the number of objects defined  
      * in the count parameter from one to another. They are removed  
      * from the from object and inserted into the to object.  
      *  
      * @param CIMResponseData from which the objects are moved  
      * @param count Uint32 count of objects to move  
      * @return - Actual number of objects moved.  
      */  
     Uint32 moveObjects(CIMResponseData & x, Uint32 count);  
   
     /**  
      * Return count of the number of CIM objects in the  
      * CIMResponseData object  
      * @return Uint32 The count of the number of CIM objects  
      * (instances, paths, or objects)in the CIMResponsedata object  
      */  
     Uint32 size();  
   
     ~CIMResponseData()     ~CIMResponseData()
     {     {
     }     }
  
     // This one may be a hack but we have issue with pull and other operations  
     // in that the other assoc operations return objects and objectPaths  
     // and the pulls return instances and instancePaths). The pull operation  
     // 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  
     // object.  
     Boolean setDataType(ResponseDataContent content)  
     {  
         PEGASUS_ASSERT(valid());  
         PEGASUS_ASSERT(_size == 0);      // KS_TODO_TEMP or debug mode.  
         _dataType = content;  
         return true;  
     }  
   
     // get the datatype property  
     ResponseDataContent getResponseDataContent()  
     {  
         PEGASUS_ASSERT(valid());            // KS_TEMP KS_TODO  
         return _dataType;  
     }  
     // C++ objects interface handling     // C++ objects interface handling
  
     // Instance Names handling     // Instance Names handling
Line 167 
Line 108 
     {     {
         _instanceNames=x;         _instanceNames=x;
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
         _size += x.size();  
     }     }
  
     // Instance handling     // Instance handling
Line 175 
Line 115 
  
     void setInstance(const CIMInstance& x)     void setInstance(const CIMInstance& x)
     {     {
         SVALID();  
         _instances.clear();         _instances.clear();
         _instances.append(x);         _instances.append(x);
         _size++;  
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
   
         SVALID();  
     }     }
  
     // Instances handling     // Instances handling
     Array<CIMInstance>& getInstances();     Array<CIMInstance>& getInstances();
  
     // Get an array of CIMInstances from the CIMResponseData converting from  
     // any of the internal forms to the C++ format.  This will also convert  
     // CIMObjects to CIMInstances if there are any CIMObjects.  
     // NOTE: This is a temporary solution to satisfy the BinaryCodec passing  
     // of data to the client where the data could be either instances or  
     // objects.  The correct solution is to convert back when the provider, etc.  
     // returns the data to the server.  We must convert to that solution but  
     // this keeps the BinaryCodec working for the moment.  
     // Expect that this will be used only in CIMCLient.cpp  
     Array<CIMInstance>& getInstancesFromInstancesOrObjects();  
   
     void setInstances(const Array<CIMInstance>& x)     void setInstances(const Array<CIMInstance>& x)
     {     {
         SVALID();  
         _instances=x;         _instances=x;
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
         _size += x.size();  
         SVALID();  
     }     }
   
     void appendInstance(const CIMInstance& x)     void appendInstance(const CIMInstance& x)
     {     {
         PEGASUS_ASSERT(valid());  
         _instances.append(x);         _instances.append(x);
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
         _size += 1;  
     }  
   
     void appendInstances(const Array<CIMInstance>& x)  
     {  
         PEGASUS_ASSERT(valid());  
         _instances.appendArray(x);  
         _encoding |= RESP_ENC_CIM;  
         _size += x.size();  
     }     }
  
     // Objects handling     // Objects handling
     Array<CIMObject>& getObjects();     Array<CIMObject>& getObjects();
     void setObjects(const Array<CIMObject>& x)     void setObjects(const Array<CIMObject>& x)
     {     {
         PEGASUS_ASSERT(valid());  
         _objects=x;         _objects=x;
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
         _size += x.size();  
     }     }
     void appendObject(const CIMObject& x)     void appendObject(const CIMObject& x)
     {     {
         PEGASUS_ASSERT(valid());  
         _objects.append(x);         _objects.append(x);
         _encoding |= RESP_ENC_CIM;         _encoding |= RESP_ENC_CIM;
         _size += 1;  
     }     }
  
     // SCMO representation, single instance stored as one element array     // SCMO representation, single instance stored as one element array
Line 248 
Line 155 
  
     void appendSCMO(const Array<SCMOInstance>& x)     void appendSCMO(const Array<SCMOInstance>& x)
     {     {
         PEGASUS_ASSERT(valid());  
         _scmoInstances.appendArray(x);         _scmoInstances.appendArray(x);
         _encoding |= RESP_ENC_SCMO;         _encoding |= RESP_ENC_SCMO;
         _size += x.size();  
     }     }
  
     Array<Uint8>& getBinary();     Array<Uint8>& getBinary();
Line 284 
Line 189 
  
     // Encoding responses     // Encoding responses
  
     // Encode the CIMResponse data into binary format used with Provider Agents      // binary format used with Provider Agents and OP Clients
     // and OP Clients in the provider CIMBuffer  
     void encodeBinaryResponse(CIMBuffer& out);     void encodeBinaryResponse(CIMBuffer& out);
       // Xml format used with Provider Agents only
     // Encode the CIMResponse data into Xml format used with Provider Agents  
     //  only in the provided CIMBuffer  
     void encodeInternalXmlResponse(CIMBuffer& out);     void encodeInternalXmlResponse(CIMBuffer& out);
   
     // Encode the CIMResponse data into official Xml format(CIM over Http)  
     // used to communicate to clients in the provided CIMBuffer.  
     //Note that the pull responses requires a flag.  
     void encodeXmlResponse(Buffer& out, Boolean isPull);  
   
     // diagnostic tests magic number in context to see if valid object  
     Boolean valid();  
   
     // 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 310 
Line 203 
         const Boolean includeQualifiers,         const Boolean includeQualifiers,
         const Boolean includeClassOrigin,         const Boolean includeClassOrigin,
         const CIMPropertyList& propertyList);         const CIMPropertyList& propertyList);
       void getRequestProperties(
     void setPropertyList(const CIMPropertyList& propertyList)          Boolean & includeQualifiers,
     {          Boolean & includeClassOrigin,
         _propertyList = propertyList;          CIMPropertyList& propertyList);
     }  
     CIMPropertyList & getPropertyList()  
     {  
         return _propertyList;  
     }  
   
     void SVALID();                   //KS_TEMP  
  
 private: private:
  
Line 349 
Line 235 
     // are currently stored in this CIMResponseData object     // are currently stored in this CIMResponseData object
     Uint32 _encoding;     Uint32 _encoding;
  
     // Special flag to handle the case where binary data in passed through the  
     // system but must be mapped to instances in the getInstances.  This  
     // accounts for only one case today, binary data in the BinaryCodec  
     Boolean _mapObjectsToIntances;  
   
     // Storing type of data in this enumeration     // Storing type of data in this enumeration
     ResponseDataContent _dataType;     ResponseDataContent _dataType;
  
     // Count of objects stored in this CIMResponseData object.  This is the  
     // accumulated count of objects stored in all of the data  
     // representations  
     Uint32 _size;  
   
     // unused arrays are represented by ArrayRepBase _empty_rep     // unused arrays are represented by ArrayRepBase _empty_rep
     // which is a 16 byte large static shared across all of them     // which is a 16 byte large static shared across all of them
     // so, even though this object looks large, it holds just     // so, even though this object looks large, it holds just
Line 373 
Line 249 
     Array<String> _hostsData;     Array<String> _hostsData;
     Array<CIMNamespaceName> _nameSpacesData;     Array<CIMNamespaceName> _nameSpacesData;
  
   
     // For binary encoding.     // For binary encoding.
     Array<Uint8> _binaryData;     Array<Uint8> _binaryData;
     CIMNamespaceName _defaultNamespace;     CIMNamespaceName _defaultNamespace;
Line 389 
Line 266 
     Boolean _includeClassOrigin;     Boolean _includeClassOrigin;
     CIMPropertyList _propertyList;     CIMPropertyList _propertyList;
  
     // magic number to use with valid function to confirm validity  
     // of response data.  
     Magic<0x57D11323> _magic;  
   
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2