GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TANGRAM::TYPE::DUMP (3)

.ds Aq ’

NAME

Tangram::Type::Dump - Handy functions for Pixie-like dumping of data

CONTENTS

SYNOPSIS



  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.
  nuke $frozen;

  # 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
  my $structure;
  flatten($storage, $structure);
  # ... do something with it ...

  # restore to former glory; note that Tangrams cache will
  # prevent unnecessary DB access.
  unflatten($storage, $structure);



DESCRIPTION

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.

FUNCTIONS

<B>flatten($storage, B>$structure<B>)B> Traverses the structure <B>B>$structure<B>B>, and replaces all the known (ie, already inserted) Tangram objects with references to them
<B>unflatten($storage, B>$structure<B>)B> Performs the logical opposite of <B>flattenB>, but only insofar as a ‘normal’ user is concerned. ‘Normal’ users, of course, don’t care that the data structure is being loaded from the database as they use it :).

BUGS

Should this module just be an extension to Tangram::Storage ?

AUTHOR

Sam Vilain, samv@cpan.org. All rights reserved. This code is free software; you can use and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TANGRAM::TYPE::DUMP (3) 2015-10-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.