22 #ifndef IONotifyController_H_
23 #define IONotifyController_H_
26 #include <unordered_map>
30 #include "UniSetTypes.h"
31 #include "IOController_i.hh"
32 #include "IOController.h"
133 public POA_IONotifyController_i
137 IONotifyController(
const std::string& name,
const std::string& section, std::shared_ptr<NCRestorer> dumper =
nullptr );
153 CORBA::Long lowLimit, CORBA::Long hiLimit, CORBA::Boolean invert,
154 UniversalIO::UIOCommand cmd )
override;
158 virtual IONotifyController_i::ThresholdsListSeq* getThresholdsList()
override;
165 #ifndef DISABLE_REST_API
167 virtual Poco::JSON::Object::Ptr httpHelp(
const Poco::URI::QueryParameters& p )
override;
168 virtual Poco::JSON::Object::Ptr httpRequest(
const string& req,
const Poco::URI::QueryParameters& p )
override;
177 UniSetObject_i_ptr ref = 0,
size_t maxAttemtps = 10 ):
179 ref(ref), attempt(maxAttemtps) {}
181 UniSetObject_i_var ref;
183 size_t lostEvents = { 0 };
184 size_t smCount = { 0 };
192 typedef std::list<ConsumerInfoExt> ConsumerList;
207 typedef std::unordered_map<uniset::ObjectId, ConsumerListInfo>
AskMap;
230 IOController::IOStateList::iterator
sit;
235 inline bool operator== (
const ThresholdInfo& r )
const
237 return ((
id == r.id) &&
240 (invert == r.invert) );
256 ThresholdInfoExt(
const ThresholdInfoExt& ) =
delete;
257 ThresholdInfoExt& operator=(
const ThresholdInfoExt& ) =
delete;
258 ThresholdInfoExt( ThresholdInfoExt&& ) =
default;
259 ThresholdInfoExt& operator=(ThresholdInfoExt&& ) =
default;
269 UniversalIO::IOType t = UniversalIO::AI ):
270 si(si), type(t),
list( std::move(
list) ) {}
275 std::shared_ptr<USensorInfo> usi;
276 UniversalIO::IOType type = { UniversalIO::AI };
286 virtual void initItem(std::shared_ptr<USensorInfo>& usi,
IOController* ic );
311 std::shared_ptr<NCRestorer> restorer;
316 virtual long localSetValue( std::shared_ptr<USensorInfo>& usi,
323 udataConsumerList = 0,
324 udataThresholdList = 1
327 #ifndef DISABLE_REST_API
329 Poco::JSON::Object::Ptr request_consumers(
const std::string& req,
const Poco::URI::QueryParameters& p );
330 Poco::JSON::Object::Ptr request_lost(
const string& req,
const Poco::URI::QueryParameters& p );
331 Poco::JSON::Object::Ptr getConsumers(
uniset::ObjectId sid, ConsumerListInfo& clist,
bool ifNotEmpty =
true );
358 sigc::connection conInit;
359 sigc::connection conUndef;
364 std::mutex lostConsumersMutex;
366 struct LostConsumerInfo
368 size_t count = { 0 };
369 bool lost = {
false };
379 std::unordered_map<uniset::ObjectId, LostConsumerInfo> lostConsumers;