Panda3D
|
00001 // Filename: datagramSink.h 00002 // Created by: jason (07Jun00) 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 DATAGRAMSINK_H 00016 #define DATAGRAMSINK_H 00017 00018 #include "pandabase.h" 00019 00020 #include "datagram.h" 00021 00022 class SubfileInfo; 00023 class FileReference; 00024 class Filename; 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : DatagramSink 00028 // Description : This class defines the abstract interface to sending 00029 // datagrams to any target, whether it be into a file 00030 // or across the net 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDAEXPRESS DatagramSink { 00033 PUBLISHED: 00034 INLINE DatagramSink(); 00035 virtual ~DatagramSink(); 00036 00037 virtual bool put_datagram(const Datagram &data) = 0; 00038 virtual bool copy_datagram(SubfileInfo &result, const Filename &filename); 00039 virtual bool copy_datagram(SubfileInfo &result, const SubfileInfo &source); 00040 virtual bool is_error() = 0; 00041 virtual void flush() = 0; 00042 00043 virtual const Filename &get_filename(); 00044 virtual const FileReference *get_file(); 00045 virtual streampos get_file_pos(); 00046 }; 00047 00048 #include "datagramSink.I" 00049 00050 #endif 00051