ProcessManager.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 terralib/process/qt/ProcessManager.h
22 
23  \brief A QObject class to handle with process management
24 */
25 
26 #ifndef __TERRALIB_PROCESS_QT_INTERNAL_PROCESSMANAGER_H
27 #define __TERRALIB_PROCESS_QT_INTERNAL_PROCESSMANAGER_H
28 
29 
31 
32 #include "../Config.h"
33 #include "../Task.h"
34 
35 // Qt Includes
36 #include <QObject>
37 
38 // STL Includes
39 #include <map>
40 #include <string>
41 
42 namespace te
43 {
44  namespace process
45  {
46  class Process;
47 
48  namespace qt
49  {
50  /*!
51  \class ProcessManager
52 
53  \brief A QObject class to handle with process management
54 
55  */
56  class TEPROCESSEXPORT ProcessManager : public QObject
57  {
58  Q_OBJECT
59 
60  public:
61 
62  /*! \brief Default constructor. */
63  ProcessManager(QObject *parent = nullptr);
64 
65  /*! \brief Virtual destructor. */
67 
68  public:
69 
70  void start();
71 
72  void reset();
73 
75 
76  std::string createTask(const std::string& taskType);
77 
78  void removeTask(const std::string& id);
79 
80  void resetTaskId(const std::string& id, const std::string& newId);
81 
82  std::string createConnector(const std::string& taskFrom, std::size_t paramIndexFrom, const std::string& taskTo, std::size_t paramIndexTo);
83 
84  void removeConnector(const std::string& id);
85 
86  Process* getProcess() const;
87 
88  /*! \brief Function used to check if a name is a valid item name. */
89  bool isProcessItemNameValid(const std::string& itemType, const std::string& itemName);
90 
91  std::unique_ptr<TaskGraphicalCapabilities> getTaskGraphicalCapabilities(const std::string& taskType);
92 
93  protected:
94 
95  /*! \brief Function used to generate a valid item name. */
96  std::string createProcessItemName(const std::string& itemType);
97 
98  signals:
99 
100  void createdTask(const std::string& id);
101 
102  void removedTask(const std::string& id);
103 
104  void resetedTaskId(const std::string& id, const std::string& newId);
105 
106  void createdConnector(const std::string& id);
107 
108  void removedConnector(const std::string& id);
109 
110  protected:
111 
113 
114  std::map<std::string, int> m_processItemMapCount;
115  };
116  }
117  }
118 }
119 
120 #endif // __TERRALIB_PROCESS_QT_INTERNAL_PROCESSMANAGER_H
A QObject class to handle with process management.
void removedConnector(const std::string &id)
void removedTask(const std::string &id)
void resetedTaskId(const std::string &id, const std::string &newId)
void createdTask(const std::string &id)
bool isProcessItemNameValid(const std::string &itemType, const std::string &itemName)
Function used to check if a name is a valid item name.
std::string createProcessItemName(const std::string &itemType)
Function used to generate a valid item name.
~ProcessManager()
Virtual destructor.
void createdConnector(const std::string &id)
std::string createConnector(const std::string &taskFrom, std::size_t paramIndexFrom, const std::string &taskTo, std::size_t paramIndexTo)
std::unique_ptr< TaskGraphicalCapabilities > getTaskGraphicalCapabilities(const std::string &taskType)
ProcessManager(QObject *parent=nullptr)
Default constructor.
std::string addTask(te::process::TaskSharedPtr task)
void resetTaskId(const std::string &id, const std::string &newId)
void removeConnector(const std::string &id)
void removeTask(const std::string &id)
std::string createTask(const std::string &taskType)
std::map< std::string, int > m_processItemMapCount
TerraLib.
#define TEPROCESSEXPORT
Definition: Config.h:47