From 9c5b2f928699a6752d7c3d1a062bac7efc247c64 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2011 13:05:21 +0200 Subject: Add complete() and abstract() predicates to semantics::class_ --- odb/relational/type-processor.cxx | 2 +- odb/semantics/class.cxx | 12 ++++++++++++ odb/semantics/class.hxx | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/odb/relational/type-processor.cxx b/odb/relational/type-processor.cxx index 511ac9e..18d411c 100644 --- a/odb/relational/type-processor.cxx +++ b/odb/relational/type-processor.cxx @@ -644,7 +644,7 @@ namespace relational // Make sure the pointed-to class is complete. // - if (!COMPLETE_TYPE_P (c->tree_node ())) + if (!c->complete ()) { os << m.file () << ":" << m.line () << ":" << m.column () << ": " << "error: pointed-to class '" << c->fq_name () << "' " diff --git a/odb/semantics/class.cxx b/odb/semantics/class.cxx index 6d1621a..05122e3 100644 --- a/odb/semantics/class.cxx +++ b/odb/semantics/class.cxx @@ -28,6 +28,18 @@ namespace semantics return TYPE_HAS_DEFAULT_CONSTRUCTOR (tree_node ()); } + bool class_:: + complete () const + { + return COMPLETE_TYPE_P (tree_node ()); + } + + bool class_:: + abstract () const + { + return CLASSTYPE_PURE_VIRTUALS (tree_node ()); + } + // type info // namespace diff --git a/odb/semantics/class.hxx b/odb/semantics/class.hxx index 2d86cff..6d3b83b 100644 --- a/odb/semantics/class.hxx +++ b/odb/semantics/class.hxx @@ -91,6 +91,12 @@ namespace semantics bool default_ctor () const; + bool + complete () const; + + bool + abstract () const; + public: class_ (path const&, size_t line, size_t column, tree); -- cgit v1.1