⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 responsehandler.h

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 H
字号:
//%2003//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development// Company, L. P., IBM Corp., The Open Group, Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;// IBM Corp.; EMC Corporation, The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================////%/////////////////////////////////////////////////////////////////////////////#ifndef Pegasus_ResponseHandler_h#define Pegasus_ResponseHandler_h#include <Pegasus/Common/Config.h>#include <Pegasus/Common/Array.h>#include <Pegasus/Common/Linkage.h>#include <Pegasus/Common/CIMInstance.h>#include <Pegasus/Common/CIMObjectPath.h>#include <Pegasus/Common/CIMParamValue.h>#include <Pegasus/Common/CIMValue.h>#include <Pegasus/Common/CIMObject.h>#include <Pegasus/Common/CIMClass.h>#include <Pegasus/Common/OperationContext.h>PEGASUS_NAMESPACE_BEGIN/**<p>The <tt>ResponseHandler</tt> class allows a providerto report operation progress and results to the CIM Server.Subclasses are defined for each of the types of objectthat a provider can deliver to the CIM Server.A <tt>ResponseHandler</tt> object of the appropriate typeis passed to providerfunctions that are invoked to process client requests (itis not passed to the <tt>{@link initialize initialize}</tt>or <tt>{@link terminate terminate}</tt> functions). Itcontains the following public member functions thatmay be used to deliver results to the CIM Server:</p><ul><li><tt>{@link processing processing}</tt> - inform the CIM Serverthat delivery of results is beginning.</li><li><tt>{@link deliver deliver}</tt> - deliver an incrementalresult to the CIM Server; the CIM Server accumulates results asthey are received from the provider.</li><li><tt>{@link complete complete}</tt> - inform the CIM Server thatprocess of the request is complete and that no furtherresults will be delivered.</li></ul>*/class PEGASUS_COMMON_LINKAGE ResponseHandler{public:    /**    Destructor.    */    virtual ~ResponseHandler(void);    // This method is defined in subclasses, specialized for     // the appropriate data type.    //virtual void deliver(const T & object);    // This method is defined in subclasses, specialized for     // the appropriate data type.    //virtual void deliver(const Array<T> & objects);    /**    Inform the CIM Server that delivery of results will begin.    <p>The provider must call <tt>processing</tt> before    attempting to call <tt>deliver</tt>.    */    virtual void processing(void) = 0;    /**    Inform the CIM Server that delivery of results is complete.    <p>The provider must call <tt>complete</tt> when all    results have been delivered. It must not call <tt>deliver</tt>    after calling <tt>complete</tt>.</p>    */    virtual void complete(void) = 0;};//// InstanceResponseHandler///class PEGASUS_COMMON_LINKAGE InstanceResponseHandler : virtual public ResponseHandler{public:    /** <p>The <tt>deliver</tt> function is used by providers to        deliver results to the CIM Server. For operations that require a        single element result (<tt>getInstance</tt>, for example),        <tt>deliver</tt> should be called only once to deliver the        entire result. For operations that involve        enumeration, the single-element form shown here may be        used, each iteration delivering an incremental element        of the total result. The Array form below may be used        to deliver a larger set of result elements.</p>    */    virtual void deliver(const CIMInstance & instance) = 0;    /** <p>This form of the <tt>deliver</tt> function may be used        to return a set of elements to the CIM Server. The set is not        required to be complete, and the provider may invoke this        function multiple times, if necessary. This form should only        be used when the operation requires a result consisting        of more than one element, such as an enumeration.</p>    */    virtual void deliver(const Array<CIMInstance> & instances) = 0;};//// ObjectPathResponseHandler///class PEGASUS_COMMON_LINKAGE ObjectPathResponseHandler : virtual public ResponseHandler{public:    /** <p>The <tt>deliver</tt> function is used by providers to        deliver results to the CIM Server. For operations that require a        single element result (<tt>getInstance</tt>, for example),        <tt>deliver</tt> should be called only once to deliver the        entire result. For operations that involve        enumeration, the single-element form shown here may be        used, each iteration delivering an incremental element        of the total result. The Array form below may be used        to deliver a larger set of result elements.</p>    */    virtual void deliver(const CIMObjectPath & objectPath) = 0;    /** <p>This form of the <tt>deliver</tt> function may be used        to return a set of elements to the CIM Server. The set is not        required to be complete, and the provider may invoke this        function multiple times, if necessary. This form should only        be used when the operation requires a result consisting        of more than one element, such as an enumeration.</p>    */    virtual void deliver(const Array<CIMObjectPath> & objectPaths) = 0;};//// MethodResultResponseHandler///class PEGASUS_COMMON_LINKAGE MethodResultResponseHandler : virtual public ResponseHandler{public:    ///    virtual void deliverParamValue(const CIMParamValue & outParamValue) = 0;    ///    virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) = 0;    ///    virtual void deliver(const CIMValue & returnValue) = 0;};//// ObjectResponseHandler//// NOTE: This class definition should not be considered complete until// association provider and/or query provider support has been completed// in Pegasus, as those are the only APIs that use this response handler// type.  Implementation of support for those provider types may reveal// a need for API changes in this class.///class PEGASUS_COMMON_LINKAGE ObjectResponseHandler : virtual public ResponseHandler{public:    /** <p>The <tt>deliver</tt> function is used by providers to        deliver results to the CIM Server. For operations that require a        single element result (<tt>getInstance</tt>, for example),        <tt>deliver</tt> should be called only once to deliver the        entire result. For operations that involve        enumeration, the single-element form shown here may be        used, each iteration delivering an incremental element        of the total result. The Array form below may be used        to deliver a larger set of result elements.</p>    */    virtual void deliver(const CIMObject & object) = 0;    /** <p>This form of the <tt>deliver</tt> function may be used        to return a set of elements to the CIM Server. The set is not        required to be complete, and the provider may invoke this        function multiple times, if necessary. This form should only        be used when the operation requires a result consisting        of more than one element, such as an enumeration.</p>    */    virtual void deliver(const Array<CIMObject> & objects) = 0;};PEGASUS_NAMESPACE_END#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -