Package pyffi :: Package formats :: Package cgf :: Class CgfFormat :: Class Ref
[hide private]
[frames] | no frames]

Class Ref

source code

                   object --+        
                            |        
       utils.graph.DetailNode --+    
                                |    
object_models.xml.basic.BasicBase --+
                                    |
                                   CgfFormat.Ref
Known Subclasses:

Reference to a chunk, up the hierarchy.
Instance Methods [hide private]
 
__init__(self, **kwargs)
Initializes the instance.
source code
 
get_value(self)
Get chunk being referred to.
source code
 
set_value(self, value)
Set chunk reference.
source code
 
read(self, stream, data)
Read chunk index.
source code
 
write(self, stream, data)
Write chunk index.
source code
 
fix_links(self, data)
Resolve chunk index into a chunk.
source code
 
get_links(self, data=None)
Return the chunk reference.
source code
 
get_refs(self, data=None)
Return the chunk reference.
source code
 
__str__(self)
Return string representation.
source code
 
get_size(self, data=None)
Return number of bytes this type occupies in a file.
source code
 
get_hash(self, data=None)
Return a hash value for the chunk referred to.
source code

Inherited from object_models.xml.basic.BasicBase: get_detail_display, get_editor_value, get_strings, replace_global_node, set_editor_value

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_child_names, get_detail_child_nodes, get_detail_iterator

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _is_template = True
  _has_links = True
  _has_refs = True

Inherited from object_models.xml.basic.BasicBase: arg

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 
Initializes the instance.
Parameters:
  • template - type used as template
  • argument - argument used to initialize the instance (see the Struct class).
  • parent - The parent of this instance, that is, the instance this instance is an attribute of.
Overrides: object.__init__
(inherited documentation)

get_value(self)

source code 
Get chunk being referred to.
Returns:
The chunk being referred to.
Overrides: object_models.xml.basic.BasicBase.get_value

set_value(self, value)

source code 
Set chunk reference.
Parameters:
  • value (L{CgfFormat.Chunk}) - The value to assign.
Overrides: object_models.xml.basic.BasicBase.set_value

read(self, stream, data)

source code 
Read chunk index.
Parameters:
  • stream (file) - The stream to read from.
Overrides: object_models.xml.basic.BasicBase.read

write(self, stream, data)

source code 
Write chunk index.
Parameters:
  • stream (file) - The stream to write to.
Overrides: object_models.xml.basic.BasicBase.write

fix_links(self, data)

source code 
Resolve chunk index into a chunk.
Parameters:
  • block_dct (dict) - Dictionary mapping block index to block.
Overrides: object_models.xml.basic.BasicBase.fix_links

get_links(self, data=None)

source code 
Return the chunk reference.
Returns:
Empty list if no reference, or single item list containing the reference.
Overrides: object_models.xml.basic.BasicBase.get_links

get_refs(self, data=None)

source code 
Return the chunk reference.
Returns:
Empty list if no reference, or single item list containing the reference.
Overrides: object_models.xml.basic.BasicBase.get_refs

__str__(self)
(Informal representation operator)

source code 
Return string representation.
Overrides: object.__str__
(inherited documentation)

get_size(self, data=None)

source code 
Return number of bytes this type occupies in a file.
Returns:
Number of bytes.
Overrides: object_models.xml.basic.BasicBase.get_size

get_hash(self, data=None)

source code 
Return a hash value for the chunk referred to.
Returns:
An immutable object that can be used as a hash.
Overrides: object_models.xml.basic.BasicBase.get_hash