jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
result_storage.hpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2014 Preferred Networks and Nippon Telegraph and Telephone Corporation.
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License version 2.1 as published by the Free Software Foundation.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 #ifndef JUBATUS_CORE_BURST_RESULT_STORAGE_HPP_
18 #define JUBATUS_CORE_BURST_RESULT_STORAGE_HPP_
19 
20 #include <vector>
21 #include <msgpack.hpp>
22 #include "jubatus/util/lang/scoped_ptr.h"
23 
24 #include "burst_result.hpp"
25 #include "../framework/mixable_helper.hpp"
26 
27 namespace jubatus {
28 namespace core {
29 namespace burst {
30 
32  public:
34 
35  explicit result_storage(int stored_results_max);
37 
38  void store(const result_t& result);
39 
40  result_t get_latest_result() const;
41  result_t get_result_at(double pos) const;
42 
43  typedef std::vector<result_t> diff_t;
44  diff_t get_diff() const;
45  void put_diff(const diff_t& diff);
46 
47  void pack(framework::packer& packer) const;
48  void unpack(msgpack::object o);
49 
50  private:
51  class impl_;
52  jubatus::util::lang::scoped_ptr<impl_> p_;
53 };
54 
55 } // namespace burst
56 } // namespace core
57 } // namespace jubatus
58 
59 #endif // JUBATUS_CORE_BURST_RESULT_STORAGE_HPP_
result_t get_result_at(double pos) const
jubatus::util::lang::scoped_ptr< impl_ > p_
void store(const result_t &result)
result_storage(int stored_results_max)
msgpack::packer< jubatus_packer > packer
Definition: bandit_base.hpp:31
void pack(framework::packer &packer) const