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 
34 namespace 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();
57 
58  virtual void startAsync(OperationThreadManagerListener* listener);
59 
60  virtual void stop();
61 
62  virtual void setTask(te::common::TaskProgress* task);
63 
64  virtual AbstractOperation* getOperation() const;
65 
66  protected:
67 
69 
70  void stopThread();
71 
72  protected:
73 
74  std::unique_ptr<AbstractOperation> m_operation;
75  std::unique_ptr<AbstractDataHandler> m_dataHandler;
76  std::thread* m_thread;
78  };
79  }
80 }
81 
82 #endif //__TERRALIB_VP_INTERNAL_OPERATIONTHREADMANAGER_H
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::vp::OperationThreadManager::stop
virtual void stop()
te::vp::OperationThreadManager
Definition: OperationThreadManager.h:48
te::vp::OperationThreadManager::OperationThreadManager
OperationThreadManager(AbstractOperation *operation, AbstractDataHandler *dataHandler)
Default constructor.
te::vp::OperationThreadManager::m_operation
std::unique_ptr< AbstractOperation > m_operation
Definition: OperationThreadManager.h:74
te::vp::OperationThreadManager::m_task
te::common::TaskProgress * m_task
Definition: OperationThreadManager.h:77
te::vp::OperationThreadManager::stopThread
void stopThread()
te::vp::OperationThreadManager::m_thread
std::thread * m_thread
Definition: OperationThreadManager.h:76
te::vp::OperationThreadManager::getOperation
virtual AbstractOperation * getOperation() const
te::vp::OperationThreadManager::~OperationThreadManager
virtual ~OperationThreadManager()
Virtual destructor.
te::vp::OperationThreadManager::setTask
virtual void setTask(te::common::TaskProgress *task)
TEVPEXPORT
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
te::vp::OperationThreadManager::m_dataHandler
std::unique_ptr< AbstractDataHandler > m_dataHandler
Definition: OperationThreadManager.h:75
te::vp::OperationThreadManager::startImpl
void startImpl(te::vp::OperationThreadManagerListener *listener)
te::vp::OperationThreadManager::start
virtual void start()
te::vp::AbstractDataHandler
This abstract class represents handler to help reading and writing data from/to a dataSource by divid...
Definition: AbstractDataHandler.h:63
te::common::TaskProgress
This class can be used to inform the progress of a task.
Definition: TaskProgress.h:54
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
te::vp::OperationThreadManagerListener
Definition: OperationThreadManagerListener.h:43
te::vp::AbstractOperation
Abstract class used to define an operation.
Definition: AbstractOperation.h:204
te::vp::OperationThreadManager::startAsync
virtual void startAsync(OperationThreadManagerListener *listener)