Cambridge SMT System
ucam::util::TaskInterface< Data > Class Template Referenceabstract

Templated (hybrid) Interface for Task classes. More...

#include <taskinterface.hpp>

Inheritance diagram for ucam::util::TaskInterface< Data >:

Public Member Functions

 TaskInterface ()
 Constructor. More...
 
virtual bool run (Data &d)=0
 
virtual ~TaskInterface ()
 
bool chainrun (Data &d)
 Implements chain of responsability. Calls run method and, if there is another task, call its run method too. More...
 
bool operator() (Data &d)
 
TaskInterfaceappendTask (TaskInterface *t)
 Appends a task class. If there is no task, append here, otherwise delegate in next task. More...
 
TaskInterfaceoperator() (TaskInterface *t)
 
TaskInterfacegetTask ()
 Return appended task. More...
 
TaskInterfacenext ()
 

Detailed Description

template<class Data>
class ucam::util::TaskInterface< Data >

Templated (hybrid) Interface for Task classes.

Remarks
All task classes should inherit from TaskInterface and implement its virtual methods. This interface is templated over the data, which is expected to be an arbitrary struct with several public variables handled by this or other task classes. TaskInterface allows to cascade tasks working over the same data instance, would easily also allow a mechanism similar to chain of responsibility.

Definition at line 37 of file taskinterface.hpp.

Constructor & Destructor Documentation

template<class Data>
ucam::util::TaskInterface< Data >::TaskInterface ( )
inline

Constructor.

Definition at line 44 of file taskinterface.hpp.

template<class Data>
virtual ucam::util::TaskInterface< Data >::~TaskInterface ( )
inlinevirtual

Definition at line 47 of file taskinterface.hpp.

Member Function Documentation

template<class Data>
TaskInterface& ucam::util::TaskInterface< Data >::appendTask ( TaskInterface< Data > *  t)
inline

Appends a task class. If there is no task, append here, otherwise delegate in next task.

Parameters
tTask to append.

Definition at line 78 of file taskinterface.hpp.

Here is the caller graph for this function:

template<class Data>
bool ucam::util::TaskInterface< Data >::chainrun ( Data &  d)
inline

Implements chain of responsability. Calls run method and, if there is another task, call its run method too.

Parameters
dPass through
Returns
bool: true if the chain has been interrupted, false if normal execution.

Definition at line 58 of file taskinterface.hpp.

Here is the caller graph for this function:

template<class Data>
TaskInterface* ucam::util::TaskInterface< Data >::getTask ( )
inline

Return appended task.

Returns
Pointer to Task class stored in next_.

Definition at line 97 of file taskinterface.hpp.

template<class Data>
TaskInterface* ucam::util::TaskInterface< Data >::next ( void  )
inline

Definition at line 100 of file taskinterface.hpp.

template<class Data>
bool ucam::util::TaskInterface< Data >::operator() ( Data &  d)
inline

Definition at line 65 of file taskinterface.hpp.

template<class Data>
TaskInterface& ucam::util::TaskInterface< Data >::operator() ( TaskInterface< Data > *  t)
inline

Definition at line 85 of file taskinterface.hpp.

template<class Data>
virtual bool ucam::util::TaskInterface< Data >::run ( Data &  d)
pure virtual

Implemented in ucam::fsttools::MultiThreadedApplyLanguageModelTask< DataT, ArcT >, ucam::hifst::MultiThreadedHifstTask< DataT, ArcT >, ucam::hifst::LoadSparseWeightsTask< DataT >, ucam::hifst::ReferenceFilterTask< Data, Arc >, ucam::fsttools::LoadLanguageModelTask< Data >, ucam::hifst::HiFSTTask< Data, Arc, OptimizeT, CYKdataT, MultiUnionT, ExpandedNumStatesRTNT, ReplaceFstByArcT, RTNT >, ucam::fsttools::ApplyBiLMTask< Data, Arc >, googletesting::PostEditTask< Data >, ucam::fsttools::SingleThreadedApplyLanguageModelTask< DataT, ArcT >, googletesting::Task4< Data >, ucam::hifst::MultiThreadedCreateSentenceSpecificGrammarTask< Data >, ucam::lmbr::MultiThreadedLmbrTask< Data >, ucam::lmbr::LmbrTask< Data >, ucam::hifst::GrammarTask< Data >, ucam::hifst::GrammarTask< uh::HifstTaskData<> >, ucam::fsttools::DisambigTask< Data, Arc >, ucam::hifst::DumpNbestFeaturesTask< Data, Arc >, ucam::fsttools::ApplyLanguageModelTask< Data, Arc >, ucam::hifst::SingleThreadedHifstTask< DataT, ArcT >, googletesting::Task2b< Data >, ucam::fsttools::LoadUnimapTask< Data, Arc >, ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >, ucam::hifst::PostProTask< Data, Arc >, ucam::hifst::SparseWeightVectorLatticesTask< Data, Arc >, ucam::fsttools::TuneWpWriteFstTask< Data, Arc >, ucam::hifst::PreProTask< Data >, ucam::fsttools::OptimizeFstTask< Data, Arc >, ucam::hifst::CYKParserTask< Data >, ucam::hifst::CYKParserTask< uh::HifstTaskData<> >, ucam::fsttools::WriteFstTask< Data, Arc >, ucam::hifst::SentenceSpecificGrammarTask< Data >, ucam::hifst::SentenceSpecificGrammarTask< uh::HifstTaskData<> >, ucam::fsttools::ReadFstTask< Data, Arc >, ucam::hifst::SingleThreadedCreateSentenceSpecificGrammarTask< Data >, googletesting::Task3< Data >, ucam::hifst::PatternsToInstancesTask< Data >, ucam::hifst::HifstStatsTask< Data >, ucam::fsttools::LoadWordMapTask< Data >, googletesting::Task2< Data >, ucam::lmbr::SingleThreadedLmbrTask< Data >, ucam::fsttools::SpeedStatsTask< Data >, and googletesting::Task1< Data >.

Here is the caller graph for this function:


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