HyperspaceExplorer 0.7.1
Public Member Functions | Private Slots | Private Member Functions
UI::Dialogs::FunctionDialogImpl Class Reference

A Dialog to enter a function from $ R^3 \rightarrow R $. More...

#include <FunctionDialogImpl.h>

Inheritance diagram for UI::Dialogs::FunctionDialogImpl:
Inheritance graph
[legend]
Collaboration diagram for UI::Dialogs::FunctionDialogImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FunctionDialogImpl (QWidget *parent=0, Qt::WFlags f=0)
 FunctionDialogImpl c'tor - displays the dialog.

Private Slots

virtual bool checkValidity ()
 Called when the user clicks the OK button in the Function Dialog.
virtual bool loadFunction ()
 Display and load the selected DLL into current address space.

Private Member Functions

virtual bool functionPresent (const QString &)
 Loads the dynamic library given by libName, if it exists and can be loaded.
virtual void writeSource ()
 Write a C++ source file containing the given function.

Detailed Description

A Dialog to enter a function from $ R^3 \rightarrow R $.

The function which has been entered will then be compiled into a dynamic library and loaded to be displayed on screen as a Function.

Author:
Helge Preuss <lene.preuss@gmail.com>

Constructor & Destructor Documentation

UI::Dialogs::FunctionDialogImpl::FunctionDialogImpl ( QWidget *  parent = 0,
Qt::WFlags  f = 0 
)

FunctionDialogImpl c'tor - displays the dialog.

Parameters:
parentparent widget (NULL)
fwindow flags

References checkValidity(), and loadFunction().

Here is the call graph for this function:


Member Function Documentation

bool UI::Dialogs::FunctionDialogImpl::checkValidity ( ) [private, virtual, slot]

Called when the user clicks the OK button in the Function Dialog.

Checks whether all fields are filled in, whether the given function is valid C++ syntax, ie. whether it compiles, and whether the compiled code links into a dynamic library.

As a side effect, it generates this library.

Finally, it checks whether the library can be loaded. if so, it accepts the input.

Also, this function creates a directory structure "plugins/real" under the resource directory and changes the CWD to that folder for the duration of checkValidity ().

The name for this function is chosen rather unfortunately, i admit.

Returns:
success

Referenced by FunctionDialogImpl().

Here is the caller graph for this function:

bool UI::Dialogs::FunctionDialogImpl::functionPresent ( const QString &  libName) [private, virtual]

Loads the dynamic library given by libName, if it exists and can be loaded.

Then checks whether a function named f() is present. if so, returns true. else borks with an error message.

Parameters:
libNamefilename for the selected DLL
Returns:
success

Implements UI::Dialogs::PluginCreator.

bool UI::Dialogs::FunctionDialogImpl::loadFunction ( ) [private, virtual, slot]

Display and load the selected DLL into current address space.

Loads a dynamic library, which can be selected by the user on a QFileDialog. calls loadFunction () below. see there.

Returns:
success (?)

Implements UI::Dialogs::PluginCreator.

Referenced by FunctionDialogImpl().

Here is the caller graph for this function:

void UI::Dialogs::FunctionDialogImpl::writeSource ( ) [private, virtual]

Write a C++ source file containing the given function.

Also written is a little framework to make the source file compilable by g++ (there is currently no support for other compilers).

The resulting file "<function-name>.C" defines the function f() and the function symbolic(), which returns the function in symbolic terms, not in C++ syntax.

Implements UI::Dialogs::PluginCreator.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:19 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo