Panda3D
|
00001 // Filename: fltBeadID.h 00002 // Created by: drose (24Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef FLTBEADID_H 00016 #define FLTBEADID_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltBead.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : FltBeadID 00024 // Description : A base class for any of a broad family of flt beads 00025 // that include an ID. 00026 //////////////////////////////////////////////////////////////////// 00027 class FltBeadID : public FltBead { 00028 public: 00029 FltBeadID(FltHeader *header); 00030 00031 const string &get_id() const; 00032 void set_id(const string &id); 00033 00034 virtual void output(ostream &out) const; 00035 00036 protected: 00037 virtual bool extract_record(FltRecordReader &reader); 00038 virtual bool extract_ancillary(FltRecordReader &reader); 00039 00040 virtual bool build_record(FltRecordWriter &writer) const; 00041 virtual FltError write_ancillary(FltRecordWriter &writer) const; 00042 00043 private: 00044 string _id; 00045 00046 public: 00047 virtual TypeHandle get_type() const { 00048 return get_class_type(); 00049 } 00050 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00051 static TypeHandle get_class_type() { 00052 return _type_handle; 00053 } 00054 static void init_type() { 00055 FltBead::init_type(); 00056 register_type(_type_handle, "FltBeadID", 00057 FltBead::get_class_type()); 00058 } 00059 00060 private: 00061 static TypeHandle _type_handle; 00062 }; 00063 00064 #endif 00065 00066