OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librlink/] [RlinkAddrMap.hpp] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RlinkAddrMap.hpp 486 2013-02-10 22:34:43Z mueller $
2 10 wfjm
//
3
// Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16
// 2011-03-05   366   1.0    Initial version
17
// ---------------------------------------------------------------------------
18
 
19
 
20
/*!
21
  \file
22 19 wfjm
  \version $Id: RlinkAddrMap.hpp 486 2013-02-10 22:34:43Z mueller $
23 10 wfjm
  \brief   Declaration of class \c RlinkAddrMap.
24
*/
25
 
26
#ifndef included_Retro_RlinkAddrMap
27
#define included_Retro_RlinkAddrMap 1
28
 
29
#include <cstdint>
30
#include <string>
31
#include <map>
32
#include <ostream>
33
 
34
namespace Retro {
35
 
36
  class RlinkAddrMap {
37
    public:
38
      typedef std::map<std::string, uint16_t> nmap_t;
39
      typedef nmap_t::iterator         nmap_it_t;
40
      typedef nmap_t::const_iterator   nmap_cit_t;
41
      typedef nmap_t::value_type       nmap_val_t;
42
      typedef std::map<uint16_t, std::string> amap_t;
43
      typedef amap_t::iterator         amap_it_t;
44
      typedef amap_t::const_iterator   amap_cit_t;
45
      typedef amap_t::value_type       amap_val_t;
46
 
47
                    RlinkAddrMap();
48
                   ~RlinkAddrMap();
49
 
50
      void          Clear();
51
 
52
      bool          Insert(const std::string& name, uint16_t addr);
53
      bool          Erase(const std::string& name);
54
      bool          Erase(uint16_t addr);
55
 
56
      bool          Find(const std::string& name, uint16_t& addr) const;
57
      bool          Find(uint16_t addr, std::string& name) const;
58
 
59
      const nmap_t& Nmap() const;
60
      const amap_t& Amap() const;
61
 
62
      size_t        MaxNameLength() const;
63
 
64
      void          Print(std::ostream& os, int ind=0) const;
65
      void          Dump(std::ostream& os, int ind=0, const char* text=0) const;
66
 
67
    protected:
68
      nmap_t        fNameMap;               //!< name->addr map
69
      amap_t        fAddrMap;               //!< addr->name map
70
      mutable size_t  fMaxLength;           //!< max name length
71
 
72
  };
73
 
74
} // end namespace Retro
75
 
76
#include "RlinkAddrMap.ipp"
77
 
78
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.