Panda3D
 All Classes Functions Variables Enumerations
fileReference.h
1 // Filename: fileReference.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 FILEREFERENCE_H
16 #define FILEREFERENCE_H
17 
18 #include "pandabase.h"
19 
20 #include "typedReferenceCount.h"
21 #include "filename.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : FileReference
25 // Description : Keeps a reference-counted pointer to a file on disk.
26 // As long as the FileReference is held, someone
27 // presumably has a use for this file.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAEXPRESS FileReference : public TypedReferenceCount {
30 PUBLISHED:
31  INLINE FileReference(const Filename &filename);
32  INLINE const Filename &get_filename() const;
33 
34 protected:
35  Filename _filename;
36 
37 public:
38  static TypeHandle get_class_type() {
39  return _type_handle;
40  }
41  static void init_type() {
42  TypedReferenceCount::init_type();
43  register_type(_type_handle, "FileReference",
44  TypedReferenceCount::get_class_type());
45  }
46  virtual TypeHandle get_type() const {
47  return get_class_type();
48  }
49  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
50 
51 private:
52  static TypeHandle _type_handle;
53 };
54 
55 #include "fileReference.I"
56 
57 #endif
Keeps a reference-counted pointer to a file on disk.
Definition: fileReference.h:29
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
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