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

Diff for /pegasus/src/Pegasus/Common/BinaryCodec.cpp between version 1.8 and 1.9

version 1.8, 2009/06/30 10:31:30 version 1.9, 2009/07/08 13:48:26
Line 94 
Line 94 
     OP_Count     OP_Count
 }; };
  
 struct CIMBufferReleaser  
 {  
     CIMBufferReleaser(CIMBuffer& buf) : _buf(buf)  
     {  
     }  
   
     ~CIMBufferReleaser()  
     {  
         _buf.release();  
     }  
   
 private:  
     CIMBuffer& _buf;  
 };  
   
 static Operation _NameToOp(const CIMName& name) static Operation _NameToOp(const CIMName& name)
 { {
     const String& s = name.getString();     const String& s = name.getString();
Line 372 
Line 357 
     Uint32 flags,     Uint32 flags,
     const String& messageId)     const String& messageId)
 { {
     /* See ../Client/CIMOperationResponseDecoder.cpp */  
   
     Array<CIMInstance> instances;  
   
     while (in.more())  
     {  
         Array<CIMInstance> tmp;  
   
         if (!in.getInstanceA(tmp))  
             return 0;  
   
         instances.append(tmp.getData(), tmp.size());  
     }  
   
     CIMEnumerateInstancesResponseMessage* msg;     CIMEnumerateInstancesResponseMessage* msg;
     CIMException cimException;     CIMException cimException;
  
Line 394 
Line 365 
         cimException,         cimException,
         QueueIdStack());         QueueIdStack());
  
     msg->getResponseData().setNamedInstances(instances);      // Instead of resolving the binary data right here, we delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to getNamedInstances, which is going to resolve the binary
       // data when the callback function is registered.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMInstancesResponseData& responseData = msg->getResponseData();
       responseData.setBinaryCimInstances(in,false);
   
     msg->binaryRequest = true;     msg->binaryRequest = true;
     return msg;     return msg;
 } }
Line 565 
Line 545 
     Uint32 flags,     Uint32 flags,
     const String& messageId)     const String& messageId)
 { {
     CIMInstance instance;  
   
     if (!in.getInstance(instance))  
         return 0;  
   
     CIMGetInstanceResponseMessage* msg;     CIMGetInstanceResponseMessage* msg;
     CIMException cimException;     CIMException cimException;
  
Line 578 
Line 553 
         cimException,         cimException,
         QueueIdStack());         QueueIdStack());
  
     msg->getResponseData().setCimInstance(instance);      // Instead of resolving the binary data right here, we delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to getNamedInstances, which is going to resolve the binary
       // data when the callback function is registered.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMInstanceResponseData& responseData = msg->getResponseData();
       responseData.setBinaryCimInstance(in,false);
   
     msg->binaryRequest = true;     msg->binaryRequest = true;
     return msg;     return msg;
 } }
Line 1089 
Line 1073 
     Uint32 flags,     Uint32 flags,
     const String& messageId)     const String& messageId)
 { {
     /* See ../Client/CIMOperationResponseDecoder.cpp */  
   
     Array<CIMObject> cimObjects;  
   
     while (in.more())  
     {  
         Array<CIMObject> tmp;  
   
         if (!in.getObjectA(tmp))  
             return 0;  
   
         cimObjects.append(tmp.getData(), tmp.size());  
     }  
   
     CIMAssociatorsResponseMessage* msg;     CIMAssociatorsResponseMessage* msg;
     CIMException cimException;     CIMException cimException;
  
Line 1111 
Line 1081 
         cimException,         cimException,
         QueueIdStack());         QueueIdStack());
  
     msg->getResponseData().setCIMObjects(cimObjects);      // Instead of resolving the binary data right here, we delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to getNamedInstances, which is going to resolve the binary
       // data when the callback function is registered.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMObjectsResponseData& responseData = msg->getResponseData();
       responseData.setBinaryCimObjects(in,false);
   
     msg->binaryRequest = true;     msg->binaryRequest = true;
     return msg;     return msg;
 } }
Line 3100 
Line 3079 
     Uint32 flags,     Uint32 flags,
     const String& messageId)     const String& messageId)
 { {
     /* See ../Client/CIMOperationResponseDecoder.cpp */  
   
     Array<CIMObject> cimObjects;  
   
     while (in.more())  
     {  
         Array<CIMObject> tmp;  
   
         if (!in.getObjectA(tmp))  
             return 0;  
   
         cimObjects.append(tmp.getData(), tmp.size());  
     }  
   
     CIMExecQueryResponseMessage* msg;     CIMExecQueryResponseMessage* msg;
     CIMException cimException;     CIMException cimException;
  
Line 3122 
Line 3087 
         cimException,         cimException,
         QueueIdStack());         QueueIdStack());
  
     msg->getResponseData().setCIMObjects(cimObjects);      // Instead of resolving the binary data right here, we delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to getNamedInstances, which is going to resolve the binary
       // data when the callback function is registered.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMObjectsResponseData& responseData = msg->getResponseData();
       responseData.setBinaryCimObjects(in,false);
   
     msg->binaryRequest = true;     msg->binaryRequest = true;
     return msg;     return msg;
 } }
Line 3303 
Line 3277 
     CIMBuffer buf((char*)in.getData(), in.size());     CIMBuffer buf((char*)in.getData(), in.size());
     CIMBufferReleaser buf_(buf);     CIMBufferReleaser buf_(buf);
  
       return decodeResponse(buf);
   }
   
   CIMResponseMessage* BinaryCodec::decodeResponse(
       CIMBuffer& buf)
   {
     // Turn on validation:     // Turn on validation:
 #if defined(ENABLE_VALIDATION) #if defined(ENABLE_VALIDATION)
     buf.setValidate(true);     buf.setValidate(true);


Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2