diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 13:05:21 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 13:05:21 +0200 |
commit | 9c5b2f928699a6752d7c3d1a062bac7efc247c64 (patch) | |
tree | be169c837dc8c8e99972f63477699b61282d0d30 | |
parent | d7662d2cc72668eee0a21737edfcc1bbe41c229b (diff) |
Add complete() and abstract() predicates to semantics::class_
-rw-r--r-- | odb/relational/type-processor.cxx | 2 | ||||
-rw-r--r-- | odb/semantics/class.cxx | 12 | ||||
-rw-r--r-- | odb/semantics/class.hxx | 6 |
3 files changed, 19 insertions, 1 deletions
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); |