21 Worker(parent, name.c_str()),
40 DOUT2(
"ModuleItem:%p start destructor",
this);
46 DOUT2(
"ModuleItem:%p did destructor",
this);
70 while (!parent.
null()) {
72 if (!module.
null())
return module;
109 if ((fPeriod>0.) && !IsSysTimer())
110 ActivateTimeout(fPeriod);
118 if (!IsSysTimer()) ActivateTimeout(-1);
124 if (!fActive)
return -1.;
134 if (!fSynhron)
return fPeriod;
136 fInaccuracy += (last_diff - fPeriod);
138 double res = fPeriod - fInaccuracy;
139 if (res < 0) res = 0;
165 if (port.
null())
return -1.;
167 std::string itemname = port.
ItemName();
169 if (!port()->IsDoingReconnect())
return -1;
174 port()->SetDoingReconnect(
false);
179 if (!port()->TryNextReconnect(fErrorFlag))
return -1;
181 return port()->GetReconnectPeriod() > 0 ? port()->GetReconnectPeriod() : 1.;
ConnTimer(Reference parent, const std::string &name, const std::string &portname)
virtual double ProcessTimeout(double last_diff)
bool CreateTransport(const std::string &portname, const std::string &transportkind="", const std::string &thrdname="")
WorkerRef GetModule() const
std::string InfoParName() const
Base class for module items like ports, timers, pool handles.
void StartModule()
Starts module, should be called from module thread.
void SetItemPriority(int pri=-1)
ModuleItem(int typ, Reference parent, const std::string &name)
void StopModule()
Stops module, should be called from module thread.
Reference on dabc::Module class
std::string InfoParName() const
Returns info parameter name, used to provide different kind of log/debug information.
Base for dabc::ModuleSync and dabc::ModuleAsync classes.
void RemoveModuleItem(ModuleItem *item)
bool IsRunning() const
Returns true if module if running.
PortRef FindPort(const std::string &name) const
virtual void ProcessItemEvent(ModuleItem *item, uint16_t evid)
std::string ItemName(bool compact=true) const
Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call.
Object * GetParent() const
Returns pointer on parent object, thread safe
Reference GetParentRef() const
Reference on the dabc::Port class
bool IsConnected()
Returns true if port is connected.
Reference on the arbitrary object
Object * GetParent() const
Returns pointer on parent object.
bool null() const
Returns true if reference contains nullptr.
std::string ItemName(bool compact=true) const
Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call.
Timer(Reference parent, bool systimer, const std::string &name, double timeout=-1., bool synchron=false)
virtual double ProcessTimeout(double last_diff)
Reference on dabc::Worker
Active object, which is working inside dabc::Thread.
int WorkerPriority() const
XMLNodePointer_t GetParent(XMLNodePointer_t xmlnode)