Loading...
Searching...
No Matches
OperationThreadManager.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20 /*!
21 \file terralin/vp/OperationThreadManager.h
22
23 \brief This class represents a vector processing engine to help the processing of a large number of geometries by dividing it into smallers groups
24 */
25
26#ifndef __TERRALIB_VP_INTERNAL_OPERATIONTHREADMANAGER_H
27#define __TERRALIB_VP_INTERNAL_OPERATIONTHREADMANAGER_H
28
29#include "Config.h"
30
31#include <memory>
32#include <thread>
33
34namespace te
35{
36 namespace common
37 {
38 class TaskProgress;
39 }
40
41 namespace vp
42 {
43 class AbstractDataHandler;
44 class AbstractOperation;
45 class OperationThreadManagerListener;
46
48 {
49 public:
50 /*! \brief Default constructor. */
52
53 /*! \brief Virtual destructor. */
55
56 virtual void start( const bool useThreads = true );
57
59
60 virtual void stop();
61
62 virtual void setTask(te::common::TaskProgress* task);
63
65
66 protected:
67
68 std::unique_ptr<AbstractOperation> m_operation;
69 std::unique_ptr<AbstractDataHandler> m_dataHandler;
70 std::thread* m_thread;
72
73 void startImpl(te::vp::OperationThreadManagerListener* listener, const bool useThreads );
74
75 void stopThread();
76
78 te::vp::AbstractDataHandler* dataHandler, std::size_t groupIndex,
79 te::common::TaskProgress* taskProgress);
80
81
82 };
83 }
84}
85
86#endif //__TERRALIB_VP_INTERNAL_OPERATIONTHREADMANAGER_H
This class can be used to inform the progress of a task.
This abstract class represents handler to help reading and writing data from/to a dataSource by divid...
Abstract class used to define an operation.
virtual void start(const bool useThreads=true)
virtual void startAsync(OperationThreadManagerListener *listener)
static void ExecuteOperation(te::vp::AbstractOperation *operation, te::vp::AbstractDataHandler *dataHandler, std::size_t groupIndex, te::common::TaskProgress *taskProgress)
te::common::TaskProgress * m_task
virtual ~OperationThreadManager()
Virtual destructor.
void startImpl(te::vp::OperationThreadManagerListener *listener, const bool useThreads)
std::unique_ptr< AbstractDataHandler > m_dataHandler
OperationThreadManager(AbstractOperation *operation, AbstractDataHandler *dataHandler)
Default constructor.
std::unique_ptr< AbstractOperation > m_operation
virtual AbstractOperation * getOperation() const
virtual void setTask(te::common::TaskProgress *task)
TerraLib.
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition Config.h:61
Proxy configuration file for TerraView (see terraview_config.h).