Package pyffi :: Package object_models :: Package xml :: Module array :: Class Array
[hide private]
[frames] | no frames]

Class Array

source code

            object --+        
                     |        
                  list --+    
                         |    
            object --+   |    
                     |   |    
utils.graph.DetailNode --+    
                         |    
                 _ListWrap --+
                             |
                            Array

A general purpose class for 1 or 2 dimensional arrays consisting of either BasicBase or StructBase elements.
Instance Methods [hide private]
new empty list
__init__(self, element_type=None, element_type_template=None, element_type_argument=None, count1=None, count2=None, parent=None)
Initialize the array type.
source code
 
_len1(self)
The length the array should have, obtained by evaluating the count1 expression.
source code
 
_len2(self, index1)
The length the array should have, obtained by evaluating the count2 expression.
source code
 
deepcopy(self, block)
Copy attributes from a given array which needs to have at least as many elements (possibly more) as self.
source code
 
__str__(self)
str(x)
source code
 
update_size(self)
Update the array size.
source code
 
read(self, stream, data)
Read array from stream.
source code
 
write(self, stream, data)
Write array to stream.
source code
 
fix_links(self, data)
Fix the links in the array by calling C{fix_links} on all elements of the array.
source code
 
get_links(self, data=None)
Return all links in the array by calling C{get_links} on all elements of the array.
source code
 
get_strings(self, data)
Return all strings in the array by calling C{get_strings} on all elements of the array.
source code
 
get_refs(self, data=None)
Return all references in the array by calling C{get_refs} on all elements of the array.
source code
 
get_size(self, data=None)
Calculate the sum of the size of all elements in the array.
source code
 
get_hash(self, data=None)
Calculate a hash value for the array, as a tuple.
source code
 
replace_global_node(self, oldbranch, newbranch, **kwargs)
Calculate a hash value for the array, as a tuple.
source code
 
_elementList(self, **kwargs)
Generator for listing all elements.
source code

Inherited from _ListWrap: __contains__, __getitem__, __iter__, __setitem__, get_basic_item, get_detail_child_names, get_detail_child_nodes, get_item, iter_basic_item, iter_item, set_basic_item

Inherited from _ListWrap (private): _not_implemented_hook

Inherited from list: __add__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getslice__, __gt__, __iadd__, __imul__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_display, get_detail_iterator

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]
  arg = None
hash(x)

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, element_type=None, element_type_template=None, element_type_argument=None, count1=None, count2=None, parent=None)
(Constructor)

source code 
Initialize the array type.
Parameters:
  • element_type - The class describing the type of each element.
  • element_type_template - If the class takes a template type argument, then this argument describes the template type.
  • element_type_argument - If the class takes a type argument, then it is described here.
  • count1 - An C{Expression} describing the count (first dimension).
  • count2 - Either None, or an C{Expression} describing the second dimension count.
  • parent - The parent of this instance, that is, the instance this array is an attribute of.
Returns: new empty list
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

update_size(self)

source code 
Update the array size. Call this function whenever the size parameters change in C{parent}.

replace_global_node(self, oldbranch, newbranch, **kwargs)

source code 
Calculate a hash value for the array, as a tuple.
Overrides: utils.graph.DetailNode.replace_global_node