00001 /*----------------------------------------------------------------------------* 00002 * Copyright (c) 2005 Southeastern Universities Research Association, * 00003 * Thomas Jefferson National Accelerator Facility * 00004 * * 00005 * This software was developed under a United States Government license * 00006 * described in the NOTICE file included as part of this distribution. * 00007 * * 00008 * E.Wolin, 25-Feb-2005, Jefferson Lab * 00009 * * 00010 * Authors: Elliott Wolin * 00011 * wolin@jlab.org Jefferson Lab, MS-6B * 00012 * Phone: (757) 269-7365 12000 Jefferson Ave. * 00013 * Fax: (757) 269-5519 Newport News, VA 23606 * 00014 * 00015 *----------------------------------------------------------------------------*/ 00016 00017 00018 #ifndef _InterruptibleObject_hxx 00019 #define _InterruptibleObject_hxx 00020 00021 00022 #include <RunObject.hxx> 00023 #include <InterruptService.hxx> 00024 00025 00026 namespace codaObject { 00027 00028 using namespace std; 00029 using namespace cmsg; 00030 00031 00032 //----------------------------------------------------------------------------- 00033 //----------------------------------------------------------------------------- 00034 00035 00041 class InterruptibleObject : public RunObject { 00042 00043 public: 00044 InterruptibleObject(const string& UDL, const string& name, const string& descr, InterruptService *intSvc = NULL, 00045 const string &codaClass = "USER", const cMsgSubscriptionConfig *scfg = NULL) throw(CodaException); 00046 ~InterruptibleObject(void) throw(); 00047 00048 00049 protected: 00050 virtual bool download(const string& s) throw(CodaException); 00051 virtual bool prestart(const string& s) throw(CodaException); 00052 virtual bool go(const string& s) throw(CodaException); 00053 virtual bool pause(const string& s) throw(CodaException); 00054 virtual bool resume(const string& s) throw(CodaException); 00055 virtual bool end(const string& s) throw(CodaException); 00056 virtual bool reset(const string& s) throw(CodaException); 00057 00058 00059 public: 00060 virtual bool interrupt(unsigned int flag) throw(CodaException); 00061 00062 00063 protected: 00064 virtual bool userInterrupt(unsigned int flag) throw(CodaException); 00065 00066 00067 protected: 00068 dllIntFuncPtr dllInterrupt; 00069 InterruptService *intSvc; 00070 }; 00071 00072 00073 //----------------------------------------------------------------------------- 00074 //----------------------------------------------------------------------------- 00075 00076 00077 } // namespace codaObject 00078 00079 #endif /* _InterruptibleObject_hxx */