00001 #ifndef trkwsSELF_CMD_H
00002 #define trkwsSELF_CMD_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __cplusplus
00019 #error This is a C++ include file and cannot be used from plain C
00020 #endif
00021
00022 #include <fndSTRING.h>
00023 #include <evhCALLBACK.h>
00024 #include <evhOBJ_CALLBACK.h>
00025 #include <evhTASK.h>
00026 #include <evhCOMMAND.h>
00027
00028 #define DELETE_OBJECT(object) do \
00029 { \
00030 if (object != NULL) \
00031 { \
00032 delete object; \
00033 object = NULL; \
00034 } \
00035 } while (0)
00036
00037
00038 class trkwsSELF_CMD : public evhSIMPLE_TASK
00039 {
00040 public:
00041 trkwsSELF_CMD();
00042 ~trkwsSELF_CMD();
00043 ccsCOMPL_STAT SetReplyHandler(evhCALLBACK &cb);
00044 ccsCOMPL_STAT SetErrorHandler(evhCALLBACK &cb);
00045 ccsCOMPL_STAT Send(msgCMD cmdName, const char *format, ...);
00046 void ResetCBs();
00047 void Reset();
00048 vltLOGICAL IsActive();
00049 void SetDescription(const char *setdescription);
00050
00051 protected:
00052 evhCB_COMPL_STAT ReplyCB(msgMESSAGE &msg, void *);
00053 evhCB_COMPL_STAT ErrorCB(msgMESSAGE &msg, void *);
00054
00055 private:
00056 evhCOMMAND command;
00057 fndSTRING description;
00058 evhCALLBACK *userReplyCB;
00059 evhCALLBACK *userErrorCB;
00060 };
00061
00062 #endif // !trkwsSELF_CMD_H