Commit 01b16427 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

use exec() instead of run(), since base class has to return result.

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3978
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 663e9d68
...@@ -41,7 +41,7 @@ $Id$ ...@@ -41,7 +41,7 @@ $Id$
- \ref main_subsec_cxxusers - \ref main_subsec_cxxusers
- \ref main_sec_implementers - \ref main_sec_implementers
\section main_sec_users The libraray libstfinv for users \section main_sec_users The library libstfinv for users
The purpose of this library is to provide methods for the derivation of The purpose of this library is to provide methods for the derivation of
source-time-functions in approaches to full waveform inversion. source-time-functions in approaches to full waveform inversion.
...@@ -95,7 +95,7 @@ $Id$ ...@@ -95,7 +95,7 @@ $Id$
stfinv::STFBaseEngine. stfinv::STFBaseEngine.
Most of the framework can simply be copied. Most of the framework can simply be copied.
The core function is the virtual function like The core function is the virtual function like
stfinv::STFEngineIdentity::run() which actuall determines the new source stfinv::STFEngineIdentity::exec() which actuall determines the new source
time function. time function.
For the implementation there are some \ref tools provided in the library. For the implementation there are some \ref tools provided in the library.
......
...@@ -155,12 +155,26 @@ namespace stfinv { ...@@ -155,12 +155,26 @@ namespace stfinv {
public: public:
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFBaseEngine() { } virtual ~STFBaseEngine() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run() { STFINV_baseillegal; } /*! \name Basic interface for users
* \sa \ref main_sec_users
*/
//@{
//! \brief Start engine and return reference to source time function.
stfinv::Waveform run()
{
this->exec();
return(Mstf);
}
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief return name of engine //! \brief return name of engine
virtual const char* name() const; virtual const char* name() const;
//@}
/*! \name Shape query functions
*/
//@{
//! \brief return number of samples used in time series //! \brief return number of samples used in time series
unsigned int nsamples() const unsigned int nsamples() const
{ return (Mstf.sampling.n); } { return (Mstf.sampling.n); }
...@@ -170,6 +184,11 @@ namespace stfinv { ...@@ -170,6 +184,11 @@ namespace stfinv {
//! \brief return sampling interval //! \brief return sampling interval
double dt() const double dt() const
{ return (Mstf.sampling.dt); } { return (Mstf.sampling.dt); }
//@}
/*! \name Data query functions
*/
//@{
//! \brief return source time function series //! \brief return source time function series
Tseries stf() const Tseries stf() const
{ return (Mstf.series); } { return (Mstf.series); }
...@@ -179,7 +198,12 @@ namespace stfinv { ...@@ -179,7 +198,12 @@ namespace stfinv {
Tseries::Tcoc synthetic(const unsigned int& i) const ; Tseries::Tcoc synthetic(const unsigned int& i) const ;
//! \brief return synthetic data convolved with stf at receiver \c i //! \brief return synthetic data convolved with stf at receiver \c i
Tseries convolvedsynthetic(const unsigned int& i) const ; Tseries convolvedsynthetic(const unsigned int& i) const ;
//@}
protected: protected:
/*! \name Functions presented to derived classes
*/
//@{
//! \brief return the value of a parameters //! \brief return the value of a parameters
std::string parameter(const std::string& key, std::string parameter(const std::string& key,
const std::string& defvalue="false") const; const std::string& defvalue="false") const;
...@@ -187,11 +211,20 @@ namespace stfinv { ...@@ -187,11 +211,20 @@ namespace stfinv {
bool parameterisset(const std::string& key) const; bool parameterisset(const std::string& key) const;
//! \brief check for vaid receiver index //! \brief check for vaid receiver index
void checkreceiverindex(const unsigned int& i) const; void checkreceiverindex(const unsigned int& i) const;
//@}
//! \brief Virtual function to run engine
virtual void exec() { STFINV_baseillegal; }
private: private:
/*! \name Functions implementing base class operation
*/
//@{
//! \brief parse parameters in Mparameters //! \brief parse parameters in Mparameters
void parseparameters(std::string parameters); void parseparameters(std::string parameters);
//! \brief Check consistency of data members. //! \brief Check consistency of data members.
void checkconsistency() const; void checkconsistency() const;
//@}
// member data // member data
// ----------- // -----------
......
...@@ -50,10 +50,10 @@ namespace stfinv { ...@@ -50,10 +50,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineBlindDeconvolution::run() void STFEngineBlindDeconvolution::exec()
{ {
STFINV_abort("STFEngineBlindDeconvolution::run not yet implemented"); STFINV_abort("STFEngineBlindDeconvolution::run not yet implemented");
} // void STFEngineBlindDeconvolution::run() } // void STFEngineBlindDeconvolution::exec()
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -65,8 +65,8 @@ namespace stfinv { ...@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { } :Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFEngineBlindDeconvolution() { } virtual ~STFEngineBlindDeconvolution() { }
//! \brief Start engine and return source time function. //! \brief Start engine
virtual stfinv::Waveform run(); virtual void exec();
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help //! \brief print online help
......
...@@ -49,10 +49,10 @@ namespace stfinv { ...@@ -49,10 +49,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineFixedWavelet::run() void STFEngineFixedWavelet::exec()
{ {
STFINV_abort("STFEngineFixedWavelet::run not yet implemented"); STFINV_abort("STFEngineFixedWavelet::run not yet implemented");
} // void STFEngineFixedWavelet::run() } // void STFEngineFixedWavelet::exec()
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -65,8 +65,8 @@ namespace stfinv { ...@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { } :Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFEngineFixedWavelet() { } virtual ~STFEngineFixedWavelet() { }
//! \brief Start engine and return source time function. //! \brief Start engine
virtual stfinv::Waveform run(); virtual void exec();
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help //! \brief print online help
......
...@@ -83,8 +83,8 @@ namespace stfinv { ...@@ -83,8 +83,8 @@ namespace stfinv {
public: public:
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFFourierDomainEngine() { } virtual ~STFFourierDomainEngine() { }
//! \brief Start engine and return source time function. //! \brief Start engine
virtual stfinv::Waveform run() { STFINV_baseillegal; } virtual void exec() { STFINV_baseillegal; }
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help //! \brief print online help
......
...@@ -49,10 +49,10 @@ namespace stfinv { ...@@ -49,10 +49,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineIdentity::run() void STFEngineIdentity::exec()
{ {
STFINV_abort("STFEngineIdentity::run not yet implemented"); STFINV_abort("STFEngineIdentity::run not yet implemented");
} // void STFEngineIdentity::run() } // void STFEngineIdentity::exec()
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
......
...@@ -65,8 +65,8 @@ namespace stfinv { ...@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { } :Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFEngineIdentity() { } virtual ~STFEngineIdentity() { }
//! \brief Start engine and return source time function. //! \brief Start engine
virtual stfinv::Waveform run(); virtual void exec();
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help //! \brief print online help
......
...@@ -65,8 +65,8 @@ namespace stfinv { ...@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { } :Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor //! \brief abstract base requires virtual destructor
virtual ~STFEngineNormalize() { } virtual ~STFEngineNormalize() { }
//! \brief Start engine and return source time function. //! \brief Start engine
virtual stfinv::Waveform run(); virtual void exec() { STFINV_baseillegal; }
//! \brief print online help //! \brief print online help
virtual void help(std::ostream& os=std::cout) const; virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help //! \brief print online help
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment