XmlArchive.archivePointer

Archives a pointer.

If a pointer points to a value that is serialized as well, the pointer should be archived as a reference. Otherwise the value that the pointer points to should be serialized as a regular value.

class XmlArchive(U = char)
void
archivePointer
(
string key
,
Id id
,
void delegate
()
dg
)

Parameters

key string

the key associated with the pointer

id Id

the id associated with the pointer

dg void delegate
()

a callback that performs the archiving of value pointed to by the pointer

Examples

class Foo
{
    int a;
    int* b;
}

auto foo = new Foo;
foo.a = 3;
foo.b = &foo.a;

archive = new XmlArchive!();
archive.archivePointer("b", 0, {
    // archive "foo.b" as a reference
});
int a = 3;

class Foo
{
    int* b;
}

auto foo = new Foo;
foo.b = &a;

archive = new XmlArchive!();
archive.archivePointer("b", 0, {
    // archive "foo.b" as a regular value
});

Meta