All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
GeopsyCore::DynamicSignal Class Reference

Brief description of class still missing. More...

#include <DynamicSignal.h>

Inheritance diagram for GeopsyCore::DynamicSignal:
GeopsyCore::Signal GeopsyCore::DoubleSignal QGpCoreTools::SharedObject QGpCoreTools::XMLClass GeopsyCore::SignalTemplate< double > CacheItem

List of all members.

Public Member Functions

virtual int dataSize () const
 DynamicSignal (SignalDB *db)
void set (double t, const int *samples, int nSamples)
void set (double t, const double *samples, int nSamples)
virtual void setNSamples (int n)
void shiftT0 (int nSamples)
 ~DynamicSignal ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

: Signal(db) {_maxNSamples=0; _t0Shift=0;}

References GeopsyCore::SignalTemplate< double >::samples(), GeopsyCore::SignalTemplate< double >::setSamples(), and TRACE.

{
  TRACE;
  // Upon deletion of object, virtual function are not working anymore
  // We remove the shift before removing samples the normal way.
  setSamples(samples()-_t0Shift);
  _t0Shift=0;
}

Member Function Documentation

virtual int GeopsyCore::DynamicSignal::dataSize ( ) const [inline, virtual]

Reimplemented from GeopsyCore::SignalTemplate< double >.

{return _maxNSamples * sizeof(double);}
void GeopsyCore::DynamicSignal::set ( double  t,
const int *  samples,
int  nSamples 
)
void GeopsyCore::DynamicSignal::set ( double  t,
const double *  samples,
int  nSamples 
)
void GeopsyCore::DynamicSignal::setNSamples ( int  n) [virtual]

Reimplemented from GeopsyCore::Signal.

Referenced by shiftT0().

void GeopsyCore::DynamicSignal::shiftT0 ( int  nSamples)

Shift t0 by nSamples. nSamples will be lost and won't be accessible anymore by normal processings. t0() is modified accordingly, nSamples() is reduced by nSamples.

References GeopsyCore::SignalTemplate< double >::_nSamples, GeopsyCore::Signal::_t0, GeopsyCore::DoubleSignal::deltaT(), LOCK_SAMPLES, GeopsyCore::SignalTemplate< double >::nSamples(), setNSamples(), GeopsyCore::SignalTemplate< double >::setSamples(), TRACE, and UNLOCK_SAMPLES.

Referenced by GeopsySLink::SeedLinkStream::set().

{
  TRACE;
  ASSERT(nSamples>=0);
  if(_nSamples<nSamples) {
    if(_nSamples>0) {
      nSamples=_nSamples;
    } else {
      return;
    }
  }
  LOCK_SAMPLES(double, thisSamples, this)
    _t0+=nSamples*deltaT();
    _t0Shift+=nSamples;
    double * newSamples=thisSamples+nSamples;
    setSamples(0); // To avoid ASSERT in SignalTemplate
    setNSamples(_nSamples-nSamples);
    setSamples(newSamples);
  UNLOCK_SAMPLES(this)
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines