callback.hh

Go to the documentation of this file.
00001 
00016 #ifndef __CALLBACK_HH__
00017 #define __CALLBACK_HH__
00018 
00019 #include <platform.h>
00020 #include <global-types.h>
00021 #include <accdevexception.hh>
00022 #include <accdata.hh>
00023 #include <connect.hh>
00024 #include <iostream>
00025 #include <memory>
00026 namespace DeviceAccess
00027 {
00028 
00030 
00035   class E_API CallbackReference
00036   {
00037   public:
00038     CallbackReference() {}
00039     virtual ~CallbackReference() {}
00040     virtual bool isActive() = 0;  
00041   };
00042 
00043 
00045   class E_API Callback
00046   {
00047   public:
00049     Callback() {}
00050 
00052     virtual ~Callback();
00053 
00055 
00067     virtual void readResponse(const ResponseId& respId, const AccData& data, 
00068                               const AccStamp& stamp, const AccEFICD& eficd, 
00069                               const AccDevRetStatus& cmpl) = 0;
00070 
00072 
00078     virtual void response(const ResponseId& respId, 
00079                           const AccDevRetStatus& cmpl) = 0;
00080 
00082 
00097     virtual void lifesign(const ResponseId& respId, 
00098                           const AccDevRetStatus& cmpl);
00099 
00101 
00107     virtual void error(const AsynchId& asyncId, 
00108                        const AccDevRetStatus& cmpl) = 0;
00109 
00111 
00118     bool isActive() { return _cbRef->isActive(); }
00119 
00121     void cbRef(CallbackReference* cbr);
00122 
00124     CallbackReference* cbRef() { return _cbRef.get(); }
00125 
00127     bool isActivated() {return _cbRef.get() != NULL;}; 
00128 
00129   private:
00130 
00131     friend class CallbackReference;
00132     std::auto_ptr<CallbackReference> _cbRef;
00133   };
00134 }
00135 
00136 #endif

Generated on 7 Feb 2013 for Client Device Access API by  doxygen 1.4.7