00001 // Filename: datagramInputFile.I 00002 // Created by: drose (30Oct00) 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 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: DatagramInputFile::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE DatagramInputFile:: 00026 DatagramInputFile() { 00027 _error = true; 00028 _read_first_datagram = false; 00029 _in = (istream *)NULL; 00030 _owns_in = false; 00031 } 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Function: DatagramInputFile::close 00035 // Access: Public 00036 // Description: Closes the file. This is also implicitly done when 00037 // the DatagramInputFile destructs. 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE void DatagramInputFile:: 00040 close() { 00041 _in_file.close(); 00042 if (_owns_in) { 00043 delete _in; 00044 _in = (istream *)NULL; 00045 _owns_in = false; 00046 } 00047 }