Homepage Demos Overview Downloads Tutorials Reference
Credits

MotionManagerMsg.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_MotionManagerMsg_h
00003 #define INCLUDED_MotionManagerMsg_h
00004 
00005 //! A small header that preceeds data sent by MotionManager between processes
00006 struct MotionManagerMsg {
00007   //! the type to use when referring to MotionCommand ID's
00008   typedef unsigned short MC_ID;
00009 
00010   //! for errors and undefined stuff
00011   static const MC_ID invalid_MC_ID=static_cast<MC_ID>(-1); 
00012 
00013   //! constructor
00014   MotionManagerMsg() : type(unknown), mc_id(invalid_MC_ID) {}
00015 
00016   //! virtual destructor
00017   /*! doesn't do anything, but don't remove it, otherwise this would no longer be a virtual base class */
00018   virtual ~MotionManagerMsg() {}
00019 
00020   //! Accessor for the id number, set by MotionManager::addMotion()
00021   MC_ID getID() const { return mc_id; }
00022 
00023 protected:
00024   //! resets the #mc_id to #invalid_MC_ID
00025   void clearID() { mc_id=invalid_MC_ID; }
00026 
00027 private:
00028   friend class MotionManager;
00029 
00030   //! Denotes what type of message this is
00031   enum MsgType { addMotion, deleteMotion, unknown } type;
00032   
00033   //! The id of the MotionCommand this is in reference to
00034   MC_ID mc_id;
00035 
00036   //! Sets up the header as an add motion message
00037   void setAdd(MC_ID id) {
00038     type=addMotion;
00039     mc_id=id;
00040   }
00041 
00042   //! Sets up the header as an erase motion message
00043   void setDelete(MC_ID id) {
00044     type=deleteMotion;
00045     mc_id=id;
00046   }
00047 
00048 };
00049 
00050 /*! @file
00051  * @brief Defines MotionManagerMsg, a small header used by MotionManager for sending messages between processes
00052  * @author ejt (Creator)
00053  *
00054  * $Author: ejt $
00055  * $Name: tekkotsu-2_2 $
00056  * $Revision: 1.4 $
00057  * $State: Rel $
00058  * $Date: 2003/09/02 20:58:49 $
00059  */
00060 
00061 #endif // INCLUDED_MotionManagerMsg_h

Tekkotsu v2.2
Generated Tue Oct 19 14:19:15 2004 by Doxygen 1.3.9.1