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

A Dialog to enter a user-defined complex function, $ f: C \rightarrow C $. More...

#include <ComplexDialogImpl.h>

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

List of all members.

Public Member Functions

 ComplexDialogImpl (QWidget *parent=0, Qt::WFlags f=0)

Private Slots

virtual bool checkValidity ()
virtual bool loadFunction ()

Private Member Functions

virtual bool functionPresent (const QString &)
virtual void writeSource ()

Detailed Description

A Dialog to enter a user-defined complex function, $ f: C \rightarrow C $.

The function will then be compiled into a dynamic library and loaded to be displayed on screen.

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

Constructor & Destructor Documentation

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

ComplexDialogImpl c'tor taking parameters for the parent ComplexDialog, which in turn inherited them from QDialog 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::ComplexDialogImpl::checkValidity ( ) [private, virtual, slot]

this function is 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 guess.

Returns:
success

Referenced by ComplexDialogImpl().

Here is the caller graph for this function:

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

loads the dynamic library given by libName, if it exists and can be loaded. then it 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::ComplexDialogImpl::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 ComplexDialogImpl().

Here is the caller graph for this function:

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

write a C++ source file, containing the given function and some framework to make it 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