w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkServer.ipp
Go to the documentation of this file.
1// $Id: RlinkServer.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2019-06-07 1160 2.2.3 Stats() not longer const
8// 2018-12-15 1083 2.2.2 for std::function setups: use rval ref and move
9// 2018-12-07 1078 2.2.1 use std::shared_ptr instead of boost
10// 2015-01-10 632 2.2 Exec() without emsg now void, will throw
11// 2014-12-30 625 2.1 adopt to Rlink V4 attn logic
12// 2014-11-30 607 2.0 re-organize for rlink v4
13// 2013-05-01 513 1.0.1 fTraceLevel now uint32_t
14// 2013-03-06 495 1.0 Initial version
15// 2013-01-12 474 0.5 First draft
16// ---------------------------------------------------------------------------
17
22// all method definitions in namespace Retro
23namespace Retro {
24
25//------------------------------------------+-----------------------------------
27
28inline const std::shared_ptr<RlinkConnect>& RlinkServer::ConnectSPtr() const
29{
30 return fspConn;
31}
32
33//------------------------------------------+-----------------------------------
35
37{
38 return *fspConn;
39}
40
41//------------------------------------------+-----------------------------------
43
45{
46 return fspConn->LogFile();
47}
48
49//------------------------------------------+-----------------------------------
51
53{
54 return fContext;
55}
56
57//------------------------------------------+-----------------------------------
59
60inline bool RlinkServer::Exec(RlinkCommandList& clist, RerrMsg& emsg)
61{
62 return Connect().Exec(clist, fContext, emsg);
63}
64
65//------------------------------------------+-----------------------------------
67
69{
70 Connect().Exec(clist, fContext);
71 return;
72}
73
74//------------------------------------------+-----------------------------------
76
77inline uint32_t RlinkServer::TraceLevel() const
78{
79 return fTraceLevel;
80}
81
82//------------------------------------------+-----------------------------------
84
86{
87 return fStats;
88}
89
90//------------------------------------------+-----------------------------------
92
93inline bool RlinkServer::AttnPending() const
94{
95 return fAttnNotiPatt | fAttnPatt;
96}
97
98//------------------------------------------+-----------------------------------
100
101inline bool RlinkServer::ActnPending() const
102{
103 return !fActnList.empty();
104}
105
106//==========================================+===================================
107// AttnArgs sub class
108
114//------------------------------------------+-----------------------------------
116
118 : fAttnPatt(0),
119 fAttnMask(0),
120 fAttnHarvest(0),
121 fHarvestDone(false)
122{}
123
124//------------------------------------------+-----------------------------------
126
127inline RlinkServer::AttnArgs::AttnArgs(uint16_t apatt, uint16_t amask)
128 : fAttnPatt(apatt),
129 fAttnMask(amask),
130 fAttnHarvest(0),
131 fHarvestDone(false)
132{}
133
134//==========================================+===================================
135// AttnId sub class
136
142//------------------------------------------+-----------------------------------
144
146 : fMask(0),
147 fCdata(0)
148{}
149
150//------------------------------------------+-----------------------------------
152
153inline RlinkServer::AttnId::AttnId(uint16_t mask, void* cdata)
154 : fMask(mask),
155 fCdata(cdata)
156{}
157
158//------------------------------------------+-----------------------------------
160
161inline bool RlinkServer::AttnId::operator==(const AttnId& rhs) const
162{
163 return fMask==rhs.fMask && fCdata==rhs.fCdata;
164}
165
166//==========================================+===================================
167// AttnDsc sub class
168
174//------------------------------------------+-----------------------------------
176
178 : fHandler(),
179 fId()
180{}
181
182//------------------------------------------+-----------------------------------
184
186 : fHandler(move(hdl)),
187 fId(id)
188{}
189
190} // end namespace Retro
FIXME_docs.
Definition: RerrMsg.hpp:25
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
uint16_t fAttnNotiPatt
attn notifier pattern
uint32_t TraceLevel() const
FIXME_docs.
Definition: RlinkServer.ipp:77
std::function< int(AttnArgs &)> attnhdl_t
Definition: RlinkServer.hpp:61
bool AttnPending() const
FIXME_docs.
Definition: RlinkServer.ipp:93
RlinkConnect & Connect() const
FIXME_docs.
Definition: RlinkServer.ipp:36
RlogFile & LogFile() const
FIXME_docs.
Definition: RlinkServer.ipp:44
std::shared_ptr< RlinkConnect > fspConn
Rstats fStats
statistics
RlinkContext fContext
default server context
std::list< actnhdl_t > fActnList
const std::shared_ptr< RlinkConnect > & ConnectSPtr() const
FIXME_docs.
Definition: RlinkServer.ipp:28
uint16_t fAttnPatt
current attn pattern
Rstats & Stats()
FIXME_docs.
Definition: RlinkServer.ipp:85
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
Definition: RlinkServer.ipp:60
uint32_t fTraceLevel
trace level
bool ActnPending() const
FIXME_docs.
RlinkContext & Context()
FIXME_docs.
Definition: RlinkServer.ipp:52
FIXME_docs.
Definition: RlogFile.hpp:34
FIXME_docs.
Definition: Rstats.hpp:28
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47
AttnArgs()
Default constructor.
AttnDsc()
Default constructor.
bool operator==(const AttnId &rhs) const
FIXME_docs.
AttnId()
Default constructor.