UniSet 2.45.1
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// --------------------------------------------------------------------------
22// --------------------------------------------------------------------------
23// Documentation moved to extensions/JScript/README.md
24// --------------------------------------------------------------------------
25// --------------------------------------------------------------------------
26#include "JSProxy_SK.h"
27#include "JSEngine.h"
28#include "USingleProcess.h"
29// --------------------------------------------------------------------------
30namespace uniset
31{
32 // ----------------------------------------------------------------------
33 class JSProxy final:
34 private USingleProcess,
35 public JSProxy_SK
36 {
37 public:
38 explicit JSProxy( uniset::ObjectId id
39 , xmlNode* confnode = uniset::uniset_conf()->getNode("JSProxy")
40 , const std::string& prefix = "js" );
41 ~JSProxy() override;
42
43 static std::shared_ptr<JSProxy> init( int argc, const char* const* argv, const std::string& prefix = "js" );
44 static void help_print();
45
46 protected:
47
48 virtual void callback() noexcept override;
49 virtual void step() override;
50 virtual void sysCommand(const uniset::SystemMessage* sm) override;
51 virtual bool deactivateObject() override;
52 virtual void askSensors( UniversalIO::UIOCommand cmd) override;
53 virtual void sensorInfo(const uniset::SensorMessage* sm) override;
54 // virtual std::string getMonitInfo() const override;
55
56 private:
57 std::shared_ptr<JSEngine> js;
58 };
59 // ----------------------------------------------------------------------
60} // end of namespace uniset
61// --------------------------------------------------------------------------
62#endif
xmlNode * confnode
Определения JSProxy_SK.h:215
virtual void callback() noexcept override
Определения JSProxy.cc:178
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы).
Определения JSProxy.cc:220
Определения MessageType.h:127
Определения MessageType.h:171
Определения Calibration.h:27
std::shared_ptr< Configuration > uniset_conf() noexcept
Определения Configuration.cc:106
long ObjectId
Определения UniSetTypes_i.idl:30