Panda3D
 All Classes Functions Variables Enumerations
dcTypedef.h
1 // Filename: dcTypedef.h
2 // Created by: drose (17Jun04)
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 DCTYPEDEF_H
16 #define DCTYPEDEF_H
17 
18 #include "dcbase.h"
19 #include "dcDeclaration.h"
20 
21 class DCParameter;
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : DCTypedef
25 // Description : This represents a single typedef declaration in the
26 // dc file. It assigns a particular type to a new name,
27 // just like a C typedef.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_DIRECT DCTypedef : public DCDeclaration {
30 public:
31  DCTypedef(DCParameter *parameter, bool implicit = false);
32  DCTypedef(const string &name);
33  virtual ~DCTypedef();
34 
35 PUBLISHED:
36  int get_number() const;
37  const string &get_name() const;
38  string get_description() const;
39 
40  bool is_bogus_typedef() const;
41  bool is_implicit_typedef() const;
42 
43 public:
44  DCParameter *make_new_parameter() const;
45 
46  void set_number(int number);
47  virtual void output(ostream &out, bool brief) const;
48  virtual void write(ostream &out, bool brief, int indent_level) const;
49 
50 private:
51  DCParameter *_parameter;
52  bool _bogus_typedef;
53  bool _implicit_typedef;
54  int _number;
55 };
56 
57 #endif
This represents a single typedef declaration in the dc file.
Definition: dcTypedef.h:29
Represents the type specification for a single parameter within a field specification.
Definition: dcParameter.h:39
This is a common interface for a declaration in a DC file.
Definition: dcDeclaration.h:33
void write(ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.