Tellurium Plugin C API  1.0.0
Plugin Framework for Tellurium
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Tellurium Plugin Framework for libRoadRunner

Introduction

RoadRunner is a SBML compliant high performance and portable simulation engine for systems and synthetic biology.

The plugin framework documented here, is available to assist in using and creating extensions (Plugins) to the main RoadRunner Core. A simple example (a C++ program using RoadRunners C API's) on how to get access to plugins is shown below.

#include <iostream>
#include "rrc_api.h"
using namespace std;
using namespace rrc;
using namespace tlp;
int main()
{
tpLoadPlugins(pmHandle);
cout<<"Nr of loaded plugins:" << tpGetNumberOfPlugins(pmHandle)<<endl;
RRStringArrayPtr names = tpGetPluginNames(pmHandle);
if(!names)
{
cout<<"No plugins loaded ..";
return 0;
}
for(int i = 0; i < names->Count; i++)
cout<<"\n";
cout<<"Plugin name: " <<names->String[i]<<endl;
//Get a handle to a plugin
TELHandle plHandle = tpGetPlugin(pmHandle, names->String[i]);
cout <<tpGetPluginInfo(plHandle)<<endl;
}
//Cleanup.
tpFreeStringArray(names);
tpUnLoadPlugins(pmHandle);
return 0;
}

Overview

The Tellurium Plugin API is centered around three important concepts:

How to use plugins

A typical use case of the Plugin API may be as follows:

Plugin usage scenario

  1. Client creates a PluginManager.
  2. Client load plugins using the Plugin Manager.
  3. Client get a handle to a plugin.
  4. Client get a handle to a specific property in the plugin.
  5. Client set the value of the property.
  6. Client excutes the plugin.
  7. Client retrieve the value of a plugins property, e.g. a "result" property.

How to write plugins

The current plugin framework aim towards being a minimalistic API. As such, it is designed to give a plugin developer maximum amount of room for interacting with the RoadRunner core, and at the same time, a minimum of requirements and abstract concepts getting in the way of designing a plugin.

This section will show you how to get on the way with your first plugin, using pure C. See examples and documentation on the C++ pages on how to create a plugin using C++.

The plugin code

As any roadrunner plugin need to be compiled into a shared library, so does a plugin written in C. The following example will show how to design and create a plugin with one plugin property, named Demo Property. The purpose of the plugin is to populate this property with some data, generated by the core RoadRunner API.

Installation

Installation documentation is provided on the RoadRunner homepage: http://www.libroadrunner.org

License

Copyright (C) 2012 University of Washington, Seattle, WA, USA

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In plain english this means:

You CAN freely download and use this software, in whole or in part, for personal, company internal, or commercial purposes;

You CAN use the software in packages or distributions that you create.

You SHOULD include a copy of the license in any redistribution you may make;

You are NOT required include the source of software, or of any modifications you may have made to it, in any redistribution you may assemble that includes it.

YOU CANNOT:

redistribute any piece of this software without proper attribution;