Panda3D
 All Classes Functions Variables Enumerations
datagramSink.h
1 // Filename: datagramSink.h
2 // Created by: jason (07Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef DATAGRAMSINK_H
16 #define DATAGRAMSINK_H
17 
18 #include "pandabase.h"
19 
20 #include "datagram.h"
21 
22 class SubfileInfo;
23 class FileReference;
24 class Filename;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : DatagramSink
28 // Description : This class defines the abstract interface to sending
29 // datagrams to any target, whether it be into a file
30 // or across the net
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_PANDAEXPRESS DatagramSink {
33 PUBLISHED:
34  INLINE DatagramSink();
35  virtual ~DatagramSink();
36 
37  virtual bool put_datagram(const Datagram &data) = 0;
38  virtual bool copy_datagram(SubfileInfo &result, const Filename &filename);
39  virtual bool copy_datagram(SubfileInfo &result, const SubfileInfo &source);
40  virtual bool is_error() = 0;
41  virtual void flush() = 0;
42 
43  virtual const Filename &get_filename();
44  virtual const FileReference *get_file();
45  virtual streampos get_file_pos();
46 };
47 
48 #include "datagramSink.I"
49 
50 #endif
51 
Keeps a reference-counted pointer to a file on disk.
Definition: fileReference.h:29
This class defines the abstract interface to sending datagrams to any target, whether it be into a fi...
Definition: datagramSink.h:32
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This class records a particular byte sub-range within an existing file on disk.
Definition: subfileInfo.h:29
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43