Panda3D
interrogateManifest.h
1 // Filename: interrogateManifest.h
2 // Created by: drose (11Aug00)
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 INTERROGATEMANIFEST_H
16 #define INTERROGATEMANIFEST_H
17 
18 #include "dtoolbase.h"
19 
20 #include "interrogateComponent.h"
21 
22 class IndexRemapper;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : InterrogateManifest
26 // Description : An internal representation of a manifest constant.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_DTOOLCONFIG InterrogateManifest : public InterrogateComponent {
29 public:
30  INLINE InterrogateManifest(InterrogateModuleDef *def = NULL);
31  INLINE InterrogateManifest(const InterrogateManifest &copy);
32  INLINE void operator = (const InterrogateManifest &copy);
33 
34  INLINE const string &get_definition() const;
35  INLINE bool has_type() const;
36  INLINE TypeIndex get_type() const;
37  INLINE bool has_getter() const;
38  INLINE FunctionIndex get_getter() const;
39  INLINE bool has_int_value() const;
40  INLINE int get_int_value() const;
41 
42  void output(ostream &out) const;
43  void input(istream &in);
44 
45  void remap_indices(const IndexRemapper &remap);
46 
47 private:
48  enum Flags {
49  F_has_type = 0x0001,
50  F_has_getter = 0x0002,
51  F_has_int_value = 0x0004
52  };
53 
54  int _flags;
55  string _definition;
56  int _int_value;
57  TypeIndex _type;
58  FunctionIndex _getter;
59 
60  friend class InterrogateBuilder;
61 };
62 
63 INLINE ostream &operator << (ostream &out, const InterrogateManifest &manifest);
64 INLINE istream &operator >> (istream &in, InterrogateManifest &manifest);
65 
66 #include "interrogateManifest.I"
67 
68 #endif
This class manages a mapping of integers to integers.
Definition: indexRemapper.h:33
void input(istream &in)
Reads the data file as previously formatted by output().
void output(ostream &out) const
Formats the component for output to a data file.
An internal representation of a manifest constant.
The base class for things that are part of the interrogate database.