Itasca C++ Interface
iprogram.h
Go to the documentation of this file.
1 #pragma once
17 #include "base/src/baseqt.h"
18 
19 namespace itasca {
20  class IImportExport;
21  class IKernel;
22  class IKernelInput;
23  class IKernelOutput;
24 
37  class IProgram {
38  public:
40  virtual IString getName() const=0;
42  virtual uint32 getCodeVersion() const=0;
44  virtual uint32 getUpdateVersion() const=0;
50  virtual uint64 getStep() const=0;
52  virtual DExtent3 getModelExtent() const=0;
54  virtual IKernel * getIKernel()=0;
56  virtual const IKernel * getIKernel() const=0;
62  virtual void * findInterface(const QString &name)=0;
63  virtual const void * findInterface(const QString &name) const=0;
67  template <class T> T * findInterface() { return reinterpret_cast<T *>(findInterface(typeid(T).name())); }
71  template <class T> const T * findInterface() const { return reinterpret_cast<const T *>(findInterface(typeid(T).name())); }
77  virtual void registerInterface(const QString &name,void *iface,bool errorOnDuplicate=true)=0;
81  template <class T> void registerInterface(T *iface,bool errorOnDuplicate=true) { registerInterface(typeid(T).name(),reinterpret_cast<void *>(iface),errorOnDuplicate); }
83  virtual void destroy()=0;
86  virtual bool isModelMapped() const=0;
87  virtual QString getHomePath() const=0;
88  };
89 } // namespace itasca
90 namespace kernel {
91  using itasca::IProgram;
92 }
93 // EoF
All default base headers if Qt is being used.
Definition: istring.h:14
This Interface provides an entry point for command processing.
Definition: ikernel.h:38
Interface describing ALL input support the kernel needs to receive from whatever interface is driving...
Definition: ikernelinput.h:17
Interface describing ALL output support the kernel needs to send information to whatever interface is...
Definition: ikerneloutput.h:12
The main program access point.
Definition: iprogram.h:37
virtual IKernelOutput * getIKernelOutput()=0
Returns a pointer to the IKernelOutput object.
virtual const IKernel * getIKernel() const =0
Returns a const pointer to IKernel, the entry point for command processing.
void registerInterface(T *iface, bool errorOnDuplicate=true)
Definition: iprogram.h:81
virtual void registerInterface(const QString &name, void *iface, bool errorOnDuplicate=true)=0
T * findInterface()
Definition: iprogram.h:67
const T * findInterface() const
Definition: iprogram.h:71
virtual IKernel * getIKernel()=0
Returns a pointer to IKernel, the entry point for command processing.
virtual void * findInterface(const QString &name)=0
virtual void destroy()=0
Destroy the kernel.
virtual const void * findInterface(const QString &name) const =0
virtual uint64 getStep() const =0
Returns the total number of cycles - This particular functions is thread safe.
virtual bool isModelMapped() const =0
virtual uint32 getUpdateVersion() const =0
Returns the code Minor version.
virtual IKernelInput * getIKernelInput()=0
Returns a pointer to the IKernelInput object.
virtual DExtent3 getModelExtent() const =0
Returns the current model extent.
virtual uint32 getCodeVersion() const =0
Returns the code Major version.
virtual IString getName() const =0
Returns the code name.
namespace Itasca
Definition: basememory.cpp:10