00001 // 00002 // SfUTask.h 00003 // 00004 // Saphira uTask definitions 00005 00006 // 00007 // Copyright 2001 by Kurt Konolige 00008 // 00009 // The author hereby grants to SRI permission to use this software. 00010 // The author also grants to SRI permission to distribute this software 00011 // to schools for non-commercial educational use only. 00012 // 00013 // The author hereby grants to other individuals or organizations 00014 // permission to use this software for non-commercial 00015 // educational use only. This software may not be distributed to others 00016 // except by SRI, under the conditions above. 00017 // 00018 // Other than these cases, no part of this software may be used or 00019 // distributed without written permission of the author. 00020 // 00021 // Neither the author nor SRI make any representations about the 00022 // suitability of this software for any purpose. It is provided 00023 // "as is" without express or implied warranty. 00024 // 00025 // Kurt Konolige 00026 // Senior Computer Scientist 00027 // SRI International 00028 // 333 Ravenswood Avenue 00029 // Menlo Park, CA 94025 00030 // E-mail: konolige@ai.sri.com 00031 00032 00033 #ifndef SFUTASK_H 00034 #define SFUTASK_H 00035 00036 #undef SFEXPORT 00037 #if defined(MS_WINDOWS) && !defined(SF_STATIC) 00038 #ifdef MAKE_LIBRARY 00039 #define _declspec( dllexport ) 00040 #else 00041 #define _declspec( dllimport ) 00042 #endif 00043 #else 00044 #define SFEXPORT 00045 #endif 00046 00047 00048 // 00049 // The process() member of SfUTask defines the work done by this uTask 00050 // 00051 00052 00054 00064 class SfUTask 00065 { 00066 public: 00068 SfUTask(char *name, int priority); 00070 virtual ~SfUTask() {}; 00071 void removeTask(); // remove from task list 00072 void addTask(); // adds to task list 00074 void suspendTask(); 00076 void resumeTask(); 00078 virtual void process() {}; // what we do 00082 int processState; // what our state is 00083 00084 private: 00085 char *myName; // what we're called 00086 int myPriority; // task priority 00087 ArFunctor *myFunctor; // our Aria functor 00088 }; 00089 00090 #endif 00091