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_