Panda3D
temporaryFile.h
1 // Filename: temporaryFile.h
2 // Created by: drose (23Jun11)
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 TEMPORARYFILE_H
16 #define TEMPORARYFILE_H
17 
18 #include "pandabase.h"
19 
20 #include "fileReference.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : TemporaryFile
24 // Description : This is a special kind of FileReference class that
25 // automatically deletes the file in question when it is
26 // deleted. It is not responsible for creating,
27 // opening, or closing the file, however.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAEXPRESS TemporaryFile : public FileReference {
30 PUBLISHED:
31  INLINE TemporaryFile(const Filename &filename);
32  virtual ~TemporaryFile();
33 
34 public:
35  static TypeHandle get_class_type() {
36  return _type_handle;
37  }
38  static void init_type() {
39  FileReference::init_type();
40  register_type(_type_handle, "TemporaryFile",
41  FileReference::get_class_type());
42  }
43  virtual TypeHandle get_type() const {
44  return get_class_type();
45  }
46  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
47 
48 private:
49  static TypeHandle _type_handle;
50 };
51 
52 #include "temporaryFile.I"
53 
54 #endif
Keeps a reference-counted pointer to a file on disk.
Definition: fileReference.h:29
This is a special kind of FileReference class that automatically deletes the file in question when it...
Definition: temporaryFile.h:29
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85