23 #ifndef UniSetObject_H_
24 #define UniSetObject_H_
26 #include <condition_variable>
35 #include "UniSetTypes.h"
36 #include "MessageType.h"
37 #include "PassiveTimer.h"
38 #include "Exceptions.h"
39 #include "UInterface.h"
40 #include "UniSetObject_i.hh"
41 #include "ThreadCreator.h"
42 #include "LT_Object.h"
44 #include "UHttpRequestHandler.h"
50 class UniSetActivator;
55 typedef std::list< std::shared_ptr<UniSetObject> >
ObjectsList;
74 public std::enable_shared_from_this<UniSetObject>,
75 public POA_UniSetObject_i,
77 #ifndef DISABLE_REST_API
82 UniSetObject(
const std::string& name,
const std::string& section );
87 std::shared_ptr<UniSetObject> get_ptr();
90 virtual CORBA::Boolean exist()
override;
95 std::string getName()
const;
102 const std::string getStrType();
112 #ifndef DISABLE_REST_API
114 virtual Poco::JSON::Object::Ptr httpGet(
const Poco::URI::QueryParameters& p )
override;
115 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
123 uniset::Message::Priority p = uniset::Message::High )
override;
125 friend std::ostream& operator<<(std::ostream& os,
UniSetObject& obj );
129 std::shared_ptr<UInterface>
ui;
132 std::weak_ptr<UniSetManager> mymngr;
168 virtual void sigterm(
int signo );
175 void thread(
bool create );
205 #ifndef DISABLE_REST_API
207 virtual Poco::JSON::Object::Ptr httpGetMyInfo( Poco::JSON::Object::Ptr root );
208 Poco::JSON::Object::Ptr request_conf(
const std::string& req,
const Poco::URI::QueryParameters& p );
209 Poco::JSON::Object::Ptr request_conf_name(
const std::string& name,
const std::string& props );
214 friend class UniSetManager;
215 friend class UniSetActivator;
220 bool init(
const std::weak_ptr<UniSetManager>& om );
228 void unregistration();
232 pid_t msgpid = { 0 };
233 bool regOK = {
false };
234 std::atomic_bool active;
237 std::shared_ptr<UniSetTimer> tmr;
239 CORBA::Object_var oref;
244 std::shared_ptr< ThreadCreator<UniSetObject> > thr;
248 MQMutex mqueueMedium;
251 std::atomic_bool a_working;
252 std::mutex m_working;
253 std::condition_variable cv_working;