miasm
Reverse engineering framework
miasm.core.utils.BoundedDict Class Reference
Inheritance diagram for miasm.core.utils.BoundedDict:
Collaboration diagram for miasm.core.utils.BoundedDict:

Public Member Functions

def __init__ (self, max_size, min_size=None, initialdata=None, delete_cb=None)
 
def __setitem__ (self, asked_key, value)
 
def __contains__ (self, key)
 
def has_key (self, key)
 
def keys (self)
 
def data (self)
 
def __getitem__ (self, key)
 
def __delitem__ (self, key)
 
def __del__ (self)
 
def __len__ (self)
 
def __iter__ (self)
 

Detailed Description

Limited in size dictionary.

To reduce combinatory cost, once an upper limit @max_size is reached,
@max_size - @min_size elements are suppressed.
The targeted elements are the less accessed.

One can define a callback called when an element is removed

Constructor & Destructor Documentation

◆ __init__()

def miasm.core.utils.BoundedDict.__init__ (   self,
  max_size,
  min_size = None,
  initialdata = None,
  delete_cb = None 
)
Create a BoundedDict
@max_size: maximum size of the dictionary
@min_size: (optional) number of most used element to keep when resizing
@initialdata: (optional) dict instance with initial data
@delete_cb: (optional) callback called when an element is removed

◆ __del__()

def miasm.core.utils.BoundedDict.__del__ (   self)
Ensure the callback is called when last reference is lost

Member Function Documentation

◆ __contains__()

def miasm.core.utils.BoundedDict.__contains__ (   self,
  key 
)

◆ __delitem__()

def miasm.core.utils.BoundedDict.__delitem__ (   self,
  key 
)

◆ __getitem__()

def miasm.core.utils.BoundedDict.__getitem__ (   self,
  key 
)

◆ __iter__()

def miasm.core.utils.BoundedDict.__iter__ (   self)
Here is the caller graph for this function:

◆ __len__()

def miasm.core.utils.BoundedDict.__len__ (   self)

◆ __setitem__()

def miasm.core.utils.BoundedDict.__setitem__ (   self,
  asked_key,
  value 
)

◆ data()

def miasm.core.utils.BoundedDict.data (   self)

◆ has_key()

def miasm.core.utils.BoundedDict.has_key (   self,
  key 
)

◆ keys()

def miasm.core.utils.BoundedDict.keys (   self)
Here is the caller graph for this function:

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