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

gadget::SimSetablePosition Class Reference

Simulated positional device whose data is set by the user (in postFrame). More...

#include <SimSetablePosition.h>

Inheritance diagram for gadget::SimSetablePosition:

Inheritance graph
[legend]
Collaboration diagram for gadget::SimSetablePosition:

Collaboration graph
[legend]
List of all members.

Public Methods

 SimSetablePosition ()
virtual ~SimSetablePosition ()
virtual bool config (jccl::ConfigElementPtr element)
 Config method. More...

bool startSampling ()
 These functions don't do anything. More...

bool stopSampling ()
 StopSampling. More...

bool sample ()
 Sample the device. More...

virtual void updateData ()
 Updates the data. More...

void setData (const std::vector< PositionData > &pos_data_vec)
void setData (const PositionData &pos_data)
void operator delete (void *p)
 Invokes the global scope delete operator. More...


Static Public Methods

std::string getElementType ()
 Returns the string rep of the element type used to config this device. More...


Protected Methods

virtual void destroy ()
 Deletes this object. More...


Detailed Description

Simulated positional device whose data is set by the user (in postFrame).

Should be set just before input manager updates data so it can be distributed by the remote input manager. The end of postFrame() is the logical place for the user to set the data. This prevents computers connected to the remote input manager from having different copies of data for very long.

Definition at line 58 of file SimSetablePosition.h.


Constructor & Destructor Documentation

gadget::SimSetablePosition::SimSetablePosition   [inline]
 

Definition at line 66 of file SimSetablePosition.h.

00066 {;}

virtual gadget::SimSetablePosition::~SimSetablePosition   [inline, virtual]
 

Definition at line 67 of file SimSetablePosition.h.

00067 {;}


Member Function Documentation

bool gadget::SimSetablePosition::config jccl::ConfigElementPtr    element [virtual]
 

Config method.

This baselevel config will fill the base datamembers when found in the jccl::ConfigElementPtr such as instance name.

Reimplemented from gadget::Input.

Definition at line 47 of file SimSetablePosition.cpp.

00048 {
00049    if(! (Input::config(element) && Position::config(element)))
00050    {
00051       return false;
00052    }
00053 
00054    return true;
00055 }

bool gadget::SimSetablePosition::startSampling   [inline, virtual]
 

These functions don't do anything.

Implements gadget::Input.

Definition at line 72 of file SimSetablePosition.h.

00072 { return 1; }

bool gadget::SimSetablePosition::stopSampling   [inline, virtual]
 

StopSampling.

Reverse the effects of StartSampling().

Implements gadget::Input.

Definition at line 73 of file SimSetablePosition.h.

00073 { return 1; }

bool gadget::SimSetablePosition::sample   [inline, virtual]
 

Sample the device.

Read the next set of input. This method is normally used internally by threaded drivers to repetively sample data in a separate thread. (This new data is not accessable until UpdateData is called)

Implements gadget::Input.

Definition at line 74 of file SimSetablePosition.h.

00074 { return 1; }

virtual void gadget::SimSetablePosition::updateData   [inline, virtual]
 

Updates the data.

Implements gadget::Input.

Definition at line 77 of file SimSetablePosition.h.

00077 {;}

void gadget::SimSetablePosition::setData const std::vector< PositionData > &    pos_data_vec
 

Definition at line 58 of file SimSetablePosition.cpp.

References gadget::Position::addPositionSample, and gadget::Position::swapPositionBuffers.

00059 {
00060    mPos.setTime();   // Set the time
00061    addPositionSample(pos_data_vec);   
00062 
00063    swapPositionBuffers(); // Swap the buffers
00064 }

void gadget::SimSetablePosition::setData const PositionData   pos_data
 

Definition at line 66 of file SimSetablePosition.cpp.

References gadget::Position::addPositionSample, and gadget::Position::swapPositionBuffers.

00067 {
00068    std::vector<PositionData> pos_data_vec;
00069    pos_data_vec.push_back(pos_data);
00070 
00071    mPos.setTime();   // Set the time
00072    addPositionSample(pos_data_vec);   
00073 
00074    swapPositionBuffers(); // Swap the buffers
00075 
00076    //vprDEBUG(gadgetDBG_INPUT_MGR, vprDBG_DETAILED_LVL) << "SimSetablePosition: set Data:" << *(const_cast<PositionData*>(&pos_data)->getPosition()) << std::endl << vprDEBUG_FLUSH;
00077 }

std::string gadget::SimSetablePosition::getElementType   [static]
 

Returns the string rep of the element type used to config this device.

This string is used by the device factory to look up device drivers based up the type of element it is trying to load.

Reimplemented from gadget::Input.

Definition at line 42 of file SimSetablePosition.cpp.

00043 {
00044    return "simulated_setable_position";
00045 }

void gadget::SimSetablePosition::operator delete void *    p [inline]
 

Invokes the global scope delete operator.

This is required for proper releasing of memory in DLLs on Win32.

Definition at line 88 of file SimSetablePosition.h.

00089    {
00090       ::operator delete(p);
00091    }

virtual void gadget::SimSetablePosition::destroy   [inline, protected, virtual]
 

Deletes this object.

This is an implementation of the pure virtual gadget::Input::destroy() method.

Implements gadget::Input.

Definition at line 98 of file SimSetablePosition.h.

00099    {
00100       delete this;
00101    }


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