Via C++

Easy procedure

As of Emdros version 1.1.11, the easiest way of interfacing with Emdros is to use the EmdrosEnv API. This sets up all the machinery described in the next section.

Full procedure (mostly obsolete: Use EmdrosEnv instead)

The following instructions are not necessary to follow. You can simply use the EmdrosEnv API. If you want to know how to do without it, the following instructions tell you that.

  1. Create an EMdF database object. This must not be an EMdFDB object, but rather one of the descendants matching the back-end you are running:

  2. Check that the connection is OK with the connectionOk() method. If not, back up and implement an error-recovery strategy of your choice.

  3. Create a EMdFOutput 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, JSON, or Console).

  4. Create a MQLExecEnv from the EMdF database and the EMdFOutput object.

  5. Use the executing environment to interact with the MQL layer, and the EMdF database object to interact with the EMdF layer.

  6. 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 EmdrosEnv API.


Previous:Exit status codes
Up:How to call Emdros
Next:Example