Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
OPENMI:4.6 Step 6 - Implementing the MyModelLinkablComponent
OPENMI:4.6 Step 6 - Implementing the MyModelLinkablComponent

4.

...

The sixth step is to implement the MyModeLinkableComponent class (Figure 12).

Image Removed

The MyModelLinkableComponent is the OpenMI-compliant linkable component that is going to be accessed by other models. Implementation of this class is very simple. The example code shown below is the complete implementation for the Simple River model.

Code Block

using System; namespace MyOrganisation.OpenMI.MyModel {    public class MyModelOpenMIComponent :    org.OpenMI.Utilities.Wrapper.LinkableEngine    {       protected override void SetEngineApiAccess()       {          \_engineApiAccess = new MyEngineWrapper();       }    } }

This class inherits from the LinkableEngine class. The class creates the EngineWrapper and assigns it to the protected field variable _engineApiAccess.

4.7 Step 7: Implementation of the remaining IEngine methods

...