UniSet @VERSION@
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 <vector>
110#include <atomic>
111#include "UniSetTypes.h"
112#include "UInterface.h"
113#include "Element.h"
114#include "Schema.h"
115#include "USingleProcess.h"
116// --------------------------------------------------------------------------
117namespace uniset
118{
119 // --------------------------------------------------------------------------
121 private USingleProcess
122 {
123 public:
124 explicit LProcessor( const std::string& name, xmlNode* cnode );
125 virtual ~LProcessor();
126
127 void open( const std::string& lfile );
128
129 bool isOpen() const;
130
131 timeout_t getSleepTime() const noexcept;
132
133 std::shared_ptr<SchemaXML> getSchema();
134
135 virtual void execute( const std::string& lfile = "" );
136
137 virtual void terminate();
138
139 protected:
140
141 virtual void build( const std::string& lfile );
142
143 virtual void step();
144
145 virtual void getInputs();
146 virtual void processing();
147 virtual void setOuts();
148
149 struct EXTInfo
150 {
152 long value = { 0 };
153 std::shared_ptr<Element> el = { nullptr };
154 int numInput = { -1 };
155 };
156
158 {
160 std::shared_ptr<Element> el = { nullptr };
161 };
162
163 typedef std::vector<EXTInfo> EXTList;
164 typedef std::vector<EXTOutInfo> OUTList;
165
166 EXTList extInputs;
167 OUTList extOuts;
168
169 std::shared_ptr<SchemaXML> sch;
170
171 UInterface ui;
172 timeout_t sleepTime = { 200 };
173 timeout_t smReadyTimeout = { 120000 } ;
175 std::string logname = { "" };
176 std::atomic_bool canceled = {false};
177 std::string fSchema = {""};
178
179 private:
180 };
181 // --------------------------------------------------------------------------
182} // end of namespace uniset
183// ---------------------------------------------------------------------------
184#endif
Definition LProcessor.h:122
timeout_t smReadyTimeout
Definition LProcessor.h:173
virtual void getInputs()
Definition LProcessor.cc:175
Definition UInterface.h:55
Definition USingleProcess.h:28
Definition AccessConfig.h:30
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition LProcessor.h:150
Definition LProcessor.h:158