| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
TeThreadFunctor Class Reference
Multi-programming tools.

A base class for thread in function style manner. More...

`#include <TeThreadFunctor.h>`

Inheritance diagram for TeThreadFunctor:

List of all members.

## Public Types

typedef bool(* | TeThreadStartFunctT1 )(const TeThreadParameters &params)
| Type definition for a thread start function pointer.
typedef bool(* | TeThreadStartFunctT2 )(void *userParamsPtr)
| Type definition for a thread start function pointer.
typedef TeThreadStartFunctT1 | TeThreadStartFunctT
typedef TeSharedPtr < TeThreadFunctor > | pointer

## Public Member Functions

| TeThreadFunctor ()
| Default Constructor.
| ~TeThreadFunctor ()
| Default Destructor.
bool | getReturnValue () const
| Returns the current thread execution return value.
void | setStartFunctPtr (TeThreadStartFunctT1 startFuncPtr)
| Change the internal thread start function pointer.
void | setStartFunctPtr (TeThreadStartFunctT2 startFuncPtr)
| Change the internal thread start function pointer.
void | setParameters (const TeThreadParameters &params)
| Sets the parameter that will be passed to the function after the thread startup.
void | setParametersPtr (void *userParamsPtr)
| Sets a pointer that will be passed to the function after the thread startup.

## Protected Member Functions

void | run ()
| Thread execution method: this method will be called when the thread starts. Subclasses must reimplement it.

## Protected Attributes

volatile bool | threadReturnValue_
| User function return value.
TeThreadParameters | threadUserParams_
| The current user parameters instance.
TeThreadStartFunctT1 | threadStartFuncPtr1_
| A pointer to the current user thread start function.
TeThreadStartFunctT2 | threadStartFuncPtr2_
| A pointer to the current user thread start function.
void * | userParamsPtr_
| A pointer to the current user thread start function parameters pointer.

## Detailed Description

A base class for thread in function style manner.

If you are interested in using TerraLib thread support in a function style model, you should create objects of this class by specifying a function to be called by the thread when it starts.
To start the thread, call start method, it is non-blocking.
If you want to use the thread support in a object oriented way, see TeThread class.

See also:
  TeThread

Author:
  Emiliano F. Castejon <castejon@dpi.inpe.br>
  Gilberto Ribeiro de Queiroz <gribeiro@dpi.inpe.br>

## Member Typedef Documentation

TeSharedPtr< TeThread > TeThreadFunctor::pointer

Type definition for an thread instance pointer.

typedef TeThreadStartFunctT1 TeThreadFunctor::TeThreadStartFunctT

Deprecated:
  Use TeThreadStartFunctT1.

typedef bool(* TeThreadFunctor::TeThreadStartFunctT1)(const TeThreadParameters &params)

Type definition for a thread start function pointer.

Parameters:

  params | The thread parameters.

Returns:
  true if OK, false on erros.

typedef bool(* TeThreadFunctor::TeThreadStartFunctT2)(void *userParamsPtr)

Type definition for a thread start function pointer.

Parameters:

  userParamsPtr | A pointer to anything required by the user.

Returns:
  true if OK, false on erros.

## Constructor & Destructor Documentation

TeThreadFunctor::TeThreadFunctor | ( |  | ) |

Default Constructor.

TeThreadFunctor::~TeThreadFunctor | ( |  | ) |

Default Destructor.

## Member Function Documentation

bool TeThreadFunctor::getReturnValue | ( |  | ) | const

Returns the current thread execution return value.

void TeThreadFunctor::run | ( |  | ) | `[protected, virtual]`

Thread execution method: this method will be called when the thread starts. Subclasses must reimplement it.

Implements TeThread.

void TeThreadFunctor::setParameters | ( | const TeThreadParameters & | params | ) |

Sets the parameter that will be passed to the function after the thread startup.

Parameters:

  params | The parameters to the thread function.

Note:
  The thread must be stopped before calling this method.

void TeThreadFunctor::setParametersPtr | ( | void * | userParamsPtr | ) |

Sets a pointer that will be passed to the function after the thread startup.

Parameters:

  userParamsPtr | The user parameters pointer.

Note:
  The thread must be stopped before calling this method.

void TeThreadFunctor::setStartFunctPtr | ( | TeThreadStartFunctT2 | startFuncPtr | ) |

Change the internal thread start function pointer.

Parameters:

  startFuncPtr | The new thread start function pointer.

Note:
  The thread mus be stopped for calling this method.

void TeThreadFunctor::setStartFunctPtr | ( | TeThreadStartFunctT1 | startFuncPtr | ) |

Change the internal thread start function pointer.

Parameters:

  startFuncPtr | The new thread start function pointer.

Note:
  The thread mus be stopped for calling this method.

## Member Data Documentation

volatile bool TeThreadFunctor::threadReturnValue_`[protected]`

User function return value.

TeThreadStartFunctT1 TeThreadFunctor::threadStartFuncPtr1_`[protected]`

A pointer to the current user thread start function.

TeThreadStartFunctT2 TeThreadFunctor::threadStartFuncPtr2_`[protected]`

A pointer to the current user thread start function.

TeThreadParameters TeThreadFunctor::threadUserParams_`[protected]`

The current user parameters instance.

void* TeThreadFunctor::userParamsPtr_`[protected]`

A pointer to the current user thread start function parameters pointer.

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeThreadFunctor.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeThreadFunctor.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines