Panda3D
dcDeclaration.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 dcDeclaration.h
10  * @author drose
11  * @date 2004-06-18
12  */
13 
14 #ifndef DCDECLARATION_H
15 #define DCDECLARATION_H
16 
17 #include "dcbase.h"
18 
19 class DCClass;
20 class DCSwitch;
21 
22 /**
23  * This is a common interface for a declaration in a DC file. Currently, this
24  * is either a class or a typedef declaration (import declarations are still
25  * collected together at the top, and don't inherit from this object). Its
26  * only purpose is so that classes and typedefs can be stored in one list
27  * together so they can be ordered correctly on output.
28  */
29 class EXPCL_DIRECT_DCPARSER DCDeclaration {
30 public:
31  virtual ~DCDeclaration();
32 
33 PUBLISHED:
34  virtual DCClass *as_class();
35  virtual const DCClass *as_class() const;
36  virtual DCSwitch *as_switch();
37  virtual const DCSwitch *as_switch() const;
38 
39  virtual void output(std::ostream &out) const;
40  void write(std::ostream &out, int indent_level) const;
41 
42 public:
43  virtual void output(std::ostream &out, bool brief) const=0;
44  virtual void write(std::ostream &out, bool brief, int indent_level) const=0;
45 };
46 
47 INLINE std::ostream &operator << (std::ostream &out, const DCDeclaration &decl) {
48  decl.output(out);
49  return out;
50 }
51 
52 #endif
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
This represents a switch statement, which can appear inside a class body and represents two or more a...
Definition: dcSwitch.h:30
Defines a particular DistributedClass as read from an input .dc file.
Definition: dcClass.h:44
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a common interface for a declaration in a DC file.
Definition: dcDeclaration.h:29