Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ButtonDevice.h

Go to the documentation of this file.
00001 
00003 //
00004 //  Copyright (c) 2002, Perry L. Miller IV
00005 //  All rights reserved.
00006 //  BSD License: http://www.opensource.org/licenses/bsd-license.html
00007 //
00009 
00011 //
00012 //  Wrapper class for a single gadget::DigitalInterface.
00013 //
00015 
00016 #ifndef _VRJGA_BUTTON_DEVICE_H_
00017 #define _VRJGA_BUTTON_DEVICE_H_
00018 
00019 #include "vrjGA/Referenced.h"
00020 
00021 #include "gadget/Type/DigitalInterface.h"
00022 
00023 #include <string>
00024 
00025 
00026 namespace vrjGA {
00027 
00028 
00029 class VRJ_GA_EXPORT ButtonDevice : public Referenced
00030 {
00031 public:
00032 
00033   // Useful typedefs.
00034   typedef Referenced BaseClass;
00035   typedef gadget::DigitalInterface DI;
00036 
00038   VRJGA_DECLARE_POINTER ( ButtonDevice );
00039 
00040   // Constructor.
00041   ButtonDevice ( unsigned long mask, const std::string &name );
00042 
00043   // Get the bit-mask for this button.
00044   unsigned long         mask() const { return _mask; }
00045 
00046   // Get the device state.
00047   unsigned long         state() const;
00048 
00049 protected:
00050 
00051   virtual ~ButtonDevice();
00052 
00053 private:
00054 
00055   // Not copyable.
00056   ButtonDevice ( const ButtonDevice & );
00057   ButtonDevice& operator = ( const ButtonDevice & );
00058 
00059   DI _di;
00060   unsigned long _mask;
00061 };
00062 
00063 
00064 }; // namespace vrjGA
00065 
00066 
00067 #endif // _VRJGA_BUTTON_DEVICE_H_

Generated on Thu Aug 12 16:42:14 2004 for vrjGA by doxygen 1.3.5