Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PtfCore Class Reference

Class which provides access to all components of the PTF framework. More...

#include <ptfcore.hpp>

Inheritance diagram for PtfCore:

Inheritance graph
[legend]
Collaboration diagram for PtfCore:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PtfCore (int, char **)
 Constructor.
 ~PtfCore ()
 Destructor.
void run ()
 Runs the test.
void setScheduler (Scheduler *)
 Sets the task scheduler.
void setReactionHandler (ReactionHandler *)
 Sets the task reaction handler.
void setSequenceIterator (SequenceIterator *)
 Sets the sequence iterator.
SchedulergetScheduler ()
 Gets the sequence iterator.
ReactionHandlergetReactionHandler ()
 Gets the reaction handler.
SequenceIteratorgetSequenceIterator ()
 Gets the sequence iterator.
vector< Sequence * > & getSequences ()
 Gets the vector storing the sequences.
vector< ReactionRecord * > & getReactionRecords ()
 Gets the vector storing the reaction records.
vector< TaskRecord * > & getTaskRecords ()
 Gets the vector storing the task records.
vector< InputDevice * > & getInputDevices ()
 Gets the vector storing the input devices.
Mutex & getReactionRecordsMutex ()
 Gets the mutex for syncronizing access to the reaction record vector.
Mutex & getTaskRecordsMutex ()
 Gets the mutex for syncronizing access to the task record vector.
void taskRegistrationHelper (Task *)
 Adds a task to the task vector.
const vector< Task * > & getTasks () const
 Gets the vector storing the tasks.
LoggetMessageLog ()
 Gets the message log object.
LoggetHandlerLog ()
 Gets the handler log object.
LoggetTaskLog ()
 Gets the task log object.
LoggetEventLog ()
 Gets the event log object.
LoggetMachineLog ()
 Gets the machine log object.

Protected Attributes

Schedulerscheduler
 task scheduler
ReactionHandlerhandler
 reaction handler
SequenceIteratoriterator
 sequence iterator
vector< Sequence * > sequences
 vector with all used sequences
vector< ReactionRecord * > reactionRecords
 queue with reaction records
vector< TaskRecord * > taskRecords
 queue with task records
vector< Task * > tasks
 vector storing all tasks
vector< InputDevice * > inputDevices
 vector storing all used input devices
Mutex reactionRecordsMutex
 mutex for reaction record queue
Mutex taskRecordsMutex
 mutex for task record queue
Log messageLog
 message log
Log handlerLog
 reaction handler log
Log taskLog
 task log
Log eventLog
 event log
Log machineLog
 machine readable log

Detailed Description

Class which provides access to all components of the PTF framework.

Definition at line 39 of file ptfcore.hpp.


Constructor & Destructor Documentation

PtfCore::PtfCore int  argc,
char **  argv
 

Constructor.

Definition at line 29 of file ptfcore.cpp.

References Graphic::createWindow(), ERROR, Singleton< Graphic >::getSingleton(), handler, iterator, MESSAGE, messageLog, and scheduler.

Here is the call graph for this function:

PtfCore::~PtfCore  ) 
 

Destructor.

Definition at line 72 of file ptfcore.cpp.

References Singleton< Parallel >::getSingletonPtr(), Singleton< Clock >::getSingletonPtr(), Singleton< Audio >::getSingletonPtr(), and Singleton< Graphic >::getSingletonPtr().

Here is the call graph for this function:


Member Function Documentation

Log & PtfCore::getEventLog  ) 
 

Gets the event log object.

Returns:
log object
Definition at line 290 of file ptfcore.cpp.

References eventLog.

Referenced by InputDevice::run().

Log & PtfCore::getHandlerLog  ) 
 

Gets the handler log object.

Returns:
log object
Definition at line 274 of file ptfcore.cpp.

References handlerLog.

Referenced by SimpleReactionHandler::handle().

vector< InputDevice * > & PtfCore::getInputDevices  ) 
 

Gets the vector storing the input devices.

Returns:
reference to the vector storing the input devices
Definition at line 213 of file ptfcore.cpp.

