/*******************************************************************************
################################################################################
-# Copyright (c) [2020] [HCL Technologies Ltd.] #
+# Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
################################################################################
*******************************************************************************/
-/* Class for global defines and constants for O1 interface */
+/* This file contains the O1App class which is responsible for running/starting
+ all the O1 modules in a thread. It inherits the Thread class and Singleton
+ class.
+*/
-#ifndef __GLOBAL_DEFS_H__
-#define __GLOBAL_DEFS_H__
+#ifndef __O1_APP_HPP__
+#define __O1_APP_HPP__
-#include <syslog.h>
+#include "Singleton.hpp"
+#include "Thread.hpp"
+#include "UnixSocketServer.hpp"
-#define O1_LOG(...) ({\
- printf(__VA_ARGS__);\
- syslog(LOG_DEBUG,__VA_ARGS__);\
- })
-#define TCP_PORT 8282
-#define TCP_SERVER_IP "127.0.0.1"
-#define CELL_UP_ALARM_ID 1009
-#define CELL_DOWN_ALARM_ID 1010
+class O1App : public Singleton<O1App>, public Thread
+{
+ friend Singleton<O1App>;
+
+ private:
+ bool mStartupStatus;
+ UnixSocketServer mUxSocketServer;
-#endif
+ protected:
+ bool run();
+
+ public:
+ O1App();
+ ~O1App();
+ bool getStartupStatus()const;
+ void cleanUp(void);
+};
-/**********************************************************************
- End of file
-**********************************************************************/
+
+#endif