Scorum
comment_vote.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace scorum {
7 namespace chain {
8 
9 struct comment_vote_service_i : public base_service_i<comment_vote_object>
10 {
13 
14  virtual const comment_vote_object& get(const comment_id_type& comment_id,
15  const account_id_type& voter_id) const = 0;
16 
17  using comment_vote_refs_type = std::vector<std::reference_wrapper<const comment_vote_object>>;
18 
19  virtual comment_vote_refs_type get_by_comment(const comment_id_type& comment_id) const = 0;
20 
22 
23  virtual bool is_exists(const comment_id_type& comment_id, const account_id_type& voter_id) const = 0;
24 
25  virtual void remove_by_comment(const comment_id_type& comment_id) = 0;
26 };
27 
28 class dbs_comment_vote : public dbs_service_base<comment_vote_service_i>
29 {
30  friend class dbservice_dbs_factory;
31 
32 protected:
33  explicit dbs_comment_vote(database& db);
34 
35 public:
38 
39  const comment_vote_object& get(const comment_id_type& comment_id, const account_id_type& voter_id) const override;
40 
41  comment_vote_refs_type get_by_comment(const comment_id_type& comment_id) const override;
42 
43  comment_vote_refs_type get_by_comment_weight_voter(const comment_id_type& comment_id) const override;
44 
45  bool is_exists(const comment_id_type& comment_id, const account_id_type& voter_id) const override;
46 
47  void remove_by_comment(const comment_id_type& comment_id) override;
48 };
49 } // namespace chain
50 } // namespace scorum
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
comment_vote_refs_type get_by_comment_weight_voter(const comment_id_type &comment_id) const override
comment_vote_refs_type get_by_comment(const comment_id_type &comment_id) const override
void remove_by_comment(const comment_id_type &comment_id) override
virtual const object_type & get() const override
Definition: asset.cpp:15
virtual const comment_vote_object & get(const comment_id_type &comment_id, const account_id_type &voter_id) const =0
virtual bool is_exists(const comment_id_type &comment_id, const account_id_type &voter_id) const =0
virtual void remove_by_comment(const comment_id_type &comment_id)=0
virtual comment_vote_refs_type get_by_comment_weight_voter(const comment_id_type &comment_id) const =0
std::vector< std::reference_wrapper< const comment_vote_object > > comment_vote_refs_type
virtual comment_vote_refs_type get_by_comment(const comment_id_type &comment_id) const =0