34 virtual void remove_all(
const std::vector<object_cref_type>& os) = 0;
53 using service_interface::get;
54 using service_interface::is_exists;
85 virtual void remove_all(
const std::vector<object_cref_type>& os)
override
89 for (
const auto& o : os)
94 FC_CAPTURE_AND_RETHROW()
99 return nullptr !=
db_impl().template find<object_type>();
106 return db_impl().template get<object_type>();
108 FC_CAPTURE_AND_RETHROW()
117 FC_CAPTURE_AND_RETHROW()
126 FC_CAPTURE_AND_RETHROW()
129 template <
class... IndexBy,
typename Call>
void foreach_by(Call&& call)
const
132 .template get_index<typename chainbase::get_index_type<object_type>::type>()
134 .template
get<IndexBy...>();
135 for (
auto it = idx.cbegin(); it != idx.cend(); ++it)
141 template <
class... IndexBy,
class LowerBounder,
class UpperBounder>
142 std::vector<object_cref_type>
get_range_by(LowerBounder lower, UpperBounder upper)
const
146 std::vector<object_cref_type> ret;
149 .template get_index<typename chainbase::get_index_type<object_type>::type>()
151 .template
get<IndexBy...>();
153 auto range = idx.range(lower, upper);
155 std::copy(range.first, range.second, std::back_inserter(ret));
159 FC_CAPTURE_AND_RETHROW()
162 template <
class... IndexBy,
class LowerBounder,
class UpperBounder,
class UnaryPredicate>
163 std::vector<object_cref_type>
168 std::vector<object_cref_type> ret;
171 .template get_index<typename chainbase::get_index_type<object_type>::type>()
173 .template
get<IndexBy...>();
175 auto range = idx.range(lower, upper);
177 std::copy_if(range.first, range.second, std::back_inserter(ret), filter);
181 FC_CAPTURE_AND_RETHROW()
185 #define ALL_IDS std::numeric_limits<int64_t>::max()
dba::db_index & db_impl()
virtual void remove(const object_type &o) override
virtual const object_type & create(const modifier_type &modifier) override
typename service_interface::modifier_type modifier_type
virtual void update(const modifier_type &modifier) override
virtual void remove_all(const std::vector< object_cref_type > &os) override
typename service_interface::object_cref_type object_cref_type
virtual void update(const object_type &o, const modifier_type &modifier) override
virtual const object_type & get() const override
const object_type * find_by(const Key &arg) const
virtual void remove() override
std::vector< object_cref_type > get_filtered_range_by(LowerBounder lower, UpperBounder upper, UnaryPredicate filter) const
dbs_service_base(dba::db_index &db)
virtual bool is_exists() const override
void foreach_by(Call &&call) const
const object_type & get_by(const Key &arg) const
std::vector< object_cref_type > get_range_by(LowerBounder lower, UpperBounder upper) const
typename service_interface::object_type object_type
utils::function_view< void(TObject &)> modifier_type
virtual bool is_exists() const =0
virtual void update(const modifier_type &modifier)=0
std::function< void(object_type &)> modifier_type
virtual void update(const object_type &o, const modifier_type &modifier)=0
virtual const object_type & get() const =0
virtual ~base_service_i()
std::reference_wrapper< const object_type > object_cref_type
virtual const object_type & create(const modifier_type &modifier)=0
virtual void remove_all(const std::vector< object_cref_type > &os)=0
std::function< void(const object_type &)> call_type
virtual void remove(const object_type &o)=0