File kernel/src/modelingTools/PluggedObject.hpp

Go to the source code of this file

utilities for plugin definition to compute matrices or vectors from user-defined functions.

class PluggedObject
#include <PluggedObject.hpp>

Class to deal with plugged functions.

A plugin is a C-function defined in some external file.

This object handles a function pointer to this C-function.

Subclassed by SubPluggedObject

Public Functions

PluggedObject()

Default Constructor.

PluggedObject(const std::string &name)

Constructor with the plugin name.

Parameters
  • name: a std::string of the form “fileName:functionName”, without an extension for pluginFile

PluggedObject(const PluggedObject &PO)

Copy constructor.

Parameters

virtual ~PluggedObject()

destructor

bool isPlugged() const

bool to checked if a function is properly connected to the current object

Return
a boolean, true if fPtr is set

std::string pluginName(void) const

Return the name of the plugin used to compute fPtr.

Return
_pluginName (a std::string)

void setComputeFunction(const std::string &pluginPath, const std::string &functionName)

Connect a function to fPtr.

Parameters
  • pluginPath: name of the file where the function is defined (WITH extension)
  • functionName: name of the function to be connected

void setComputeFunction(const std::string &plugin)
void setComputeFunction(void)

Connect _pluginName to fPtr.

Warning
_pluginName must have been set before !

void setComputeFunction(void *functionPtr)

Connect input function to fPtr.

Parameters
  • functionPtr: a pointer to a C function

Public Members

void *fPtr

plug-in

Protected Attributes

std::string _pluginName

Plugin name, should be of the form “fileName:functionName”.

Private Functions

ACCEPT_SERIALIZATION(PluggedObject)