27#ifndef included_Retro_RlinkServer
28#define included_Retro_RlinkServer 1
57 AttnArgs(uint16_t apatt, uint16_t amask);
70 void SetConnect(
const std::shared_ptr<RlinkConnect>& spconn);
71 const std::shared_ptr<RlinkConnect>&
ConnectSPtr()
const;
80 void* cdata =
nullptr);
88 int fd,
short events=POLLIN);
108 void Print(std::ostream& os)
const;
109 void Dump(std::ostream& os,
int ind=0,
const char* text=0,
156 AttnId(uint16_t mask,
void* cdata);
std::function< int(const pollfd &)> pollhdl_t
RlinkServer & operator=(const RlinkServer &)=delete
bool TestPollHandler(int fd, short events=POLLIN)
FIXME_docs.
uint16_t fAttnNotiPatt
attn notifier pattern
uint32_t TraceLevel() const
FIXME_docs.
std::function< int(AttnArgs &)> attnhdl_t
bool AttnPending() const
FIXME_docs.
bool IsActiveInside() const
Indicates whether server is active and caller is inside server thread.
std::vector< AttnDsc > fAttnDsc
RlinkServer()
Default constructor.
void AddAttnHandler(attnhdl_t &&attnhdl, uint16_t mask, void *cdata=nullptr)
FIXME_docs.
RlinkConnect & Connect() const
FIXME_docs.
RlogFile & LogFile() const
FIXME_docs.
void CallActnHandler()
FIXME_docs.
std::shared_ptr< RlinkConnect > fspConn
ReventLoop::pollhdl_t pollhdl_t
void StartOrResume(bool resume)
FIXME_docs.
virtual ~RlinkServer()
Destructor.
int RlinkHandler(const pollfd &pfd)
FIXME_docs.
void QueueAction(actnhdl_t &&actnhdl)
FIXME_docs.
int WakeupHandler(const pollfd &pfd)
FIXME_docs.
RlinkServer(const RlinkServer &)=delete
RlinkContext fContext
default server context
std::list< actnhdl_t > fActnList
void RemovePollHandler(int fd, short events, bool nothrow=false)
FIXME_docs.
void GetAttnInfo(AttnArgs &args, RlinkCommandList &clist)
FIXME_docs.
const std::shared_ptr< RlinkConnect > & ConnectSPtr() const
FIXME_docs.
bool IsActive() const
Indicates whether server is active.
uint16_t fAttnPatt
current attn pattern
void SetConnect(const std::shared_ptr< RlinkConnect > &spconn)
FIXME_docs.
Rstats & Stats()
FIXME_docs.
void CallAttnHandler()
FIXME_docs.
void Print(std::ostream &os) const
FIXME_docs.
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
RlinkServerEventLoop fELoop
void RemoveAttnHandler(uint16_t mask, void *cdata=nullptr)
FIXME_docs.
uint32_t fTraceLevel
trace level
void SetTraceLevel(uint32_t level)
FIXME_docs.
std::thread fServerThread
bool IsActiveOutside() const
Indicates whether server is active and caller is outside server thread.
@ kStatNAttn13
Attn bit 13 set.
@ kStatNAttn06
Attn bit 6 set.
@ kStatNAttn00
Attn bit 0 set.
@ kStatNAttnHarv
Attn handler restarts.
@ kStatNAttn05
Attn bit 5 set.
@ kStatNAttn12
Attn bit 12 set.
@ kStatNAttn11
Attn bit 11 set.
@ kStatNAttnHdl
Attn handler calls.
@ kStatNAttn09
Attn bit 9 set.
@ kStatNAttn08
Attn bit 8 set.
@ kStatNWakeupEvt
Wakeup events.
@ kStatNAttn04
Attn bit 4 set.
@ kStatNAttn15
Attn bit 15 set.
@ kStatNAttn14
Attn bit 14 set.
@ kStatNAttn02
Attn bit 2 set.
@ kStatNAttnNoti
Attn notifies processed.
@ kStatNEloopPoll
event loop turns (poll)
@ kStatNAttn07
Attn bit 7 set.
@ kStatNAttn01
Attn bit 1 set.
@ kStatNAttn03
Attn bit 3 set.
@ kStatNAttn10
Attn bit 10 set.
@ kStatNEloopWait
event loop turns (wait)
@ kStatNRlinkEvt
Rlink data events.
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
bool ActnPending() const
FIXME_docs.
void SignalAttnNotify(uint16_t apat)
FIXME_docs.
RlinkContext & Context()
FIXME_docs.
void AddPollHandler(pollhdl_t &&pollhdl, int fd, short events=POLLIN)
FIXME_docs.
std::function< int()> actnhdl_t
Declaration of class ReventLoop.
uint16_t fAttnHarvest
out: harvested attentions
bool fHarvestDone
out: set true when harvested
uint16_t fAttnPatt
in: current attention pattern
uint16_t fAttnMask
in: handler attention mask
AttnArgs()
Default constructor.
AttnDsc()
Default constructor.
bool operator==(const AttnId &rhs) const
FIXME_docs.
AttnId()
Default constructor.