Singletons and Marshalling

C

Charles Hixson

Does anyone know how singleton's and marshalling interact?

In particular, I want to have my singleton class be able to dump and
load (and be saved on a file). So I'm wondering if there are any
methods to be implemented that would enable this.

In particular, I'm composing a kind of container class that will contain
either an array, a hash, or possibly both of values. Dumping it should
be basically dumping all the members of the hash/array (plus a few
more), and restoring should append the contents of the being-restored
value to the one in memory. (Duplicates aren't a problem as they'll
just be dropped.)

If this can't be done, there are other approaches, but as they involve
things like private class variables & classes that are only used
internally as a cache.... well, the other approach looks cleaner, if
it's possible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top