TTEthernet Model for INET Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TTEthernetModel::Task Class Reference

Class representing a Task. More...

#include <Task.h>

Inheritance diagram for TTEthernetModel::Task:
TTEthernetModel::APITask

Public Member Functions

 Task ()
 Constructor. More...
 
virtual void setFunctionPointer (void(*functionPointer)(void *))
 Setter for the function pointer. More...
 
virtual cbFunc getFunctionPointer ()
 Getter for the function pointer. More...
 
virtual void setFunctionArg (void *setFunctionArg)
 Setter for the function args. More...
 
virtual void * getFunctionArg ()
 Getter for the function args. More...
 
virtual void executeTask ()
 execution of the task. More...
 

Protected Attributes

void(* fn )(void *)
 Function pointer of the task. More...
 
void * arg
 Pointer to the function args. More...
 
bool argSet
 Boolean indicating whether args were set. More...
 

Detailed Description

Class representing a Task.

The class stores a funtion pointer and args and invokes the function periodically.

Todo:
This may be merged with the Callback class in a joined superclass. The code seems identical.
See Also
TTEApplicationBase

Definition at line 36 of file Task.h.

Constructor & Destructor Documentation

TTEthernetModel::Task::Task ( )
inline

Constructor.

Definition at line 55 of file Task.h.

55  {
56  argSet=false;
57  }

Member Function Documentation

virtual void TTEthernetModel::Task::executeTask ( )
inlinevirtual

execution of the task.

If method is called the stored function pointer is invoked.

Definition at line 101 of file Task.h.

Referenced by TTEthernetModel::TTEAPIApplicationBase::handleMessage().

101  {
102  fn(arg);
103  }
virtual void* TTEthernetModel::Task::getFunctionArg ( )
inlinevirtual

Getter for the function args.

Returns
the funtion arg used in the task

Definition at line 92 of file Task.h.

92  {
93  return arg;
94  }
virtual cbFunc TTEthernetModel::Task::getFunctionPointer ( )
inlinevirtual

Getter for the function pointer.

Returns
the funtion pointer that is invoked in the task

Definition at line 73 of file Task.h.

73  {
74  return fn;
75  }
virtual void TTEthernetModel::Task::setFunctionArg ( void *  setFunctionArg)
inlinevirtual

Setter for the function args.

Parameters
setFunctionArgthe funtion arg to be used in the task

Definition at line 82 of file Task.h.

Referenced by TTEthernetModel::TTEAPIApplicationBase::registerTask().

82  {
84  argSet=true;
85  }
virtual void TTEthernetModel::Task::setFunctionPointer ( void(*)(void *)  functionPointer)
inlinevirtual

Setter for the function pointer.

Parameters
functionPointerthe funtion pointer to be invoked in the task

Definition at line 64 of file Task.h.

Referenced by TTEthernetModel::TTEAPIApplicationBase::registerTask().

64  {
65  fn=functionPointer;
66  }

Member Data Documentation

void* TTEthernetModel::Task::arg
protected

Pointer to the function args.

Definition at line 46 of file Task.h.

Referenced by executeTask(), getFunctionArg(), and setFunctionArg().

bool TTEthernetModel::Task::argSet
protected

Boolean indicating whether args were set.

Definition at line 50 of file Task.h.

Referenced by setFunctionArg(), and Task().

void(* TTEthernetModel::Task::fn)(void *)
protected

Function pointer of the task.

Definition at line 42 of file Task.h.

Referenced by executeTask(), getFunctionPointer(), and setFunctionPointer().


The documentation for this class was generated from the following file: