w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkConnect.ipp
Go to the documentation of this file.
1// $Id: RlinkConnect.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-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.7.1 Stats() not longer const
8// 2018-12-08 1079 2.7 add HasPort; return ref for Port()
9// 2018-12-07 1078 2.6.1 use std::shared_ptr instead of boost
10// 2018-12-01 1076 2.6 use unique_ptr instead of scoped_ptr
11// 2017-04-22 883 2.5.2 add rbus monitor probe, add HasRbmon()
12// 2017-04-09 871 2.5.1 LogFileName(): returns now const std::string&
13// 2017-02-20 854 2.5 use Rtime, drop TimeOfDayAsDouble
14// 2016-04-02 758 2.4 add USR_ACCESS register support (RLUA0/RLUA1)
15// 2016-03-20 748 2.3 add fTimeout,(Set)Timeout();
16// 2015-04-12 666 2.2 add LinkInit,LinkInitDone; transfer xon
17// 2015-01-06 631 2.1 full rlink v4 implementation
18// 2013-03-05 495 1.2.1 add Exec() without emsg (will send emsg to LogFile)
19// 2013-02-23 492 1.2 use scoped_ptr for Port; Close allways allowed
20// use RlinkContext, add Context(), Exec(..., cntx)
21// 2013-02-22 491 1.1 use new RlogFile/RlogMsg interfaces
22// 2013-02-03 481 1.0.1 add SetServer(),Server()
23// 2011-04-02 375 1.0 Initial version
24// 2011-01-15 356 0.1 First draft
25// ---------------------------------------------------------------------------
26
31// all method definitions in namespace Retro
32namespace Retro {
33
34//------------------------------------------+-----------------------------------
36
37inline bool RlinkConnect::IsOpen() const
38{
39 return fupPort && fupPort->IsOpen();
40}
41
42//------------------------------------------+-----------------------------------
44
45inline bool RlinkConnect::HasPort() const
46{
47 return bool(fupPort);
48}
49
50//------------------------------------------+-----------------------------------
52
54{
55 return *fupPort;
56}
57
58//------------------------------------------+-----------------------------------
60
61inline const RlinkPort& RlinkConnect::Port() const
62{
63 return *fupPort;
64}
65
66//------------------------------------------+-----------------------------------
68
69inline bool RlinkConnect::LinkInitDone() const
70{
71 return fLinkInitDone;
72}
73
74//------------------------------------------+-----------------------------------
76
78{
79 return fContext;
80}
81
82//------------------------------------------+-----------------------------------
84
86{
87 fpServ = pserv;
88 return;
89}
90
91//------------------------------------------+-----------------------------------
93
95{
96 return fpServ;
97}
98
99//------------------------------------------+-----------------------------------
102{
103 return Exec(clist, fContext, emsg);
104}
105
106//------------------------------------------+-----------------------------------
109{
110 Exec(clist, fContext);
111 return;
112}
113
114//------------------------------------------+-----------------------------------
116inline uint32_t RlinkConnect::SysId() const
117{
118 return fSysId;
119}
120
121//------------------------------------------+-----------------------------------
123inline uint32_t RlinkConnect::UsrAcc() const
124{
125 return fUsrAcc;
126}
127
128//------------------------------------------+-----------------------------------
130inline size_t RlinkConnect::RbufSize() const
131{
132 return fRbufSize;
133}
134
135//------------------------------------------+-----------------------------------
137inline size_t RlinkConnect::BlockSizeMax() const
138{
139 return (fRbufSize-kRbufBlkDelta)/2;
140}
141
142//------------------------------------------+-----------------------------------
145{
146 return (fRbufSize-kRbufPrudentDelta)/2;
147}
148
149//------------------------------------------+-----------------------------------
151inline bool RlinkConnect::HasRbmon() const
152{
153 return fHasRbmon;
154}
155
156//------------------------------------------+-----------------------------------
158
159inline bool RlinkConnect::AddrMapInsert(const std::string& name, uint16_t addr)
160{
161 return fAddrMap.Insert(name, addr);
162}
163
164//------------------------------------------+-----------------------------------
166
167inline bool RlinkConnect::AddrMapErase(const std::string& name)
168{
169 return fAddrMap.Erase(name);
170}
171
172//------------------------------------------+-----------------------------------
174
175inline bool RlinkConnect::AddrMapErase(uint16_t addr)
176{
177 return fAddrMap.Erase(addr);
178}
179
180//------------------------------------------+-----------------------------------
182
184{
185 return fAddrMap.Clear();
186}
187
188//------------------------------------------+-----------------------------------
190
192{
193 return fAddrMap;
194}
195
196//------------------------------------------+-----------------------------------
198
200{
201 return fStats;
202}
203
204//------------------------------------------+-----------------------------------
206
208{
209 return fSndPkt.Stats();
210}
211
212//------------------------------------------+-----------------------------------
214
216{
217 return fRcvPkt.Stats();
218}
219
220//------------------------------------------+-----------------------------------
222
223inline uint32_t RlinkConnect::LogBaseAddr() const
224{
225 return fLogBaseAddr;
226}
227
228//------------------------------------------+-----------------------------------
230
231inline uint32_t RlinkConnect::LogBaseData() const
232{
233 return fLogBaseData;
234}
235
236//------------------------------------------+-----------------------------------
238
239inline uint32_t RlinkConnect::LogBaseStat() const
240{
241 return fLogBaseStat;
242}
243
244//------------------------------------------+-----------------------------------
246
247inline uint32_t RlinkConnect::PrintLevel() const
248{
249 return fPrintLevel;
250}
251
252//------------------------------------------+-----------------------------------
254
255inline uint32_t RlinkConnect::DumpLevel() const
256{
257 return fDumpLevel;
258}
259
260//------------------------------------------+-----------------------------------
262
263inline uint32_t RlinkConnect::TraceLevel() const
264{
265 return fTraceLevel;
266}
267
268//------------------------------------------+-----------------------------------
270
271inline const Rtime& RlinkConnect::Timeout() const
272{
273 return fTimeout;
274}
275
276//------------------------------------------+-----------------------------------
278
280{
281 return *fspLog;
282}
283
284//------------------------------------------+-----------------------------------
286
287inline const std::shared_ptr<RlogFile>& RlinkConnect::LogFileSPtr() const
288{
289 return fspLog;
290}
291
292//------------------------------------------+-----------------------------------
294
295inline const std::string& RlinkConnect::LogFileName() const
296{
297 return LogFile().Name();
298}
299
300
301} // end namespace Retro
FIXME_docs.
Definition: RerrMsg.hpp:25
bool Erase(const std::string &name)
FIXME_docs.
bool Insert(const std::string &name, uint16_t addr)
FIXME_docs.
void Clear()
FIXME_docs.
void AddrMapClear()
FIXME_docs.
uint32_t LogBaseData() const
FIXME_docs.
uint32_t LogBaseAddr() const
FIXME_docs.
bool AddrMapInsert(const std::string &name, uint16_t addr)
FIXME_docs.
bool AddrMapErase(const std::string &name)
FIXME_docs.
RlinkPacketBufSnd fSndPkt
send packet buffer
uint32_t SysId() const
FIXME_docs.
uint32_t fTraceLevel
trace 0=off,1=buf,2=char
uint32_t fDumpLevel
dump 0=off,1=err,2=chk,3=all
static const uint16_t kRbufBlkDelta
rbuf needed for rblk or wblk
RlinkPort::port_uptr_t fupPort
uptr to port
bool Exec(RlinkCommandList &clist, RerrMsg &emsg)
FIXME_docs.
uint32_t fLogBaseData
log: base for data
Rtime fTimeout
response timeout
uint32_t fUsrAcc
USR_ACCESS of connected device.
Rstats & RcvStats()
FIXME_docs.
uint32_t PrintLevel() const
FIXME_docs.
size_t RbufSize() const
FIXME_docs.
const Rtime & Timeout() const
FIXME_docs.
RlogFile & LogFile() const
FIXME_docs.
uint32_t LogBaseStat() const
FIXME_docs.
static const uint16_t kRbufPrudentDelta
Rbuf space reserve.
RlinkContext & Context()
FIXME_docs.
uint32_t fSysId
SYSID of connected device.
RlinkContext fContext
default context
size_t BlockSizeMax() const
FIXME_docs.
bool IsOpen() const
FIXME_docs.
uint32_t DumpLevel() const
FIXME_docs.
RlinkPacketBufRcv fRcvPkt
receive packet buffer
uint32_t fLogBaseAddr
log: base for addr
RlinkServer * Server() const
FIXME_docs.
const std::shared_ptr< RlogFile > & LogFileSPtr() const
FIXME_docs.
uint32_t TraceLevel() const
FIXME_docs.
Rstats & Stats()
FIXME_docs.
RlinkPort & Port()
FIXME_docs.
uint32_t fPrintLevel
print 0=off,1=err,2=chk,3=all
Rstats fStats
statistics
bool HasPort() const
FIXME_docs.
size_t BlockSizePrudent() const
FIXME_docs.
RlinkAddrMap fAddrMap
name<->address mapping
bool fHasRbmon
has rbd_rbmon (rbus monitor)
uint32_t fLogBaseStat
log: base for stat
bool HasRbmon() const
FIXME_docs.
uint32_t UsrAcc() const
FIXME_docs.
RlinkServer * fpServ
ptr to server (optional)
size_t fRbufSize
Rbuf size (in bytes)
Rstats & SndStats()
FIXME_docs.
void SetServer(RlinkServer *pserv)
FIXME_docs.
const RlinkAddrMap & AddrMap() const
FIXME_docs.
bool fLinkInitDone
LinkInit done.
bool LinkInitDone() const
FIXME_docs.
std::shared_ptr< RlogFile > fspLog
log file ptr
const std::string & LogFileName() const
FIXME_docs.
Rstats & Stats()
FIXME_docs.
FIXME_docs.
Definition: RlinkPort.hpp:45
FIXME_docs.
Definition: RlogFile.hpp:34
const std::string & Name() const
FIXME_docs.
Definition: RlogFile.ipp:30
FIXME_docs.
Definition: Rstats.hpp:28
FIXME_docs.
Definition: Rtime.hpp:25
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47