Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
scripts.idlnode.IDLDictNode Class Reference
Inheritance diagram for scripts.idlnode.IDLDictNode:
scripts.idlnode.IDLNode scripts.idlnode.IDLAnnotation scripts.idlnode.IDLAnnotations scripts.idlnode.IDLDictionaryMembers scripts.idlnode.IDLExtAttrs

Public Member Functions

def __init__ (self, ast)
 
def __len__ (self)
 
def __getitem__ (self, key)
 
def __setitem__ (self, key, value)
 
def __delitem__ (self, key)
 
def __contains__ (self, key)
 
def __iter__ (self)
 
def get (self, key, default=None)
 
def setdefault (self, key, value=None)
 
def items (self)
 
def keys (self)
 
def values (self)
 
def clear (self)
 
def to_dict (self)
 
- Public Member Functions inherited from scripts.idlnode.IDLNode
def __init__ (self, ast, id=None)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def reset_id (self, newId)
 
def all (self, type_filter=None)
 
def to_dict (self)
 
def to_hash (self)
 

Additional Inherited Members

- Public Attributes inherited from scripts.idlnode.IDLNode
 id
 
 ext_attrs
 
 annotations
 
 members
 

Detailed Description

Base class for dictionary-like IDL nodes such as extended attributes
and annotations. The base class implements various dict interfaces.

Definition at line 349 of file idlnode.py.

Constructor & Destructor Documentation

◆ __init__()

def scripts.idlnode.IDLDictNode.__init__ (   self,
  ast 
)
Initializes an IDLNode from a PegParser AST output.

Reimplemented from scripts.idlnode.IDLNode.

Reimplemented in scripts.idlnode.IDLExtAttrs, scripts.idlnode.IDLAnnotations, scripts.idlnode.IDLAnnotation, and scripts.idlnode.IDLDictionaryMembers.

Definition at line 353 of file idlnode.py.

353 def __init__(self, ast):
354 IDLNode.__init__(self, None)
355 if ast is not None and isinstance(ast, dict):
356 self.__map = ast
357 else:
358 self.__map = {}
359

Member Function Documentation

◆ __contains__()

def scripts.idlnode.IDLDictNode.__contains__ (   self,
  key 
)

Definition at line 372 of file idlnode.py.

372 def __contains__(self, key):
373 return key in self.__map
374

◆ __delitem__()

def scripts.idlnode.IDLDictNode.__delitem__ (   self,
  key 
)

Definition at line 369 of file idlnode.py.

369 def __delitem__(self, key):
370 del self.__map[key]
371

◆ __getitem__()

def scripts.idlnode.IDLDictNode.__getitem__ (   self,
  key 
)

Definition at line 363 of file idlnode.py.

363 def __getitem__(self, key):
364 return self.__map[key]
365

◆ __iter__()

def scripts.idlnode.IDLDictNode.__iter__ (   self)

Definition at line 375 of file idlnode.py.

375 def __iter__(self):
376 return self.__map.__iter__()
377

◆ __len__()

def scripts.idlnode.IDLDictNode.__len__ (   self)

Definition at line 360 of file idlnode.py.

360 def __len__(self):
361 return len(self.__map)
362

◆ __setitem__()

def scripts.idlnode.IDLDictNode.__setitem__ (   self,
  key,
  value 
)

Definition at line 366 of file idlnode.py.

366 def __setitem__(self, key, value):
367 self.__map[key] = value
368

◆ clear()

def scripts.idlnode.IDLDictNode.clear (   self)

Definition at line 393 of file idlnode.py.

393 def clear(self):
394 self.__map = {}
395

◆ get()

def scripts.idlnode.IDLDictNode.get (   self,
  key,
  default = None 
)

Definition at line 378 of file idlnode.py.

378 def get(self, key, default=None):
379 return self.__map.get(key, default)
380
const myers::Point & get(const myers::Segment &)

◆ items()

def scripts.idlnode.IDLDictNode.items (   self)

Definition at line 384 of file idlnode.py.

384 def items(self):
385 return self.__map.items()
386

◆ keys()

def scripts.idlnode.IDLDictNode.keys (   self)

Definition at line 387 of file idlnode.py.

387 def keys(self):
388 return self.__map.keys()
389

◆ setdefault()

def scripts.idlnode.IDLDictNode.setdefault (   self,
  key,
  value = None 
)

Definition at line 381 of file idlnode.py.

381 def setdefault(self, key, value=None):
382 return self.__map.setdefault(key, value)
383

◆ to_dict()

def scripts.idlnode.IDLDictNode.to_dict (   self)
Overrides the default IDLNode.to_dict behavior.
The IDLDictNode members are copied into a new dictionary, and
IDLNode members are recursively converted into dicts as well.

Reimplemented from scripts.idlnode.IDLNode.

Definition at line 396 of file idlnode.py.

396 def to_dict(self):
397 """Overrides the default IDLNode.to_dict behavior.
398 The IDLDictNode members are copied into a new dictionary, and
399 IDLNode members are recursively converted into dicts as well.
400 """
401 res = {}
402 for (k, v) in self.__map.items():
403 if isinstance(v, IDLNode):
404 v = v.to_dict()
405 res[k] = v
406 return res
407

◆ values()

def scripts.idlnode.IDLDictNode.values (   self)

Definition at line 390 of file idlnode.py.

390 def values(self):
391 return self.__map.values()
392

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