00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <pandabase.h>
00020 #include <notify.h>
00021
00022 #include "test_bam.h"
00023
00024 int main(int argc, char* argv[])
00025 {
00026 string test_file("bamTest.out");
00027 datagram_file stream(test_file);
00028
00029 BamWriter manager(&stream);
00030 stream.open(file::FILE_WRITE);
00031
00032
00033
00034
00035 PointerTo<Parent> dad = new Parent("Attila", Person::MALE);
00036 PointerTo<Parent> mom = new Parent("Brunhilda", Person::FEMALE);
00037 PointerTo<Child> bro = new Child("Bob", Person::MALE);
00038 PointerTo<Child> sis = new Child("Mary Poppins", Person::FEMALE);
00039
00040
00041 dad->setSon(bro.p());
00042 dad->setDaughter(sis.p());
00043
00044 mom->setSon(bro.p());
00045 mom->setDaughter(sis.p());
00046
00047 bro->setMother(mom.p());
00048 bro->setFather(dad.p());
00049 bro->setSister(sis.p());
00050
00051 sis->setFather(dad.p());
00052 sis->setMother(mom.p());
00053 sis->setBrother(bro.p());
00054
00055 manager.init();
00056
00057 manager.write_object(dad.p());
00058 manager.write_object(mom.p());
00059 manager.write_object(bro.p());
00060 manager.write_object(sis.p());
00061
00062 stream.close();
00063 return 1;
00064 }
00065