////////////////////////////////////////////////////////////////////////
/// \class RAT::FitterComponent
///
/// \brief Base class for FitterComponents
///
/// \author Phil G Jones
\n
/// \author Matt Mottram < m.mottram@qmul.ac.uk> -- contact person
///
/// REVISION HISTORY:\n
/// 23/01/2013 : P G Jones - New file \n
///
/// \details Adds the ability to set values in the component from the
/// macro file
///
////////////////////////////////////////////////////////////////////////
#ifndef __RAT_FitterComponent__
#define __RAT_FitterComponent__
#include
#include
namespace RAT
{
namespace DS
{
class Run;
}
class FitterComponent
{
public:
FitterComponent() { };
virtual ~FitterComponent() { };
/// Return the component name
virtual std::string GetName() const = 0;
/// Called at the start of a run, time to initialise from the database
///
/// @param[in] run data structure for the run
virtual void BeginOfRun( DS::Run& run ) = 0;
/// Called at the end of a run, time to cleanup
///
/// @param[in] run data structure for the run
virtual void EndOfRun( DS::Run& run ) = 0;
/// Pass a collection of SetI commands to the component
void SetI( const std::vector< std::pair< std::string, int > >& commands );
/// Pass a collection of SetD commands to the component
void SetD( const std::vector< std::pair< std::string, double > >& commands );
/// Pass a collection of SetS commands to the component
void SetS( const std::vector< std::pair< std::string, std::string > >& commands );
/// A single SetI command
virtual void SetI( const std::string& /*name*/, const int /*value*/ );
/// A single SetD command
virtual void SetD( const std::string& /*name*/, const double /*value*/ );
/// A single SetS command
virtual void SetS( const std::string& /*name*/, const std::string& /*value*/ );
};
} //::RAT
#endif