Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/putil/test_bamWrite.cxx

Go to the documentation of this file.
00001 // Filename: test_bamWrite.cxx
00002 // Created by:  jason (09Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
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    // This initialization would normally be done by a ConfigureFn
00033    // block.
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    //Set up relationships
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 

Generated on Fri May 2 00:43:45 2003 for Panda by doxygen1.3