38 if (inp)
return inp->
Item(nbuf);
45 if (pool)
return pool->
Item(nbuf);
53 ((
Port*) item)->ConfirmEvent();
57 ProcessPoolEvent(item->
fSubId);
59 ProcessInputEvent(item->
fSubId);
62 ((
Port*) item)->ConfirmEvent();
65 ProcessOutputEvent(item->
fSubId);
68 ProcessTimerEvent(item->
fSubId);
71 ProcessConnectEvent(item->
GetName(),
true);
75 ProcessConnectEvent(item->
GetName(),
false);
78 ProcessUserEvent(item->
fSubId);
90 for (
unsigned n=0;n<NumInputs();n++)
91 ProduceInputEvent(n, fInputs[n]->NumStartEvents());
93 for (
unsigned n=0;n<NumOutputs();n++)
94 ProduceOutputEvent(n, fOutputs[n]->NumStartEvents());
96 for (
unsigned n=0;n<NumPools();n++)
97 ProducePoolEvent(n, fPools[n]->NumStartEvents());
106 if ((inp!=0) && IsRunning() && inp->
CanRecv())
116 while (IsRunning() && inp->
CanRecv()) {
117 if (!ProcessRecv(port))
return;
120 DOUT3(
"Port %s performed too many receive operations - break the loop", inp->
ItemName().c_str());
131 if ((out!=0) && IsRunning() && out->
CanSend())
141 while (IsRunning() && out->
CanSend()) {
142 if (!ProcessSend(port))
return;
145 DOUT3(
"Port %s performed too many send operations - break the loop", out->
ItemName().c_str());
170 if (!ProcessBuffer(indx))
return;
173 DOUT3(
"Pool %s performed too many send operations - break the loop", pool->
GetName());
Reference on memory from memory pool.
void ActivatePool(unsigned pool)
Produces event for specified pool handle.
virtual void ProcessPoolEvent(unsigned pool)
Method called by framework when pool event is produced.
bool RecvQueueFull(unsigned port=0)
Returns true if receive queue is full and block input.
Buffer RecvQueueItem(unsigned port=0, unsigned nbuf=0)
Returns buffer from receive queue of the input port.
virtual void ProcessOutputEvent(unsigned port)
Method called by framework when output event is produced.
void ActivateInput(unsigned port=0)
Produces event for specified input port Should be used when processing was stopped due to return fals...
void SignalRecvWhenFull(unsigned port=0)
Let input signal only when queue is full.
virtual ~ModuleAsync()
Destructor of ModuleAsync class.
virtual void ProcessItemEvent(ModuleItem *item, uint16_t evid)
Generic event processing method [internal].
virtual bool DoStart()
Activate module [internal].
Buffer PoolQueueItem(unsigned pool=0, unsigned nbuf=0)
Returns buffer from queue assigned with the pool.
void ActivateOutput(unsigned port=0)
Produces event for specified output port.
virtual void ProcessInputEvent(unsigned port)
Method called by framework when input event is produced.
Base class for module items like ports, timers, pool handles.
std::string ItemName(bool compact=true) const
Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call.
const char * GetName() const
Returns name of the object, thread safe
bool CanSend() const
Returns true if user can send get buffer via the port.
Handle for pool connection.
bool CanTakeBuffer() const
Buffer Item(unsigned indx)
Base class for input and output ports.
int GetMaxLoopLength()
Return maximum number of events, which could be processed at once.