Scorum
account_registration_bonus.cpp
Go to the documentation of this file.
2 
3 #include <boost/lambda/lambda.hpp>
4 #include <boost/multi_index/detail/unbounded.hpp>
5 
6 #include <tuple>
7 
8 namespace scorum {
9 namespace chain {
10 
12  : base_service_type(db)
13 {
14 }
15 
17 {
18  const account_registration_bonus_object* pobj = find_by<by_account>(name);
19  if (pobj)
20  {
21  remove(*pobj);
22  }
23 }
24 
26 dbs_account_registration_bonus::get_by_expiration_time(const fc::time_point_sec& until) const
27 {
28  try
29  {
30  return get_range_by<by_expiration>(::boost::multi_index::unbounded,
31  ::boost::lambda::_1 <= std::make_tuple(until, ALL_IDS));
32  }
33  FC_CAPTURE_AND_RETHROW((until))
34 }
35 }
36 }
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
void remove_if_exist(const account_name_type &) override
account_registration_bonus_refs_type get_by_expiration_time(const fc::time_point_sec &until) const override
const unbounded_placeholder unbounded
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
Definition: asset.cpp:15
#define ALL_IDS
std::vector< typename base_service_i::object_cref_type > account_registration_bonus_refs_type