aboutsummaryrefslogtreecommitdiff
path: root/odb/semantics/namespace.hxx
blob: 96db4a72b2c6a26be69ca3a327f40ba9232ca309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// file      : odb/semantics/namespace.hxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license   : GNU GPL v3; see accompanying LICENSE file

#ifndef ODB_SEMANTICS_NAMESPACE_HXX
#define ODB_SEMANTICS_NAMESPACE_HXX

#include <odb/semantics/elements.hxx>

namespace semantics
{
  class namespace_: public scope
  {
  public:
    bool
    extension () const
    {
      return original_ != 0;
    }

    namespace_&
    original ()
    {
      return *original_;
    }

    void
    original (namespace_& ns)
    {
      original_ = &ns;
    }

  public:
    namespace_ (path const&, size_t line, size_t column, tree);

    // Resolve conflict between scope::scope and nameable::scope.
    //
    using nameable::scope;

  protected:
    namespace_ ();

  private:
    namespace_* original_;
  };
}

#endif // ODB_SEMANTICS_NAMESPACE_HXX