SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
JobResultAggregator.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Soumyajit De
8  */
9 
10 #ifndef JOB_RESULT_AGGREGATOR_H_
11 #define JOB_RESULT_AGGREGATOR_H_
12 
13 #include <shogun/lib/config.h>
14 #include <shogun/base/SGObject.h>
16 #include <shogun/base/Parameter.h>
17 
18 namespace shogun
19 {
20 
26 {
27 public:
30  : CSGObject()
31  {
32  init();
33 
34  SG_GCDEBUG("%s created (%p)\n", this->get_name(), this)
35  }
36 
39  {
41 
42  SG_GCDEBUG("%s destroyed (%p)\n", this->get_name(), this)
43  }
44 
51  virtual void submit_result(CJobResult* result) = 0;
52 
57  virtual void finalize() = 0;
58 
61  {
62  return m_result;
63  }
64 
66  virtual const char* get_name() const
67  {
68  return "JobResultAggregator";
69  }
70 protected:
73 
74 private:
76  void init()
77  {
78  m_result=NULL;
79 
80  SG_ADD((CSGObject**)&m_result, "final_result",
81  "Aggregation of computation job results", MS_NOT_AVAILABLE);
82  }
83 };
84 
85 }
86 
87 #endif // JOB_RESULT_AGGREGATOR_H_
virtual const char * get_name() const
Base class that stores the result of an independent job.
Definition: JobResult.h:21
virtual void submit_result(CJobResult *result)=0
CJobResult * get_final_result() const
#define SG_GCDEBUG(...)
Definition: SGIO.h:102
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:115
Abstract base class that provides an interface for computing an aggeregation of the job results of in...
#define SG_UNREF(x)
Definition: SGObject.h:55
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
#define SG_ADD(...)
Definition: SGObject.h:84

SHOGUN Machine Learning Toolbox - Documentation