UniSet @VERSION@
JSProxy.h
1/*
2 * Copyright (c) 2025 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 JSProxy_H_
18#define JSProxy_H_
19// --------------------------------------------------------------------------
219// --------------------------------------------------------------------------
220#include "JSProxy_SK.h"
221#include "JSEngine.h"
222#include "USingleProcess.h"
223// --------------------------------------------------------------------------
224namespace uniset
225{
226 // ----------------------------------------------------------------------
227 class JSProxy final:
228 private USingleProcess,
229 public JSProxy_SK
230 {
231 public:
232 explicit JSProxy( uniset::ObjectId id
233 , xmlNode* confnode = uniset::uniset_conf()->getNode("JSProxy")
234 , const std::string& prefix = "js" );
235 ~JSProxy() override;
236
237 static std::shared_ptr<JSProxy> init( int argc, const char* const* argv, const std::string& prefix = "js" );
238 static void help_print();
239
240 protected:
241
242 virtual void callback() noexcept override;
243 virtual void step() override;
244 virtual void sysCommand(const uniset::SystemMessage* sm) override;
245 virtual bool deactivateObject() override;
246 virtual void askSensors( UniversalIO::UIOCommand cmd) override;
247 virtual void sensorInfo(const uniset::SensorMessage* sm) override;
248 // virtual std::string getMonitInfo() const override;
249
250 private:
251 std::shared_ptr<JSEngine> js;
252 };
253 // ----------------------------------------------------------------------
254} // end of namespace uniset
255// --------------------------------------------------------------------------
256#endif
Definition JSProxy.h:230
Definition MessageType.h:127
Definition MessageType.h:171
Definition USingleProcess.h:28
Definition AccessConfig.h:30
std::shared_ptr< Configuration > uniset_conf() noexcept
Definition Configuration.cc:106
long ObjectId
Definition UniSetTypes_i.idl:30