SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
lib
computation
aggregator
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
>
15
#include <
shogun/lib/computation/jobresult/JobResult.h
>
16
#include <
shogun/base/Parameter.h
>
17
18
namespace
shogun
19
{
20
25
class
CJobResultAggregator
:
public
CSGObject
26
{
27
public
:
29
CJobResultAggregator
()
30
:
CSGObject
()
31
{
32
init();
33
34
SG_GCDEBUG
(
"%s created (%p)\n"
, this->
get_name
(),
this
)
35
}
36
38
virtual
~CJobResultAggregator
()
39
{
40
SG_UNREF
(
m_result
);
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
60
CJobResult
*
get_final_result
()
const
61
{
62
return
m_result
;
63
}
64
66
virtual
const
char
*
get_name
()
const
67
{
68
return
"JobResultAggregator"
;
69
}
70
protected
:
72
CJobResult
*
m_result
;
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_
SHOGUN
Machine Learning Toolbox - Documentation