00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 #ifndef __JAUS_MOBILITY_LIST_DRIVER__H 00042 #define __JAUS_MOBILITY_LIST_DRIVER__H 00043 00044 #include "jaus/mobility/list/listmanager.h" 00045 #include "jaus/mobility/drivers/settravelspeed.h" 00046 #include "jaus/mobility/drivers/querytravelspeed.h" 00047 #include "jaus/mobility/drivers/reporttravelspeed.h" 00048 00049 namespace JAUS 00050 { 00058 class JAUS_MOBILITY_DLL ListDriver : public ListManager::Child 00059 { 00060 public: 00061 ListDriver(const ID& serviceIdentifier, 00062 const ID& parentServiceIdentifier); 00063 virtual ~ListDriver(); 00064 // Method called when transitioning to a ready state. 00065 virtual bool Resume() { return true; } 00066 // Method called to transition due to reset. 00067 virtual bool Reset() { return true; } 00068 // Method called when transitioning to a standby state. 00069 virtual bool Standby() { return true; } 00070 // Method called to modify travel speed. 00071 virtual void SetExecutionSpeed(const double speedMetersPerSecond); 00072 // Method called to begin/continue execution of a list. 00073 virtual void ExecuteList(const double speedMetersPerSecond) = 0; 00074 // Method to check if we should be executing the list because we received a command. 00075 virtual bool IsExecuting() const; 00076 // Service is always discoverable. 00077 virtual bool IsDiscoverable() const { return true; } 00078 // Method called whenever a message is received. 00079 virtual void Receive(const Message* message); 00080 // Creates messages associated with this service. 00081 virtual Message* CreateMessage(const UShort messageCode) const; 00082 // Gets the speed to execute at. 00083 inline double GetExecutionSpeed() const { Mutex::ScopedLock lock(&mListDriverMutex); return mSpeedMetersPerSecond; } 00084 protected: 00085 Mutex mListDriverMutex; 00086 double mSpeedMetersPerSecond; 00087 }; 00088 } 00089 00090 #endif 00091 /* End of File */