Panda3D
dcTypedef.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 dcTypedef.h
10  * @author drose
11  * @date 2004-06-17
12  */
13 
14 #ifndef DCTYPEDEF_H
15 #define DCTYPEDEF_H
16 
17 #include "dcbase.h"
18 #include "dcDeclaration.h"
19 
20 class DCParameter;
21 
22 /**
23  * This represents a single typedef declaration in the dc file. It assigns a
24  * particular type to a new name, just like a C typedef.
25  */
26 class EXPCL_DIRECT_DCPARSER DCTypedef : public DCDeclaration {
27 public:
28  DCTypedef(DCParameter *parameter, bool implicit = false);
29  DCTypedef(const std::string &name);
30  virtual ~DCTypedef();
31 
32 PUBLISHED:
33  int get_number() const;
34  const std::string &get_name() const;
35  std::string get_description() const;
36 
37  bool is_bogus_typedef() const;
38  bool is_implicit_typedef() const;
39 
40 public:
41  DCParameter *make_new_parameter() const;
42 
43  void set_number(int number);
44  virtual void output(std::ostream &out, bool brief) const;
45  virtual void write(std::ostream &out, bool brief, int indent_level) const;
46 
47 private:
48  DCParameter *_parameter;
49  bool _bogus_typedef;
50  bool _implicit_typedef;
51  int _number;
52 };
53 
54 #endif
This represents a single typedef declaration in the dc file.
Definition: dcTypedef.h:26
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents the type specification for a single parameter within a field specification.
Definition: dcParameter.h:35
This is a common interface for a declaration in a DC file.
Definition: dcDeclaration.h:29
void write(std::ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.