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

ButtonDevice.cpp

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 #include "vrjGaPrecompiled.h"
00017 #include "ButtonDevice.h"
00018 
00019 #include "gadget/Type/Digital.h"
00020 
00021 using namespace vrjGA;
00022 
00023 
00025 //
00026 //  Constructor.
00027 //
00029 
00030 ButtonDevice::ButtonDevice ( unsigned long mask, const std::string &name ) : 
00031   BaseClass(),
00032   _di(),
00033   _mask ( mask )
00034 {
00035   // Initialize.
00036   _di.init ( name );
00037 }
00038 
00039 
00041 //
00042 //  Destructor.
00043 //
00045 
00046 ButtonDevice::~ButtonDevice()
00047 {
00048 }
00049 
00050 
00052 //
00053 //  Get the device state.
00054 //
00056 
00057 unsigned long ButtonDevice::state() const
00058 {
00059   // Jump through these hoops because getData() is not const.
00060   DI &di = const_cast < DI & > ( _di );
00061   return static_cast < unsigned long > ( di->getData() );
00062 }

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