SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
IndependentJob.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 2013 Soumyajit De
00008  */
00009 
00010 #ifndef INDEPENDENT_JOB_H_
00011 #define INDEPENDENT_JOB_H_
00012 
00013 #include <shogun/lib/config.h>
00014 #include <shogun/base/SGObject.h>
00015 #include <shogun/base/Parameter.h>
00016 #include <shogun/lib/computation/aggregator/JobResultAggregator.h>
00017 
00018 namespace shogun
00019 {
00020 
00026 class CIndependentJob : public CSGObject
00027 {
00028 public:
00030     CIndependentJob()
00031     : CSGObject()
00032     {
00033         init();
00034     }
00035 
00041     CIndependentJob(CJobResultAggregator* aggregator)
00042     : CSGObject(), m_aggregator(aggregator)
00043     {
00044         init();
00045 
00046         m_aggregator=aggregator;
00047         SG_REF(m_aggregator);
00048     }
00049 
00051     virtual ~CIndependentJob()
00052     {
00053         SG_UNREF(m_aggregator);
00054     }
00055 
00060     virtual void compute() = 0;
00061 
00063     virtual const char* get_name() const
00064     {
00065         return "IndependentJob";
00066     }
00067 protected:
00069     CJobResultAggregator* m_aggregator;
00070 
00071 private:
00073     void init()
00074     {
00075         m_aggregator=NULL;
00076 
00077         SG_ADD((CSGObject**)&m_aggregator, "job_result_aggregator",
00078             "Job result aggregator for current job", MS_NOT_AVAILABLE);
00079     }
00080 };
00081 
00082 }
00083 
00084 #endif // INDEPENDENT_JOB_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation