Add in write support, and change symbols to be both structures and constants.

This commit is contained in:
Mike Auty
2013-12-28 05:30:54 +00:00
parent cea4969b49
commit 26f8d0f7cc
10 changed files with 179 additions and 88 deletions
@@ -21,7 +21,11 @@ class ObjectInterface(validity.ValidityRoutines):
self._symbol_name = symbol_name
self._size = size
def write(self, value):
"""Writes the new value into the format at the offset the object currently resides at"""
def cast(self, new_symbol_name):
"""Returns a new object at the offset and from the layer that the current object inhabits"""
object_template = self._context.symbol_space.resolve(new_symbol_name)
return object_template(context = self._context, layer_name = self._layer_name, offset = self._offset)