STK++ 0.9.13
STK::IRunnerWithData< Array > Class Template Reference

Abstract class for all running class based on a data set. More...

#include <STK_IRunner.h>

Inheritance diagram for STK::IRunnerWithData< Array >:
Inheritance graph

Public Member Functions

Array constp_data () const
 get the data set
 
virtual void setData (Array const *p_data)
 Set the data set.
 
virtual void setData (Array const &data)
 Set the data set.
 
- Public Member Functions inherited from STK::IRunnerBase
String consterror () const
 get the last error message.
 
virtual bool run ()=0
 run the computations.
 

Protected Member Functions

 IRunnerWithData ()
 default constructor.
 
 IRunnerWithData (Array const *const p_data)
 constructor with a pointer on the constant data set
 
 IRunnerWithData (Array const &data)
 constructor with a constant reference on the data set
 
 IRunnerWithData (IRunnerWithData const &runner)
 copy constructor
 
 ~IRunnerWithData ()
 destructor
 
- Protected Member Functions inherited from STK::IRunnerBase
 IRunnerBase ()
 default constructor
 
 IRunnerBase (IRunnerBase const &runner)
 copy constructor
 
virtual ~IRunnerBase ()
 destructor
 
virtual void update ()
 update the runner.
 

Protected Attributes

Array constp_data_
 A pointer on the original data set.
 
- Protected Attributes inherited from STK::IRunnerBase
String msg_error_
 String with the last error message.
 
bool hasRun_
 true if run has been used, false otherwise
 

Detailed Description

template<class Array>
class STK::IRunnerWithData< Array >

Abstract class for all running class based on a data set.

This Interface is an extension of the IrunnerBase class for runners using a data set. The data set to use is not copied and a pointer on the data set to used is stored internally.

The pure virtual method to implement is inherited from IRunnerBase

bool run();
virtual bool run()=0
run the computations.

and the virtual method that can be overloaded are

void setData( Array const* p_data);
void update();
virtual void update()
update the runner.
Definition STK_IRunner.h:94
Array const * p_data() const
get the data set
virtual void setData(Array const *p_data)
Set the data set.

The update() method is called when a new data set is set using the default implementation of setData.

Definition at line 121 of file STK_IRunner.h.

Constructor & Destructor Documentation

◆ IRunnerWithData() [1/4]

template<class Array >
STK::IRunnerWithData< Array >::IRunnerWithData ( )
inlineprotected

default constructor.

Definition at line 125 of file STK_IRunner.h.

125: p_data_(0) {}
Array const * p_data_
A pointer on the original data set.

◆ IRunnerWithData() [2/4]

template<class Array >
STK::IRunnerWithData< Array >::IRunnerWithData ( Array const *const  p_data)
inlineprotected

constructor with a pointer on the constant data set

Parameters
p_datapointer on the data set to run

Definition at line 129 of file STK_IRunner.h.

129: p_data_(p_data) {}

◆ IRunnerWithData() [3/4]

template<class Array >
STK::IRunnerWithData< Array >::IRunnerWithData ( Array const data)
inlineprotected

constructor with a constant reference on the data set

Parameters
datadata set to run

Definition at line 133 of file STK_IRunner.h.

133: p_data_(&data) {}

◆ IRunnerWithData() [4/4]

template<class Array >
STK::IRunnerWithData< Array >::IRunnerWithData ( IRunnerWithData< Array > const runner)
inlineprotected

copy constructor

Parameters
runnerthe runner to copy

Definition at line 137 of file STK_IRunner.h.

138 : IRunnerBase(runner)
139 , p_data_(runner.p_data_)
140 {}
IRunnerBase()
default constructor
Definition STK_IRunner.h:68

◆ ~IRunnerWithData()

template<class Array >
STK::IRunnerWithData< Array >::~IRunnerWithData ( )
inlineprotected

destructor

Definition at line 142 of file STK_IRunner.h.

142{}

Member Function Documentation

◆ p_data()

template<class Array >
Array const * STK::IRunnerWithData< Array >::p_data ( ) const
inline

get the data set

Returns
a constant reference on the data set.

Definition at line 148 of file STK_IRunner.h.

148{ return p_data_;}

References STK::IRunnerWithData< Array >::p_data_.

Referenced by STK::IRunnerWithData< Array >::setData().

◆ setData() [1/2]

template<class Array >
virtual void STK::IRunnerWithData< Array >::setData ( Array const data)
inlinevirtual

Set the data set.

If the state of the derived runner change when a new data set is set the user have to overload the udpate() method.

Parameters
dataThe data set to run

Definition at line 163 of file STK_IRunner.h.

164 {
165 p_data_ = &data;
166 update();
167 this->hasRun_ = false;
168 }
bool hasRun_
true if run has been used, false otherwise
Definition STK_IRunner.h:98

References STK::IRunnerBase::hasRun_, STK::IRunnerWithData< Array >::p_data_, and STK::IRunnerBase::update().

◆ setData() [2/2]

template<class Array >
virtual void STK::IRunnerWithData< Array >::setData ( Array const p_data)
inlinevirtual

Set the data set.

If the state of the derived runner change when a new data set is set the user have to overload the udpate() method.

Parameters
p_dataA pointer on the data set to run

Definition at line 153 of file STK_IRunner.h.

154 {
155 p_data_ = p_data;
156 update();
157 this->hasRun_ = false;
158 }

References STK::IRunnerBase::hasRun_, STK::IRunnerWithData< Array >::p_data(), STK::IRunnerWithData< Array >::p_data_, and STK::IRunnerBase::update().

Member Data Documentation

◆ p_data_

template<class Array >
Array const* STK::IRunnerWithData< Array >::p_data_
protected

A pointer on the original data set.

Definition at line 172 of file STK_IRunner.h.

Referenced by STK::IRunnerWithData< Array >::p_data(), STK::IRunnerWithData< Array >::setData(), and STK::IRunnerWithData< Array >::setData().


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