References inputDevices.

Log & PtfCore::getMachineLog  ) 
 

Gets the machine log object.

Returns:
log object
Definition at line 298 of file ptfcore.cpp.

References machineLog.

Referenced by SimpleReactionHandler::handle().

Log & PtfCore::getMessageLog  ) 
 

Gets the message log object.

Returns:
log object
Definition at line 266 of file ptfcore.cpp.

References messageLog.

Referenced by Audio::addSample(), Graphic::addTexture(), Audio::Audio(), Clock::Clock(), Graphic::createWindow(), Graphic::drawTexturedRectangle(), Clock::getClock(), DefaultSequenceIterator::getNextTaskId(), JoystickInputDevice::JoystickInputDevice(), Sequence::loadFromFile(), Audio::playSample(), Scheduler::quit(), and Scheduler::schedule().

ReactionHandler & PtfCore::getReactionHandler  ) 
 

Gets the reaction handler.

A pointer is returned here because the system has to run even with no reaction handler specified.

Returns:
pointer to a reaction handler
Definition at line 173 of file ptfcore.cpp.

References handler.

Referenced by Scheduler::schedule().

vector< ReactionRecord * > & PtfCore::getReactionRecords  ) 
 

Gets the vector storing the reaction records.

Returns:
reference to the vector storing the reaction records
Definition at line 197 of file ptfcore.cpp.

References reactionRecords.

Referenced by SimpleReactionHandler::handle(), SimulatedInputDevice::run(), and InputDevice::run().

Mutex & PtfCore::getReactionRecordsMutex  ) 
 

Gets the mutex for syncronizing access to the reaction record vector.

Returns:
reference to the mutex
Definition at line 221 of file ptfcore.cpp.

References reactionRecordsMutex.

Referenced by SimpleReactionHandler::handle(), SimulatedInputDevice::run(), and InputDevice::run().

Scheduler & PtfCore::getScheduler  ) 
 

Gets the sequence iterator.

Returns:
reference to a sequence iterator
Definition at line 164 of file ptfcore.cpp.

References scheduler.

Referenced by MouseInputDevice::poll(), KeyboardInputDevice::poll(), and JoystickInputDevice::poll().

SequenceIterator & PtfCore::getSequenceIterator  ) 
 

Gets the sequence iterator.

Returns:
reference to a sequence iterator
Definition at line 181 of file ptfcore.cpp.

References iterator.

Referenced by Scheduler::schedule().

vector< Sequence * > & PtfCore::getSequences  ) 
 

Gets the vector storing the sequences.

Returns:
reference to the vector storing the sequences
Definition at line 189 of file ptfcore.cpp.

References sequences.

Referenced by DefaultSequenceIterator::getNextTaskId(), and DefaultSequenceIterator::hasNextTaskId().

Log & PtfCore::getTaskLog  ) 
 

Gets the task log object.

Returns:
log object
Definition at line 282 of file ptfcore.cpp.

References taskLog.

Referenced by Scheduler::schedule().

vector< TaskRecord * > & PtfCore::getTaskRecords  ) 
 

Gets the vector storing the task records.

Returns:
reference to the vector storing the task records
Definition at line 205 of file ptfcore.cpp.

References taskRecords.

Referenced by SimpleReactionHandler::handle(), and Scheduler::schedule().

Mutex & PtfCore::getTaskRecordsMutex  ) 
 

Gets the mutex for syncronizing access to the task record vector.

Returns:
reference to the mutex
Definition at line 229 of file ptfcore.cpp.

References taskRecordsMutex.

Referenced by Scheduler::schedule().

const vector< Task * > & PtfCore::getTasks  )  const
 

Gets the vector storing the tasks.

Returns:
reference to the vector storing the tasks
Definition at line 237 of file ptfcore.cpp.

References tasks.

Referenced by SimpleReactionHandler::handle(), and Scheduler::schedule().

void PtfCore::run  ) 
 

Runs the test.

Definition at line 88 of file ptfcore.cpp.

