w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkAddrMap.hpp
Go to the documentation of this file.
1// $Id: RlinkAddrMap.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2017 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2017-04-07 868 1.0.1 Dump(): add detail arg
8// 2011-03-05 366 1.0 Initial version
9// ---------------------------------------------------------------------------
10
11
16#ifndef included_Retro_RlinkAddrMap
17#define included_Retro_RlinkAddrMap 1
18
19#include <cstdint>
20#include <string>
21#include <map>
22#include <ostream>
23
24namespace Retro {
25
27 public:
28 typedef std::map<std::string, uint16_t> nmap_t;
29 typedef std::map<uint16_t, std::string> amap_t;
30
33
34 void Clear();
35
36 bool Insert(const std::string& name, uint16_t addr);
37 bool Erase(const std::string& name);
38 bool Erase(uint16_t addr);
39
40 bool Find(const std::string& name, uint16_t& addr) const;
41 bool Find(uint16_t addr, std::string& name) const;
42
43 const nmap_t& Nmap() const;
44 const amap_t& Amap() const;
45
46 size_t MaxNameLength() const;
47
48 void Print(std::ostream& os, int ind=0) const;
49 void Dump(std::ostream& os, int ind=0, const char* text=0,
50 int detail=0) const;
51
52 protected:
55 mutable size_t fMaxLength;
56
57 };
58
59} // end namespace Retro
60
61#include "RlinkAddrMap.ipp"
62
63#endif
size_t MaxNameLength() const
FIXME_docs.
nmap_t fNameMap
name->addr map
const nmap_t & Nmap() const
FIXME_docs.
const amap_t & Amap() const
FIXME_docs.
size_t fMaxLength
max name length
amap_t fAddrMap
addr->name map
bool Erase(const std::string &name)
FIXME_docs.
std::map< std::string, uint16_t > nmap_t
std::map< uint16_t, std::string > amap_t
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
~RlinkAddrMap()
Destructor.
bool Insert(const std::string &name, uint16_t addr)
FIXME_docs.
bool Find(const std::string &name, uint16_t &addr) const
FIXME_docs.
void Print(std::ostream &os, int ind=0) const
FIXME_docs.
RlinkAddrMap()
Default constructor.
void Clear()
FIXME_docs.
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47