Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

gadget::Callable Struct Reference

This struct implements a callable object (a functor, basically). More...

Collaboration diagram for gadget::Callable:

Collaboration graph
[legend]
List of all members.

Public Methods

 Callable (gadget::InputManager *inputMgr)
bool operator() (void *func)
 This will be invoked as a callback by methods of vpr::LibraryLoader. More...


Public Attributes

gadget::InputManagermgr

Detailed Description

This struct implements a callable object (a functor, basically).

An instance can be passed in where a boost::function1<bool, void*> is expected. In gadget::InputManager::configAdd(), instances are used to handle dynamic loading of device drivers via vpr::LibraryLoader.

Definition at line 108 of file InputManager.cpp.


Constructor & Destructor Documentation

gadget::Callable::Callable gadget::InputManager   inputMgr [inline]
 

Definition at line 110 of file InputManager.cpp.

References mgr.

00110                                           : mgr(inputMgr)
00111    {
00112    }


Member Function Documentation

bool gadget::Callable::operator() void *    func [inline]
 

This will be invoked as a callback by methods of vpr::LibraryLoader.

Parameters:
func  A function pointer for the entry point in a dynamically loaded device driver. This must be cast to the correct signature before being invoked.

Definition at line 121 of file InputManager.cpp.

00122    {
00123       void (*init_func)(InputManager*);
00124 
00125       // Cast the entry point function to the correct signature so that we can
00126       // call it.  All dynamically loaded drivers must have an entry point
00127       // function that takes a pointer to a gadget::InputManager instance and
00128       // returns nothing.
00129       init_func = (void (*)(InputManager*)) func;
00130 
00131       // Call the entry point function.
00132       (*init_func)(mgr);
00133 
00134       return true;
00135    }


Member Data Documentation

gadget::InputManager* gadget::Callable::mgr
 

Definition at line 137 of file InputManager.cpp.

Referenced by Callable.


The documentation for this struct was generated from the following file:
Generated on Sun May 2 14:26:53 2004 for Gadgeteer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002