'Initializes the current instance from an Aff4Object.
Iterates the inheritance hierarchy of the given Aff4Object and adds a
ApiAff4ObjectType for each class found in the hierarchy.
Args:
aff4_obj: An Aff4Object as source for the initialization.
Returns:
A reference to the current instance.'

def InitFromAff4Object(self, aff4_obj):

    attr_blacklist = []
    self.types = []
    for aff4_cls in aff4_obj.__class__.__mro__:
        if (not hasattr(aff4_cls, 'SchemaCls')):
            continue
        type_repr = ApiAff4ObjectType().InitFromAff4Object(aff4_obj, aff4_cls, attr_blacklist)
        if type_repr.attributes:
            self.types.append(type_repr)
        attr_blacklist.extend([attr.name for attr in type_repr.attributes])
    return self
