CBMC
cpp_namespace_spec.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: C++ Language Type Checking
4 
5 Author: Daniel Kroening, kroening@cs.cmu.edu
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_CPP_CPP_NAMESPACE_SPEC_H
13 #define CPROVER_CPP_CPP_NAMESPACE_SPEC_H
14 
15 #include <util/expr.h>
16 
17 #include "cpp_name.h"
18 
20 {
21 public:
22  cpp_namespace_spect():exprt(ID_cpp_namespace_spec)
23  {
24  alias().make_nil();
25  }
26 
27  typedef std::vector<class cpp_itemt> itemst;
28 
29  const itemst &items() const
30  {
31  return (const itemst &)operands();
32  }
33 
35  {
36  return (itemst &)operands();
37  }
38 
39  const irep_idt &get_namespace() const
40  {
41  return get(ID_namespace);
42  }
43 
44  void set_namespace(const irep_idt &_namespace)
45  {
46  set(ID_namespace, _namespace);
47  }
48 
50  {
51  return static_cast<cpp_namet &>(add(ID_alias));
52  }
53 
54  const cpp_namet &alias() const
55  {
56  return static_cast<const cpp_namet &>(find(ID_alias));
57  }
58 
59  void output(std::ostream &out) const;
60 
61  void set_is_inline(bool value)
62  {
63  set(ID_is_inline, value);
64  }
65 
66  bool get_is_inline() const
67  {
68  return get_bool(ID_is_inline);
69  }
70 };
71 
72 #endif // CPROVER_CPP_CPP_NAMESPACE_SPEC_H
bool get_is_inline() const
const itemst & items() const
const irep_idt & get_namespace() const
std::vector< class cpp_itemt > itemst
void output(std::ostream &out) const
void set_namespace(const irep_idt &_namespace)
const cpp_namet & alias() const
void set_is_inline(bool value)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
Base class for all expressions.
Definition: expr.h:56
operandst & operands()
Definition: expr.h:94
bool get_bool(const irep_idt &name) const
Definition: irep.cpp:57
const irept & find(const irep_idt &name) const
Definition: irep.cpp:93
const irep_idt & get(const irep_idt &name) const
Definition: irep.cpp:44
void set(const irep_idt &name, const irep_idt &value)
Definition: irep.h:412
void make_nil()
Definition: irep.h:446
irept & add(const irep_idt &name)
Definition: irep.cpp:103