17 #ifndef SharedMemory_H_ 18 #define SharedMemory_H_ 20 #include <unordered_map> 25 #include "IONotifyController.h" 27 #include "PassiveTimer.h" 28 #include "WDTInterface.h" 29 #include "LogServer.h" 30 #include "DebugStream.h" 31 #include "LogAgregator.h" 33 #include "IOConfig_XML.h" 36 #define vmonit( var ) vmon.add( #var, var ) 332 const std::shared_ptr<IOConfig_XML>& ioconf,
333 const std::string& confname =
"" );
338 static std::shared_ptr<SharedMemory>
init_smemory(
int argc,
const char*
const* argv );
341 static void help_print(
int argc,
const char*
const* argv );
346 virtual CORBA::Boolean exist()
override;
353 typedef std::deque<long> HBuffer;
360 inline void init(
size_t size,
long val )
363 buf.assign(size, val);
369 IOStateList::iterator ioit;
371 void add(
long val,
size_t size )
381 typedef std::list<HistoryItem> HistoryList;
387 ::clock_gettime(CLOCK_REALTIME, &fuse_tm);
393 std::string filter = {
"" };
395 bool fuse_invert = {
false };
396 bool fuse_use_val = {
false };
397 long fuse_val = { 0 };
398 timespec fuse_tm = { 0, 0 };
401 friend std::ostream& operator<<( std::ostream& os,
const HistoryInfo& h );
403 typedef std::list<HistoryInfo> History;
408 typedef std::list<History::iterator> HistoryItList;
409 typedef std::unordered_map<uniset::ObjectId, HistoryItList> HistoryFuseMap;
411 typedef sigc::signal<void, const HistoryInfo&> HistorySlot;
421 inline std::shared_ptr<LogAgregator> logAgregator()
425 inline std::shared_ptr<DebugStream> log()
431 typedef std::list<IOConfig_XML::ReaderSlot> ReadSlotList;
432 ReadSlotList lstRSlot;
436 virtual std::string
getTimerName(
int id)
const override;
439 void initFromReserv();
444 bool readItem(
const std::shared_ptr<UniXML>& xml,
UniXML::iterator& it, xmlNode* sec );
446 void buildEventList( xmlNode* cnode );
447 void readEventList(
const std::string& oname );
449 std::mutex mutexStart;
458 timer_running(
false),
464 IOStateList::iterator a_it;
465 IOStateList::iterator d_it;
485 int heartbeatCheckTime;
486 std::string heartbeat_node;
489 void checkHeartBeat();
491 typedef std::list<HeartBeatInfo> HeartBeatList;
492 HeartBeatList hblist;
493 std::shared_ptr<WDTInterface> wdt;
494 std::atomic_bool activated = {
false };
495 std::atomic_bool workready = {
false };
496 std::atomic_bool cancelled = {
false };
498 typedef std::list<uniset::ObjectId> EventList;
500 std::string e_filter;
506 bool dblogging = {
false };
519 virtual void checkFuse( std::shared_ptr<IOController::USensorInfo>& usi,
IOController* );
520 virtual void saveToHistory();
522 void buildHistoryList( xmlNode* cnode );
525 IOStateList::iterator itPulsar;
531 std::shared_ptr<LogAgregator> loga;
532 std::shared_ptr<DebugStream> smlog;
533 std::shared_ptr<LogServer> logserv;
534 std::string logserv_host = {
""};
535 int logserv_port = {0};
540 HistorySlot m_historySignal;
545 #endif // SharedMemory_H_ Пассивный таймер
Definition: PassiveTimer.h:92
HistoryFuseMap histmap
Definition: SharedMemory.h:517
Definition: CallbackTimer.h:29
Definition: SharedMemory.h:355
Definition: SharedMemory.h:451
virtual std::string getTimerName(int id) const override
Definition: SharedMemory.cc:227
virtual bool activateObject() override
Definition: SharedMemory.cc:323
timeout_t reboot_msec
Definition: SharedMemory.h:467
Definition: MessageType.h:168
Definition: VMonitor.h:116
Definition: SharedMemory.h:325
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > ReaderSlot
Definition: IOConfig_XML.h:65
int getHistoryStep() const
Definition: SharedMemory.h:414
Definition: IONotifyController.h:132
Definition: MessageType.h:124
virtual void logging(uniset::SensorMessage &sm) override
сохранение информации об изменении состояния датчика
Definition: SharedMemory.cc:630
Definition: SharedMemory.h:383
Definition: MessageType.h:211
HistorySlot signal_history()
Definition: SharedMemory.cc:752
static const size_t udataHistory
Definition: SharedMemory.h:514
virtual bool deactivateObject() override
Definition: SharedMemory.cc:309
Definition: IOController.h:45
static std::shared_ptr< SharedMemory > init_smemory(int argc, const char *const *argv)
Definition: SharedMemory.cc:522
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