libdrmconf  0.10.4
A library to program DMR radios.
Classes | Public Member Functions | Protected Attributes | List of all members
AddressMap Class Reference

This class represents a memory map. More...

#include <addressmap.hh>

Classes

struct  AddrMapItem
 Memory map item. More...
 

Public Member Functions

 AddressMap ()
 Empty constructor.
 
 AddressMap (const AddressMap &other)
 Copy constructor.
 
AddressMapoperator= (const AddressMap &other)
 Copy assignment.
 
void clear ()
 Clears the address map.
 
bool add (uint32_t addr, uint32_t len, int idx=-1)
 Adds an item to the address map.
 
bool rem (uint32_t idx)
 Removes an item from the address map associated with the given index.
 
bool contains (uint32_t addr) const
 Returns true if the given address is contained in any of the memory regions.
 
int find (uint32_t addr) const
 Finds the index of the memory region containing the given address. More...
 

Protected Attributes

std::vector< AddrMapItem_items
 Holds the vector of memory items, the order of these items is maintained.
 

Detailed Description

This class represents a memory map.

That is, it maintains a vector of memory regions (address and length) that can be searched efficiently. This should speedup the generation of codeplugs consisting of many small memory sections.

Member Function Documentation

◆ find()

int AddressMap::find ( uint32_t  addr) const

Finds the index of the memory region containing the given address.

If no such region is found, -1 is returned.


The documentation for this class was generated from the following files: