[Libphidget-cvs-commits] CVS: libphidget/src/phidget++ CAnalogIn.h,1.11,1.12 CDigitalIn.h,1.13,1.14
Status: Alpha
Brought to you by:
jstrohm
Update of /cvsroot/libphidget/libphidget/src/phidget++
In directory sc8-pr-cvs1:/tmp/cvs-serv28710
Modified Files:
CAnalogIn.h CDigitalIn.h CDigitalOut.h CServo.h
CUniqueDevice.cc CUniqueDevice.h TSingleton.h
Log Message:
More documentation
Index: CAnalogIn.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CAnalogIn.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** CAnalogIn.h 17 Dec 2002 23:39:16 -0000 1.11
--- CAnalogIn.h 21 Dec 2002 04:17:01 -0000 1.12
***************
*** 79,82 ****
--- 79,87 ----
*/
CInterfaceKit &interfaceKit() ;
+
+ /**
+ * No events
+ */
+ void processEvents() { }
};
Index: CDigitalIn.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalIn.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** CDigitalIn.h 18 Dec 2002 02:51:16 -0000 1.13
--- CDigitalIn.h 21 Dec 2002 04:17:01 -0000 1.14
***************
*** 79,82 ****
--- 79,87 ----
*/
CInterfaceKit &interfaceKit() ;
+
+ /**
+ * No events
+ */
+ void processEvents() { }
};
Index: CDigitalOut.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CDigitalOut.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CDigitalOut.h 17 Dec 2002 23:39:16 -0000 1.10
--- CDigitalOut.h 21 Dec 2002 04:17:01 -0000 1.11
***************
*** 58,61 ****
--- 58,66 ----
*/
CInterfaceKit &interfaceKit() ;
+
+ /**
+ * No events
+ */
+ void processEvents() { }
};
Index: CServo.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CServo.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CServo.h 17 Dec 2002 23:39:16 -0000 1.8
--- CServo.h 21 Dec 2002 04:17:01 -0000 1.9
***************
*** 86,89 ****
--- 86,96 ----
*/
CServoController &servoController();
+
+ /**
+ * No events to process
+ */
+ void processEvents()
+ {
+ }
};
Index: CUniqueDevice.cc
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUniqueDevice.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** CUniqueDevice.cc 15 Dec 2002 23:41:55 -0000 1.6
--- CUniqueDevice.cc 21 Dec 2002 04:17:01 -0000 1.7
***************
*** 16,17 ****
--- 16,23 ----
METHOD_UNGUARD;
}
+
+ void CUniqueDevice::query( const EDeviceClass tp, set < CUID >&devices)
+ {
+ if (tp==LP_ALL)
+ devices.insert(UID());
+ }
Index: CUniqueDevice.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/CUniqueDevice.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CUniqueDevice.h 18 Dec 2002 02:51:17 -0000 1.9
--- CUniqueDevice.h 21 Dec 2002 04:17:01 -0000 1.10
***************
*** 30,33 ****
--- 30,37 ----
protected:
+
+ /**
+ * Used to set the parent of this device.
+ */
void parent(CUniqueDevice *parent)
{
***************
*** 41,45 ****
* which is it's parent
*/
! CUniqueDevice (CUniqueDevice *parent, const int id) :
_uid(parent, id),
_parent(parent)
--- 45,52 ----
* which is it's parent
*/
! CUniqueDevice (
! CUniqueDevice *parent, //!< The parent of this device
! const int id //!< This devices ID
! ) :
_uid(parent, id),
_parent(parent)
***************
*** 51,55 ****
* Construct a unique device that is a Phidget from a UID
*/
! CUniqueDevice (const CUID &uid) :
_uid(uid),
_parent(NULL)
--- 58,64 ----
* Construct a unique device that is a Phidget from a UID
*/
! CUniqueDevice (
! const CUID &uid //!< unique ID of the device, this type of constructor is for devices without parents
! ) :
_uid(uid),
_parent(NULL)
***************
*** 85,89 ****
* don't manage any sub devices they can just rely on this method
*/
! virtual CUniqueDevice *find(const CUID &uid, bool create = true)
{
if (uid == _uid)
--- 94,101 ----
* don't manage any sub devices they can just rely on this method
*/
! virtual CUniqueDevice *find(
! const CUID &uid, //!< Unique device we are looking for
! bool create = true //!< By default if anything can create this UID phidget it will try to.
! )
{
if (uid == _uid)
***************
*** 94,108 ****
/**
! * Queries for any unique id devices that may exists, or are known how to create.
! */
! virtual void query(const EDeviceClass tp, set < CUID >&devices)
! {
! if (tp==LP_ALL)
! devices.insert(UID());
! }
! virtual void processEvents()
! {
! }
};
--- 106,120 ----
/**
! * Query for a device that matches the libphidget device class passed in.
! */
! virtual void query(
! const EDeviceClass tp, //!< The device class we are looking for
! set < CUID >&devices //!< This will be filled with UID's of phidgets (or sub-objects) that match the device class
! );
! /**
! * Must implement this to handle any events you want to look for
! */
! virtual void processEvents()=0;
};
Index: TSingleton.h
===================================================================
RCS file: /cvsroot/libphidget/libphidget/src/phidget++/TSingleton.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TSingleton.h 17 Dec 2002 22:56:17 -0000 1.5
--- TSingleton.h 21 Dec 2002 04:17:01 -0000 1.6
***************
*** 88,91 ****
--- 88,95 ----
public:
+
+ /**
+ * Empty destructor
+ */
virtual ~ TSingleton ()
{
***************
*** 135,144 ****
--- 139,161 ----
};
+ /**
+ * This was created so that I can guarantee a TSingleton object is destroyed on
+ * exit. Basic will the stack is rolled back this is destoryed and it releases
+ * the singleton.
+ */
template <class T >class AutoDestroy
{
public:
+
+ /**
+ * Default destructor
+ */
AutoDestroy()
{
}
+
+ /**
+ * This does the magic of destroying the singleton on the destruction of this object
+ */
~AutoDestroy()
{
|