Via C++
Easy procedure
As of Emdros version 1.1.11, the easiest way of interfacing with
Emdros is to use the CEmdrosEnv
API. This sets up all the machinery in the next section.
Full procedure
The following instructions are not necessary to
follow. You can simply use the CEmdrosEnv API. If you want to know how to do
without it, the following instructions tell you that.
Create an EMdF database object. This must not be an
EMdFDB object (since this is an
abstract class), but rather one of the descendants matching the
back-end you are running:
Check that the connection is OK with the ConnectionOk()
method. If not, back up and implement an error-recovery strategy of
your choice.
Create a CEMdFOutput
object. This is for specifying:
The default encoding (e.g., ISO-8859-1),
The std::ostream descendant on which output should be
printed (e.g., std::cout), and
The output kind (XML or Console).
Create a CMQL_execution_environment from the EMdF
database and the CEMdFOutput object.
Use the executing environment to interact with the MQL layer,
and the EMdF database object to interact with the EMdF layer.
- When you are done, delete the execution environment and the EMdF
database object.
Next
Next, we will see a code-snippet from the mql(1) program which
shows how to use the CEmdrosEnv
API.
|