Panda3D
Loading...
Searching...
No Matches
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
20class 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 */
26class EXPCL_DIRECT_DCPARSER DCTypedef : public DCDeclaration {
27public:
28 DCTypedef(DCParameter *parameter, bool implicit = false);
29 DCTypedef(const std::string &name);
30 virtual ~DCTypedef();
31
32PUBLISHED:
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
40public:
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
47private:
48 DCParameter *_parameter;
49 bool _bogus_typedef;
50 bool _implicit_typedef;
51 int _number;
52};
53
54#endif
This is a common interface for a declaration in a DC file.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
void write(std::ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
Represents the type specification for a single parameter within a field specification.
Definition dcParameter.h:35
This represents a single typedef declaration in the dc file.
Definition dcTypedef.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.