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"
36#define vmonit( var ) vmon.add( #var, var )
321 public IONotifyController
327 const std::shared_ptr<IOConfig_XML>& ioconf,
328 const std::string& confname =
"" );
330 virtual ~SharedMemory();
333 static std::shared_ptr<SharedMemory>
init_smemory(
int argc,
const char*
const* argv );
336 static void help_print(
int argc,
const char*
const* argv );
341 virtual CORBA::Boolean exist()
override;
348 typedef std::deque<long> HBuffer;
355 inline void init(
size_t size,
long val )
358 buf.assign(size, val);
364 IOStateList::iterator ioit;
366 void add(
long val,
size_t size )
376 typedef std::list<HistoryItem> HistoryList;
382 ::clock_gettime(CLOCK_REALTIME, &fuse_tm);
388 std::string filter = {
"" };
390 bool fuse_invert = {
false };
391 bool fuse_use_val = {
false };
392 long fuse_val = { 0 };
393 timespec fuse_tm = { 0, 0 };
396 friend std::ostream& operator<<( std::ostream& os,
const HistoryInfo& h );
398 typedef std::list<HistoryInfo> History;
403 typedef std::list<History::iterator> HistoryItList;
404 typedef std::unordered_map<uniset::ObjectId, HistoryItList> HistoryFuseMap;
406 typedef sigc::signal<void, const HistoryInfo&> HistorySlot;
416 inline std::shared_ptr<LogAgregator> logAgregator()
420 inline std::shared_ptr<DebugStream> log()
426 typedef std::list<IOConfig_XML::ReaderSlot> ReadSlotList;
427 ReadSlotList lstRSlot;
431 virtual std::string
getTimerName(
int id)
const override;
434 void initFromReserv();
439 bool readItem(
const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec );
441 void buildEventList( xmlNode* cnode );
442 void readEventList(
const std::string& oname );
444 std::mutex mutexStart;
453 timer_running(
false),
459 IOStateList::iterator a_it;
460 IOStateList::iterator d_it;
480 int heartbeatCheckTime;
481 std::string heartbeat_node;
484 void checkHeartBeat();
486 typedef std::list<HeartBeatInfo> HeartBeatList;
487 HeartBeatList hblist;
488 std::shared_ptr<WDTInterface> wdt;
489 std::atomic_bool activated = {
false };
490 std::atomic_bool workready = {
false };
491 std::atomic_bool cancelled = {
false };
493 typedef std::list<uniset::ObjectId> EventList;
495 std::string e_filter;
501 bool dblogging = {
false };
514 virtual void checkFuse( std::shared_ptr<IOController::USensorInfo>& usi,
IOController* );
515 virtual void saveToHistory();
517 void buildHistoryList( xmlNode* cnode );
520 IOStateList::iterator itPulsar;
526 std::shared_ptr<LogAgregator> loga;
527 std::shared_ptr<DebugStream> smlog;
528 std::shared_ptr<LogServer> logserv;
529 std::string logserv_host = {
""};
530 int logserv_port = {0};
535 HistorySlot m_historySignal;
sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > ReaderSlot
Definition IOConfig_XML.h:65
Definition IOController.h:50
Пассивный таймер
Definition PassiveTimer.h:94
Definition MessageType.h:127
Definition SharedMemory.h:446
timeout_t reboot_msec
Definition SharedMemory.h:461
virtual void logging(uniset::SensorMessage &sm) override
сохранение информации об изменении состояния датчика
Definition SharedMemory.cc:630
HistoryFuseMap histmap
Definition SharedMemory.h:511
HistorySlot signal_history()
Definition SharedMemory.cc:752
virtual std::string getTimerName(int id) const override
Definition SharedMemory.cc:227
virtual bool deactivateObject() override
Definition SharedMemory.cc:309
static std::shared_ptr< SharedMemory > init_smemory(int argc, const char *const *argv)
Definition SharedMemory.cc:522
int getHistoryStep() const
Definition SharedMemory.h:408
static void help_print(int argc, const char *const *argv)
Definition SharedMemory.cc:32
virtual bool activateObject() override
Definition SharedMemory.cc:323
static const size_t udataHistory
Definition SharedMemory.h:508
Definition MessageType.h:171
Definition MessageType.h:214
static const timeout_t WaitUpTime
Definition PassiveTimer.h:69
Definition Calibration.h:27
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition SharedMemory.h:378
Definition SharedMemory.h:350
Definition UniSetTypes_i.idl:65