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$
- \ref main_subsec_cxxusers
- \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
source-time-functions in approaches to full waveform inversion.
......@@ -95,7 +95,7 @@ $Id$
stfinv::STFBaseEngine.
Most of the framework can simply be copied.
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.
For the implementation there are some \ref tools provided in the library.
......
......@@ -155,12 +155,26 @@ namespace stfinv {
public:
//! \brief abstract base requires virtual destructor
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
virtual void help(std::ostream& os=std::cout) const;
//! \brief return name of engine
virtual const char* name() const;
//@}
/*! \name Shape query functions
*/
//@{
//! \brief return number of samples used in time series
unsigned int nsamples() const
{ return (Mstf.sampling.n); }
......@@ -170,6 +184,11 @@ namespace stfinv {
//! \brief return sampling interval
double dt() const
{ return (Mstf.sampling.dt); }
//@}
/*! \name Data query functions
*/
//@{
//! \brief return source time function series
Tseries stf() const
{ return (Mstf.series); }
......@@ -179,7 +198,12 @@ namespace stfinv {
Tseries::Tcoc synthetic(const unsigned int& i) const ;
//! \brief return synthetic data convolved with stf at receiver \c i
Tseries convolvedsynthetic(const unsigned int& i) const ;
//@}
protected:
/*! \name Functions presented to derived classes
*/
//@{
//! \brief return the value of a parameters
std::string parameter(const std::string& key,
const std::string& defvalue="false") const;
......@@ -187,11 +211,20 @@ namespace stfinv {
bool parameterisset(const std::string& key) const;
//! \brief check for vaid receiver index
void checkreceiverindex(const unsigned int& i) const;
//@}
//! \brief Virtual function to run engine
virtual void exec() { STFINV_baseillegal; }
private:
/*! \name Functions implementing base class operation
*/
//@{
//! \brief parse parameters in Mparameters
void parseparameters(std::string parameters);
//! \brief Check consistency of data members.
void checkconsistency() const;
//@}
// member data
// -----------
......
......@@ -50,10 +50,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineBlindDeconvolution::run()
void STFEngineBlindDeconvolution::exec()
{
STFINV_abort("STFEngineBlindDeconvolution::run not yet implemented");
} // void STFEngineBlindDeconvolution::run()
} // void STFEngineBlindDeconvolution::exec()
/*----------------------------------------------------------------------*/
......
......@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineBlindDeconvolution() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \brief Start engine
virtual void exec();
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help
......
......@@ -49,10 +49,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineFixedWavelet::run()
void STFEngineFixedWavelet::exec()
{
STFINV_abort("STFEngineFixedWavelet::run not yet implemented");
} // void STFEngineFixedWavelet::run()
} // void STFEngineFixedWavelet::exec()
/*----------------------------------------------------------------------*/
......
......@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineFixedWavelet() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \brief Start engine
virtual void exec();
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help
......
......@@ -83,8 +83,8 @@ namespace stfinv {
public:
//! \brief abstract base requires virtual destructor
virtual ~STFFourierDomainEngine() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run() { STFINV_baseillegal; }
//! \brief Start engine
virtual void exec() { STFINV_baseillegal; }
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help
......
......@@ -49,10 +49,10 @@ namespace stfinv {
/*----------------------------------------------------------------------*/
stfinv::Waveform STFEngineIdentity::run()
void STFEngineIdentity::exec()
{
STFINV_abort("STFEngineIdentity::run not yet implemented");
} // void STFEngineIdentity::run()
} // void STFEngineIdentity::exec()
/*----------------------------------------------------------------------*/
......
......@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineIdentity() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \brief Start engine
virtual void exec();
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \brief print online help
......
......@@ -65,8 +65,8 @@ namespace stfinv {
:Tbase(triples, stf, parameters) { }
//! \brief abstract base requires virtual destructor
virtual ~STFEngineNormalize() { }
//! \brief Start engine and return source time function.
virtual stfinv::Waveform run();
//! \brief Start engine
virtual void exec() { STFINV_baseillegal; }
//! \brief print online help
virtual void help(std::ostream& os=std::cout) const;
//! \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