References ERROR, eventLog, handler, handlerLog, inputDevices, iterator, machineLog, messageLog, Log::saveToFile(), Scheduler::schedule(), scheduler, Log::setSilent(), taskLog, and WARNING.

Here is the call graph for this function:

void PtfCore::setReactionHandler ReactionHandler reactionHandler  ) 
 

Sets the task reaction handler.

Parameters:
reactionHandler pointer to a reaction handler
Definition at line 148 of file ptfcore.cpp.

References handler.

void PtfCore::setScheduler Scheduler taskScheduler  ) 
 

Sets the task scheduler.

Parameters:
taskScheduler pointer to a scheduler
Definition at line 140 of file ptfcore.cpp.

References scheduler.

void PtfCore::setSequenceIterator SequenceIterator sequenceIterator  ) 
 

Sets the sequence iterator.

Parameters:
sequenceIterator pointer to a sequence iterator
Definition at line 156 of file ptfcore.cpp.

References iterator.

void PtfCore::taskRegistrationHelper Task task  ) 
 

Adds a task to the task vector.

Warning:
Use this instead of a push_back on the vector itself to avoid index conflicts.
Parameters:
task pointer to a task
Definition at line 247 of file ptfcore.cpp.

References Task::getId(), and tasks.

Here is the call graph for this function:


Member Data Documentation

Log PtfCore::eventLog [protected]
 

event log

Definition at line 77 of file ptfcore.hpp.

Referenced by getEventLog(), and run().

ReactionHandler* PtfCore::handler [protected]
 

reaction handler

Definition at line 65 of file ptfcore.hpp.

Referenced by getReactionHandler(), PtfCore(), run(), and setReactionHandler().

Log PtfCore::handlerLog [protected]
 

reaction handler log

Definition at line 75 of file ptfcore.hpp.

Referenced by getHandlerLog(), and run().

vector<InputDevice*> PtfCore::inputDevices [protected]
 

vector storing all used input devices

Definition at line 71 of file ptfcore.hpp.

Referenced by getInputDevices(), and run().

SequenceIterator* PtfCore::iterator [protected]
 

sequence iterator

Definition at line 66 of file ptfcore.hpp.

Referenced by getSequenceIterator(), PtfCore(), run(), and setSequenceIterator().

Log PtfCore::machineLog [protected]
 

machine readable log

Definition at line 78 of file ptfcore.hpp.

Referenced by getMachineLog(), and run().

Log PtfCore::messageLog [protected]
 

message log

Definition at line 74 of file ptfcore.hpp.

Referenced by getMessageLog(), PtfCore(), and run().

vector<ReactionRecord*> PtfCore::reactionRecords [protected]
 

queue with reaction records

Definition at line 68 of file ptfcore.hpp.

Referenced by getReactionRecords().

Mutex PtfCore::reactionRecordsMutex [protected]
 

mutex for reaction record queue

Definition at line 72 of file ptfcore.hpp.

Referenced by getReactionRecordsMutex().

Scheduler* PtfCore::scheduler [protected]
 

task scheduler

Definition at line 64 of file ptfcore.hpp.

Referenced by getScheduler(), PtfCore(), run(), and setScheduler().

vector<Sequence*> PtfCore::sequences [protected]
 

vector with all used sequences

Definition at line 67 of file ptfcore.hpp.

Referenced by getSequences().

Log PtfCore::taskLog [protected]
 

task log

Definition at line 76 of file ptfcore.hpp.

Referenced by getTaskLog(), and run().

vector<TaskRecord*> PtfCore::taskRecords [protected]
 

queue with task records

Definition at line 69 of file ptfcore.hpp.

Referenced by getTaskRecords().

Mutex PtfCore::taskRecordsMutex [protected]
 

mutex for task record queue

Definition at line 73 of file ptfcore.hpp.

Referenced by getTaskRecordsMutex().

vector<Task*> PtfCore::tasks [protected]
 

vector storing all tasks

Definition at line 70 of file ptfcore.hpp.

Referenced by getTasks(), and taskRegistrationHelper().


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 14:54:30 2004 for Psychological Test Framework by doxygen 1.3.8