Panda3D
Loading...
Searching...
No Matches
datagramGenerator.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 datagramGenerator.h
10 * @author jason
11 * @date 2000-06-07
12 */
13
14#ifndef DATAGRAMGENERATOR_H
15#define DATAGRAMGENERATOR_H
16
17#include "pandabase.h"
18
19#include "datagram.h"
20
21class SubfileInfo;
22class FileReference;
23class Filename;
24class VirtualFile;
25
26/**
27 * This class defines the abstract interace to any source of datagrams,
28 * whether it be from a file or from the net.
29 */
30class EXPCL_PANDA_EXPRESS DatagramGenerator {
31PUBLISHED:
32 INLINE DatagramGenerator();
33 virtual ~DatagramGenerator();
34
35 virtual bool get_datagram(Datagram &data) = 0;
36 virtual bool save_datagram(SubfileInfo &info);
37 virtual bool is_eof() = 0;
38 virtual bool is_error() = 0;
39
40 virtual const Filename &get_filename();
41 virtual time_t get_timestamp() const;
42 virtual const FileReference *get_file();
43 virtual VirtualFile *get_vfile();
44 virtual std::streampos get_file_pos();
45};
46
47#include "datagramGenerator.I"
48
49#endif
virtual std::streampos get_file_pos()
Returns the current file position within the data stream, if any, or 0 if the file position is not me...
virtual const FileReference * get_file()
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagr...
virtual const Filename & get_filename()
Returns the filename that provides the source for these datagrams, if any, or empty string if the dat...
virtual time_t get_timestamp() const
Returns the on-disk timestamp of the file that was read, at the time it was opened,...
virtual bool save_datagram(SubfileInfo &info)
Skips over the next datagram without extracting it, but saves the relevant file information in the Su...
DatagramGenerator()
Does nothing since this is class is just the definition of an interface.
virtual VirtualFile * get_vfile()
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagram...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
Keeps a reference-counted pointer to a file on disk.
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:26
The abstract base class for a file or directory within the VirtualFileSystem.
Definition virtualFile.h:35
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.