diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-08-31 10:03:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-08-31 10:03:45 +0200 |
commit | c0957cfe1c73ecb6c96314e45e7d29b4199b20d6 (patch) | |
tree | 96a747f7196baa335cf83ff160527bb8333ca9e3 /odb/semantics/namespace.hxx | |
parent | ed52acc5e65dd9ea2fb2d9c851c2faa61d5cb2d9 (diff) |
Add support for virtual data members
New test: common/virtual.
Diffstat (limited to 'odb/semantics/namespace.hxx')
-rw-r--r-- | odb/semantics/namespace.hxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/odb/semantics/namespace.hxx b/odb/semantics/namespace.hxx index a4ead38..df48e437 100644 --- a/odb/semantics/namespace.hxx +++ b/odb/semantics/namespace.hxx @@ -5,12 +5,16 @@ #ifndef ODB_SEMANTICS_NAMESPACE_HXX #define ODB_SEMANTICS_NAMESPACE_HXX +#include <vector> + #include <odb/semantics/elements.hxx> namespace semantics { class namespace_: public scope { + typedef std::vector<namespace_*> extensions_type; + public: bool extension () const @@ -28,9 +32,28 @@ namespace semantics original (namespace_& ns) { original_ = &ns; + ns.extensions_.push_back (this); } public: + typedef extensions_type::const_iterator extensions_iterator; + + extensions_iterator + extensions_begin () const {return extensions_.begin ();} + + extensions_iterator + extensions_end () const {return extensions_.end ();} + + public: + virtual names* + lookup (string const& name, + type_id const&, + unsigned int flags = 0, + bool* hidden = 0) const; + + using scope::lookup; + + public: namespace_ (path const&, size_t line, size_t column, tree); // Resolve conflict between scope::scope and nameable::scope. @@ -42,6 +65,7 @@ namespace semantics private: namespace_* original_; + extensions_type extensions_; }; } |