Program Listing for File monitor.hpp

Return to documentation for file (monitor.hpp)

#ifndef FELIX_MONITOR_H_
#define FELIX_MONITOR_H_

#include <time.h>
#include <sys/timerfd.h>
#include <climits>
#include <sys/types.h>
#include <sys/stat.h>
#include <cstdint>
#include <string>

#include <nlohmann/json.hpp>

class Monitor
{
    public:

        explicit Monitor(std::string& fifoname);

        ~Monitor();
        Monitor(Monitor&&) = delete;
        Monitor& operator=(Monitor&&) = delete;

        std::string get_serialized_message();

        void write_message();

    protected:
        nlohmann::json m_message;

    private:
        int m_fifo_fd;
        bool is_fifo(const char *filename);
};

#endif /* FELIX_MONITOR_H_ */