Itasca C++ Interface
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members

Example implementation of the IFishLibrary interface. More...

#include <fishexample.h>

Inheritance diagram for FishExample:

Public Types

enum  Functions {
  FreqFunction =0 , AmpFunction , PhaseFunction , IntervalFunction ,
  NumberFunction , AllFunction , CreateFunction
}
 This enum is used to define ID numbers for the seven different FISH functions. More...
 

Public Member Functions

 FishExample (uint id, const QString &name, int numArguments, const QString &returnDescription, bool readOnly=true, const QString &argumentDescription=QString::null)
 
virtual QStringList createIntrinsics (IFish *fish)
 Creates 7 instances of this class for each intrinsic, and registers them, then calls delete this.
 
virtual QStringList createTypes (IFish *, bool)
 This example does not create any type, thus returns an empty QStringList.
 
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.
 
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.
 
virtual uint getID () const
 Returns the ID number of this particular instance of the library class, must be unique for each intrinsic the library adds.
 
virtual uint getSubID () const
 Returns a sub ID for automatically generated version of functions under a general ID. Optional.
 
virtual IString getName () const
 Returns the name of this intrinsic.
 
virtual QString getPluginName () const
 Name identifying the plugin that is adding possibly many intrinsics.
 
virtual bool getReadOnly () const
 Returns TRUE if the intrinsic may not appear on the left-hand-side of an assignment.
 
virtual int getNumArguments () const
 Returns the number of arguments the intrinsic requires, or -1 if that number may vary.
 
virtual QString getReturnDesc () const
 Returns a string describing the return type, used for help only.
 
virtual QString getArgumentDesc () const
 Returns a string describing the argument types, used for help only.
 
virtual bool willSave () const
 
virtual void archiveLibrary (IArchive &a)
 Saves/Restores data to the archive.
 
virtual void saveLibrary (Archive2 &a) const override
 
virtual bool restoreLibrary (Archive2 &a, quint64 label) override
 
virtual void remapLibrary (Archive2 &a) override
 
virtual void reset ()
 Clears data to the default settings, when a NEW Model is created.
 
virtual void destroy ()
 Destroys this particular instace of the library, representing this intrinsic.
 

Detailed Description

Example implementation of the IFishLibrary interface.

Defines a class that when loaded as an Itasca DLL plugin creates seven new FISH intrinsics.
These intrinsics allow the user to create the data for a sinusoidal Table, at a specified frequency, amplitude, phase, sampling interval, and length. The functions created are:

Member Enumeration Documentation

◆ Functions

This enum is used to define ID numbers for the seven different FISH functions.

Enumerator
FreqFunction 

example_freq ID number

AmpFunction 

example_amp ID number

PhaseFunction 

example_phase ID number

IntervalFunction 

example_int ID number

NumberFunction 

example_num ID number

AllFunction 

example_all ID number

CreateFunction 

example_create ID number

Member Function Documentation

◆ willSave()

virtual bool FishExample::willSave ( ) const
inlinevirtual

Indicates that the library defines data that it wants to save as part of the model state.
In this particular case, we only want to save one copy of the data, so we only save if the ID is 0.


The documentation for this class was generated from the following files: