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