Manual Reference Pages - TANGRAM::TYPE::DUMP (3)
Tangram::Type::Dump - Handy functions for Pixie-like dumping of data
use Tangram::Type::Dump qw(flatten unflatten UNflatten nuke);
use YAML qw(freeze thaw); # for instance
my $frozen = freeze flatten($storage, $structure);
# optional - remove circular references from flattened
# structure so that it is freed up properly.
# save frozen somewhere...
# restore, but dont load objects straight away
my $reconstituted = unflatten($storage, thaw $frozen);
# restore, loading objects immediately
my $original = UNflatten($storage, $frozen);
# Alternative, quickly marshall a structure for saving
# ... do something with it ...
# restore to former glory; note that Tangrams cache will
# prevent unnecessary DB access.
This module contains functions for traversing data structures which
are not Tangram-registered objects, and replacing all the Tangram
objects found with Mementos.
When a similar data structure is fed back into the reversal function,
the mementos are filled with on-demand references to the real objects.
All these functions operate <B>in placeB> for maximum efficiency.
Traverses the structure <B>B>$structure<B>B>, and replaces all the known (ie,
already inserted) Tangram objects with references to them
Performs the logical opposite of <B>flattenB>, but only insofar as a
normal user is concerned. Normal users, of course, dont care
that the data structure is being loaded from the database as they use
Should this module just be an extension to Tangram::Storage ?
Sam Vilain, email@example.com. All rights reserved. This code is free
software; you can use and/or modify it under the same terms as Perl
|perl v5.20.3 ||TANGRAM::TYPE::DUMP (3) ||2015-10-09 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.