jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Public Member Functions | Private Attributes | Friends | List of all members
jubatus::core::storage::version Class Reference

#include <version.hpp>

Collaboration diagram for jubatus::core::storage::version:
Collaboration graph

Public Member Functions

uint64_t get_number () const
 
void increment ()
 
 MSGPACK_DEFINE (version_number_)
 
template<class Packer >
void pack (Packer &packer) const
 
void reset ()
 
void set_number_unsafe (uint64_t n)
 
void unpack (msgpack::object o)
 
 version ()
 

Private Attributes

uint64_t version_number_
 

Friends

bool operator!= (const version &lhs, const version &rhs)
 
bool operator< (const version &lhs, const version &rhs)
 
std::ostream & operator<< (std::ostream &os, const version &v)
 
bool operator<= (const version &lhs, const version &rhs)
 
bool operator== (const version &lhs, const version &rhs)
 
bool operator> (const version &lhs, const version &rhs)
 
bool operator>= (const version &lhs, const version &rhs)
 

Detailed Description

Definition at line 28 of file version.hpp.

Constructor & Destructor Documentation

jubatus::core::storage::version::version ( )
inline

Definition at line 30 of file version.hpp.

30 : version_number_(0LLU) {}

Member Function Documentation

uint64_t jubatus::core::storage::version::get_number ( ) const
inline

Definition at line 36 of file version.hpp.

References version_number_.

36  {
37  return version_number_;
38  }
void jubatus::core::storage::version::increment ( )
inline

Definition at line 32 of file version.hpp.

References version_number_.

Referenced by jubatus::core::fv_converter::weight_manager::put_diff(), and jubatus::core::storage::local_storage_mixture::set_average_and_clear_diff().

32  {
34  }

Here is the caller graph for this function:

jubatus::core::storage::version::MSGPACK_DEFINE ( version_number_  )
template<class Packer >
void jubatus::core::storage::version::pack ( Packer &  packer) const
inline

Definition at line 73 of file version.hpp.

73  {
74  packer.pack(*this);
75  }
msgpack::packer< jubatus_packer > packer
Definition: bandit_base.hpp:31
void jubatus::core::storage::version::reset ( )
inline

Definition at line 68 of file version.hpp.

References version_number_.

68  {
69  version_number_ = 0;
70  }
void jubatus::core::storage::version::set_number_unsafe ( uint64_t  n)
inline

Definition at line 44 of file version.hpp.

References version_number_.

44  {
45  // used for test only
46  version_number_ = n;
47  }
void jubatus::core::storage::version::unpack ( msgpack::object  o)
inline

Definition at line 77 of file version.hpp.

77  {
78  o.convert(this);
79  }

Friends And Related Function Documentation

bool operator!= ( const version lhs,
const version rhs 
)
friend

Definition at line 52 of file version.hpp.

52  {
53  return !(lhs == rhs);
54  }
bool operator< ( const version lhs,
const version rhs 
)
friend

Definition at line 55 of file version.hpp.

55  {
56  return lhs.version_number_ < rhs.version_number_;
57  }
std::ostream& operator<< ( std::ostream &  os,
const version v 
)
friend

Definition at line 24 of file version.cpp.

24  {
25  os << v.version_number_;
26  // cardinal number output
27  if ((v.version_number_ % 10) == 1
28  && ((v.version_number_ % 100) != 11)) {
29  os << "st";
30  } else if ((v.version_number_ % 10) == 2
31  && ((v.version_number_ % 100) != 12)) {
32  os << "nd";
33  } else if ((v.version_number_ % 10) == 3
34  && ((v.version_number_ % 100) != 13)) {
35  os << "rd";
36  } else {
37  os << "th";
38  }
39  return os;
40 }
std::vector< T > v(size)
bool operator<= ( const version lhs,
const version rhs 
)
friend

Definition at line 64 of file version.hpp.

64  {
65  return !(lhs > rhs);
66  }
bool operator== ( const version lhs,
const version rhs 
)
friend

Definition at line 49 of file version.hpp.

49  {
50  return lhs.version_number_ == rhs.version_number_;
51  }
bool operator> ( const version lhs,
const version rhs 
)
friend

Definition at line 58 of file version.hpp.

58  {
59  return rhs < lhs;
60  }
bool operator>= ( const version lhs,
const version rhs 
)
friend

Definition at line 61 of file version.hpp.

61  {
62  return !(lhs < rhs);
63  }

Member Data Documentation

uint64_t jubatus::core::storage::version::version_number_
private

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