17#ifndef SharedMemory_H_
18#define SharedMemory_H_
20#include <unordered_map>
25#include "IONotifyController.h"
27#include "PassiveTimer.h"
28#include "WDTInterface.h"
30#include "DebugStream.h"
31#include "LogAgregator.h"
33#include "IOConfig_XML.h"
34#include "USingleProcess.h"
37#define vmonit( var ) vmon.add( #var, var )
53 const std::shared_ptr<IOConfig_XML>& ioconf );
58 static std::shared_ptr<SharedMemory>
init_smemory(
int argc,
const char*
const* argv );
61 static void help_print(
int argc,
const char*
const* argv );
66 virtual CORBA::Boolean exist()
override;
73 typedef std::deque<long> HBuffer;
80 inline void init(
size_t size,
long val )
83 buf.assign(size, val);
89 IOStateList::iterator ioit;
91 void add(
long val,
size_t size )
101 typedef std::list<HistoryItem> HistoryList;
107 ::clock_gettime(CLOCK_REALTIME, &fuse_tm);
113 std::string filter = {
"" };
115 bool fuse_invert = {
false };
116 bool fuse_use_val = {
false };
117 long fuse_val = { 0 };
118 timespec fuse_tm = { 0, 0 };
121 friend std::ostream& operator<<( std::ostream& os,
const HistoryInfo& h );
123 typedef std::list<HistoryInfo> History;
128 typedef std::list<History::iterator> HistoryItList;
129 typedef std::unordered_map<uniset::ObjectId, HistoryItList> HistoryFuseMap;
131 typedef sigc::signal<void, const HistoryInfo&> HistorySlot;
141 inline std::shared_ptr<LogAgregator> logAgregator()
145 inline std::shared_ptr<DebugStream> log()
151 typedef std::list<IOConfig_XML::ReaderSlot> ReadSlotList;
152 ReadSlotList lstRSlot;
156 virtual std::string
getTimerName(
int id)
const override;
159 void initFromReserv();
165 bool readItem(
const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec );
167 void buildEventList( xmlNode* cnode );
168 void readEventList(
const std::string& oname );
170 std::mutex mutexStart;
179 timer_running(
false),
185 IOStateList::iterator a_it;
186 IOStateList::iterator d_it;
206 int heartbeatCheckTime;
207 std::string heartbeat_node;
210 void checkHeartBeat();
212 typedef std::list<HeartBeatInfo> HeartBeatList;
213 HeartBeatList hblist;
214 std::shared_ptr<WDTInterface> wdt;
215 std::atomic_bool activated = {
false };
216 std::atomic_bool workready = {
false };
217 std::atomic_bool cancelled = {
false };
219 typedef std::list<uniset::ObjectId> EventList;
221 std::string e_filter;
227 bool dblogging = {
false };
240 virtual void checkFuse( std::shared_ptr<IOController::USensorInfo>& usi,
IOController* );
241 virtual void saveToHistory();
243 void buildHistoryList( xmlNode* cnode );
246 IOStateList::iterator itPulsar;
252 std::shared_ptr<LogAgregator> loga;
253 std::shared_ptr<DebugStream> smlog;
254 std::shared_ptr<LogServer> logserv;
255 std::string logserv_host = {
""};
256 int logserv_port = {0};
260#ifndef DISABLE_REST_API
261 Poco::JSON::Object::Ptr buildLogServerInfo();
262 virtual Poco::JSON::Object::Ptr httpRequest(
const UHttp::HttpRequestContext& ctx )
override;
263 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
264 virtual Poco::JSON::Object::Ptr httpGetMyInfo( Poco::JSON::Object::Ptr root )
override;
268 HistorySlot m_historySignal;
sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > ReaderSlot
Definition IOConfig_XML.h:71
Definition IOController.h:52
Definition IONotifyController.h:135
Пассивный таймер
Definition PassiveTimer.h:94
Definition MessageType.h:127
Definition SharedMemory.h:173
timeout_t reboot_msec
Definition SharedMemory.h:188
Definition SharedMemory.h:47
virtual void logging(uniset::SensorMessage &sm) override
сохранение информации об изменении состояния датчика
Definition SharedMemory.cc:720
HistoryFuseMap histmap
Definition SharedMemory.h:238
HistorySlot signal_history()
Definition SharedMemory.cc:842
virtual std::string getTimerName(int id) const override
Definition SharedMemory.cc:272
virtual bool deactivateObject() override
Definition SharedMemory.cc:357
static std::shared_ptr< SharedMemory > init_smemory(int argc, const char *const *argv)
Definition SharedMemory.cc:600
int getHistoryStep() const
Definition SharedMemory.h:134
static void help_print(int argc, const char *const *argv)
Definition SharedMemory.cc:32
virtual bool activateObject() override
Definition SharedMemory.cc:371
static const size_t udataHistory
Definition SharedMemory.h:235
Definition MessageType.h:171
Definition MessageType.h:214
Definition USingleProcess.h:28
static const timeout_t WaitUpTime
Definition PassiveTimer.h:69
Definition AccessConfig.h:30
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition SharedMemory.h:104
Definition SharedMemory.h:76
Definition UniSetTypes_i.idl:65