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