17 #ifndef SharedMemory_H_
18 #define SharedMemory_H_
20 #include <unordered_map>
25 #include "IONotifyController.h"
27 #include "PassiveTimer.h"
28 #include "NCRestorer.h"
29 #include "WDTInterface.h"
30 #include "LogServer.h"
31 #include "DebugStream.h"
32 #include "LogAgregator.h"
36 #define vmonit( var ) vmon.add( #var, var )
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<Restorer_XML::ReaderSlot> ReadSlotList;
427 ReadSlotList lstRSlot;
431 virtual void askSensors( UniversalIO::UIOCommand cmd ) {};
433 void initFromReserv();
437 virtual void sigterm(
int signo )
override;
440 bool readItem(
const std::shared_ptr<UniXML>& xml, UniXML::iterator& it, xmlNode* sec );
442 void buildEventList( xmlNode* cnode );
443 void readEventList(
const std::string& oname );
445 std::mutex mutexStart;
454 timer_running(
false),
460 IOStateList::iterator a_it;
461 IOStateList::iterator d_it;
481 int heartbeatCheckTime;
482 std::string heartbeat_node;
485 void checkHeartBeat();
487 typedef std::list<HeartBeatInfo> HeartBeatList;
488 HeartBeatList hblist;
489 std::shared_ptr<WDTInterface> wdt;
490 std::atomic_bool activated;
491 std::atomic_bool workready;
493 typedef std::list<uniset::ObjectId> EventList;
495 std::string e_filter;
503 bool dblogging = {
false };
516 virtual void checkFuse( std::shared_ptr<IOController::USensorInfo>& usi,
IOController* );
517 virtual void saveToHistory();
519 void buildHistoryList( xmlNode* cnode );
522 IOStateList::iterator itPulsar;
528 std::shared_ptr<LogAgregator> loga;
529 std::shared_ptr<DebugStream> smlog;
530 std::shared_ptr<LogServer> logserv;
531 std::string logserv_host = {
""};
532 int logserv_port = {0};
537 HistorySlot m_historySignal;
542 #endif // SharedMemory_H_
Пассивный таймер
Definition: PassiveTimer.h:90
HistoryFuseMap histmap
Definition: SharedMemory.h:514
Definition: IONotifyController.h:194
virtual void dumpOrdersList(const uniset::ObjectId sid, const IONotifyController::ConsumerListInfo &lst) override
Definition: SharedMemory.h:500
Definition: CallbackTimer.h:29
virtual void sigterm(int signo) override
Definition: SharedMemory.cc:350
Definition: SharedMemory.h:350
int getHistoryStep() const
Definition: SharedMemory.h:409
Definition: SharedMemory.h:447
virtual bool activateObject() override
Definition: SharedMemory.cc:296
timeout_t reboot_msec
Definition: SharedMemory.h:463
Definition: MessageType.h:166
Definition: SharedMemory.h:325
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:56
Definition: IONotifyController.h:131
virtual void dumpThresholdList(const uniset::ObjectId sid, const IONotifyController::ThresholdExtList &lst) override
Definition: SharedMemory.h:501
Definition: MessageType.h:122
virtual void logging(uniset::SensorMessage &sm) override
сохранение информации об изменении состояния датчика
Definition: SharedMemory.cc:611
std::list< ThresholdInfoExt > ThresholdExtList
Definition: IONotifyController.h:263
sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > ReaderSlot
Definition: Restorer.h:51
Definition: SharedMemory.h:378
Definition: MessageType.h:209
HistorySlot signal_history()
Definition: SharedMemory.cc:733
static const size_t udataHistory
Definition: SharedMemory.h:511
virtual bool deactivateObject() override
Definition: SharedMemory.cc:286
Definition: IOController.h:37
static std::shared_ptr< SharedMemory > init_smemory(int argc, const char *const *argv)
Definition: SharedMemory.cc:508
Definition: UniSetTypes_i.idl:64
long ObjectId
Definition: UniSetTypes_i.idl:30
static void help_print(int argc, const char *const *argv)
Definition: SharedMemory.cc:32
static const timeout_t WaitUpTime
Definition: PassiveTimer.h:69