diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-19 16:19:25 +0200 |
commit | 55df757e98329e8e09afffe274ce2ceab269f8b3 (patch) | |
tree | 738b3a5b1c46e3b1b04184cfd9aeb32eb21af48a /odb/processor.cxx | |
parent | 6c01cad9cbfb6e69121d106226b2c50026f86fa9 (diff) |
Make processing top-level action, like validation and generation
Diffstat (limited to 'odb/processor.cxx')
-rw-r--r-- | odb/processor.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/odb/processor.cxx b/odb/processor.cxx new file mode 100644 index 0000000..601b6c1 --- /dev/null +++ b/odb/processor.cxx @@ -0,0 +1,34 @@ +// file : odb/processor.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v3; see accompanying LICENSE file + +#include <iostream> + +#include <odb/context.hxx> +#include <odb/processor.hxx> + +#include <odb/relational/processor.hxx> + +using namespace std; + +void processor:: +process (options const& ops, semantics::unit& unit, semantics::path const&) +{ + try + { + // Process types. + // + if (ops.database () != database::tracer) + { + auto_ptr<context> ctx (create_context (cerr, unit, ops)); + relational::process (); + } + } + catch (generation_failed const&) + { + // Processing failed. Diagnostics has already been issued. + // + throw failed (); + } +} |