UniSet  2.8.0
LProcessor.h
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // --------------------------------------------------------------------------
17 #ifndef LProcessor_H_
18 #define LProcessor_H_
19 // --------------------------------------------------------------------------
108 // --------------------------------------------------------------------------
109 #include <list>
110 #include <atomic>
111 #include "UniSetTypes.h"
112 #include "UInterface.h"
113 #include "Element.h"
114 #include "Schema.h"
115 // --------------------------------------------------------------------------
116 namespace uniset
117 {
118  // --------------------------------------------------------------------------
120  {
121  public:
122  explicit LProcessor( const std::string& name = "" );
123  virtual ~LProcessor();
124 
125  void open( const std::string& lfile );
126 
127  bool isOpen() const;
128 
129  timeout_t getSleepTime() const noexcept;
130 
131  std::shared_ptr<SchemaXML> getSchema();
132 
133  virtual void execute( const std::string& lfile = "" );
134 
135  virtual void terminate();
136 
137  protected:
138 
139  virtual void build( const std::string& lfile );
140 
141  virtual void step();
142 
143  virtual void getInputs();
144  virtual void processing();
145  virtual void setOuts();
146 
147  struct EXTInfo
148  {
150  long value = { 0 };
151  std::shared_ptr<Element> el = { nullptr };
152  int numInput = { -1 };
153  };
154 
155  struct EXTOutInfo
156  {
158  std::shared_ptr<Element> el = { nullptr };
159  };
160 
161  typedef std::list<EXTInfo> EXTList;
162  typedef std::list<EXTOutInfo> OUTList;
163 
164  EXTList extInputs;
165  OUTList extOuts;
166 
167  std::shared_ptr<SchemaXML> sch;
168 
169  UInterface ui;
170  timeout_t sleepTime = { 200 };
171  timeout_t smReadyTimeout = { 120000 } ;
173  std::string logname = { "" };
174  std::atomic_bool canceled = {false};
175  std::string fSchema = {""};
176 
177  private:
178  };
179  // --------------------------------------------------------------------------
180 } // end of namespace uniset
181 // ---------------------------------------------------------------------------
182 #endif
virtual void getInputs()
Definition: LProcessor.cc:174
Definition: CommonEventLoop.h:14
timeout_t smReadyTimeout
Definition: LProcessor.h:171
Definition: UInterface.h:52
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
Definition: LProcessor.h:155
Definition: LProcessor.h:119
Definition: LProcessor.h:147
long ObjectId
Definition: UniSetTypes_i.idl:30