8#include "fish/interface/ifishlibrary.h"
43 FishExample(uint
id,
const QString &name,
int numArguments,
const QString &returnDescription,
44 bool readOnly=
true,
const QString &argumentDescription=QString::null);
48 virtual QStringList
createTypes(IFish *,
bool) {
return QStringList();}
50 virtual void get(
IProgram *prog,uint
id,
const IFishArguments *reg,IFishParam *p);
52 virtual void set(
IProgram *prog,uint
id,
const IFishArguments *reg,
const IFishParam *p);
55 virtual uint
getID()
const {
return id_; }
75 virtual void saveLibrary(Archive2 &a)
const override;
76 virtual bool restoreLibrary(Archive2 &a,quint64 label)
override;
77 virtual void remapLibrary(Archive2 &a)
override;
86 QString returnDescription_;
88 QString argumentDescription_;
91 static Double frequency_;
92 static Double amplitude_;
94 static Double interval_;
95 static qptrdiff number_;
Example implementation of the IFishLibrary interface.
Definition fishexample.h:25
Functions
This enum is used to define ID numbers for the seven different FISH functions.
Definition fishexample.h:28
@ IntervalFunction
example_int ID number
Definition fishexample.h:31
@ FreqFunction
example_freq ID number
Definition fishexample.h:28
@ AmpFunction
example_amp ID number
Definition fishexample.h:29
@ CreateFunction
example_create ID number
Definition fishexample.h:34
@ AllFunction
example_all ID number
Definition fishexample.h:33
@ NumberFunction
example_num ID number
Definition fishexample.h:32
@ PhaseFunction
example_phase ID number
Definition fishexample.h:30
virtual QStringList createTypes(IFish *, bool)
This example does not create any type, thus returns an empty QStringList.
Definition fishexample.h:48
virtual IString getName() const
Returns the name of this intrinsic.
Definition fishexample.h:59
virtual uint getSubID() const
Returns a sub ID for automatically generated version of functions under a general ID....
Definition fishexample.h:57
virtual uint getID() const
Returns the ID number of this particular instance of the library class, must be unique for each intri...
Definition fishexample.h:55
virtual QString getArgumentDesc() const
Returns a string describing the argument types, used for help only.
Definition fishexample.h:69
virtual void destroy()
Destroys this particular instace of the library, representing this intrinsic.
Definition fishexample.h:81
virtual QString getReturnDesc() const
Returns a string describing the return type, used for help only.
Definition fishexample.h:67
virtual int getNumArguments() const
Returns the number of arguments the intrinsic requires, or -1 if that number may vary.
Definition fishexample.h:65
virtual bool getReadOnly() const
Returns TRUE if the intrinsic may not appear on the left-hand-side of an assignment.
Definition fishexample.h:63
virtual bool willSave() const
Definition fishexample.h:72
The main program access point.
Definition iprogram.h:37
virtual void reset()
Clears data to the default settings, when a NEW Model is created.
Definition fishexample.cpp:204
virtual void set(IProgram *prog, uint id, const IFishArguments *reg, const IFishParam *p)
Called if the intrinsic appears on the left-hand-side of an assignment.
Definition fishexample.cpp:152
FishExample(uint id, const QString &name, int numArguments, const QString &returnDescription, bool readOnly=true, const QString &argumentDescription=QString::null)
Definition fishexample.cpp:73
virtual void archiveLibrary(IArchive &a)
Saves/Restores data to the archive.
Definition fishexample.cpp:163
virtual QStringList createIntrinsics(IFish *fish)
Creates 7 instances of this class for each intrinsic, and registers them, then calls delete this.
Definition fishexample.cpp:88
virtual QString getPluginName() const
Name identifying the plugin that is adding possibly many intrinsics.
Definition fishexample.cpp:80
virtual void get(IProgram *prog, uint id, const IFishArguments *reg, IFishParam *p)
Called if the intrinsic appears on the right-hand-side of an assignment.
Definition fishexample.cpp:105
namespace Itasca
Definition basememory.cpp:10