| TerraLib 4.1

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

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeThreadFunctor.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00029 #ifndef __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
    00030 #define __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
    00031
    00032 #include "TeThread.h"
    00033 #include "TeThreadParameters.h"
    00034 #include "TeSharedPtr.h"
    00035 #include "TeDefines.h"
    00036
    00057 class TL_DLL TeThreadFunctor : public TeThread
    00058 {
    00059            public:
    00060
    00065     typedef bool (*TeThreadStartFunctT1)( const TeThreadParameters& params );
    00066
    00071     typedef bool (*TeThreadStartFunctT2)( void* userParamsPtr );
    00072
    00074     typedef TeThreadStartFunctT1 TeThreadStartFunctT;
    00075
    00079     typedef TeSharedPtr< TeThreadFunctor > pointer;
    00080
    00083     TeThreadFunctor();
    00084
    00087     ~TeThreadFunctor();
    00088
    00091     bool getReturnValue() const;
    00092
    00097     void setStartFunctPtr( TeThreadStartFunctT1 startFuncPtr );
    00098
    00103     void setStartFunctPtr( TeThreadStartFunctT2 startFuncPtr );
    00104
    00110     void setParameters(const TeThreadParameters& params);
    00111
    00117     void setParametersPtr( void* userParamsPtr );
    00118
    00119            protected:
    00120
    00121                       // Overloaded method from TeThread.
    00122                       void run();
    00123
    00124            protected:
    00125
    00126                       volatile bool threadReturnValue_;
    00127     TeThreadParameters threadUserParams_;
    00128     TeThreadStartFunctT1 threadStartFuncPtr1_;
    00129     TeThreadStartFunctT2 threadStartFuncPtr2_;
    00130     void* userParamsPtr_;
    00131 };
    00132
    00133 #endif     // __TERRALIB_INTERNAL_TETRHEADFUNCTOR_H
    00134

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines