ENH: codedFixedValue: refactor coded

This commit is contained in:
mattijs
2011-10-24 21:33:16 +01:00
parent 1cc1ddcacf
commit cd64f1762f
7 changed files with 573 additions and 589 deletions

View File

@ -79,9 +79,7 @@ SourceFiles
#define codedFixedValueFvPatchField_H
#include "fixedValueFvPatchFields.H"
#include <dlfcn.h>
#include <link.h>
#include "codedBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -100,7 +98,8 @@ class IOdictionary;
template<class Type>
class codedFixedValueFvPatchField
:
public fixedValueFvPatchField<Type>
public fixedValueFvPatchField<Type>,
public codedBase
{
// Private data
@ -109,51 +108,29 @@ class codedFixedValueFvPatchField
const word redirectType_;
//- Previously loaded library
mutable fileName oldLibPath_;
mutable autoPtr<fvPatchField<Type> > redirectPatchFieldPtr_;
// Private Member Functions
const IOdictionary& dict() const;
//- Global loader/unloader function type
typedef void (*loaderFunctionType)(bool);
static int collectLibsCallback
(
struct dl_phdr_info *info,
size_t size,
void *data
);
//- Load specified library and execute globalFuncName(true)
void* loadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
) const;
//- Execute globalFuncName(false) and unload specified library
void unloadLibrary
(
const fileName& libPath,
const string& globalFuncName,
const dictionary& contextDict
) const;
//- Set the rewrite vars controlling the Type
static void setFieldTemplates(dynamicCode& dynCode);
//- Create library based on the dynamicCodeContext
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
//- get the loaded dynamic libraries
virtual dlLibraryTable& libs() const;
//- Update library as required
void updateLibrary() const;
//- adapt the context for the current object
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
// Return a description (type + name) for the output
virtual string description() const;
// Clear the ptr to the redirected object
virtual void clearRedirect() const;
// Get the dictionary to initialize the codeContext
virtual const dictionary& codeDict() const;
public: