Scorum
libraries
chain
include
scorum
chain
services
comment_vote.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
scorum/chain/services/service_base.hpp
>
4
#include <
scorum/chain/schema/comment_objects.hpp
>
5
6
namespace
scorum
{
7
namespace
chain {
8
9
struct
comment_vote_service_i
:
public
base_service_i
<comment_vote_object>
10
{
11
using
base_service_i<comment_vote_object>::get
;
12
using
base_service_i<comment_vote_object>::is_exists
;
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
21
virtual
comment_vote_refs_type
get_by_comment_weight_voter
(
const
comment_id_type
& comment_id)
const
= 0;
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
:
36
using
base_service_i<comment_vote_object>::get
;
37
using
base_service_i<comment_vote_object>::is_exists
;
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
chainbase::oid
Definition:
betting_resolver.hpp:7
scorum::chain::database
tracks the blockchain state in an extensible manner
Definition:
database.hpp:52
scorum::chain::dbs_comment_vote
Definition:
comment_vote.hpp:29
scorum::chain::dbs_comment_vote::get_by_comment_weight_voter
comment_vote_refs_type get_by_comment_weight_voter(const comment_id_type &comment_id) const override
Definition:
comment_vote.cpp:43
scorum::chain::dbs_comment_vote::get_by_comment
comment_vote_refs_type get_by_comment(const comment_id_type &comment_id) const override
Definition:
comment_vote.cpp:28
scorum::chain::dbs_comment_vote::dbs_comment_vote
dbs_comment_vote(database &db)
Definition:
comment_vote.cpp:13
scorum::chain::dbs_comment_vote::remove_by_comment
void remove_by_comment(const comment_id_type &comment_id) override
Definition:
comment_vote.cpp:62
scorum::chain::dbs_service_base
Definition:
service_base.hpp:42
scorum::chain::dbs_service_base< comment_vote_service_i >::get
virtual const object_type & get() const override
Definition:
service_base.hpp:102
scorum::chain::dbs_service_base< comment_vote_service_i >::is_exists
virtual bool is_exists() const override
Definition:
service_base.hpp:97
scorum::chain::dbservice_dbs_factory
Definition:
dbservice_dbs_factory.hpp:18
comment_objects.hpp
scorum
Definition:
asset.cpp:15
service_base.hpp
scorum::chain::base_service_i
Definition:
service_base.hpp:14
scorum::chain::comment_vote_service_i
Definition:
comment_vote.hpp:10
scorum::chain::comment_vote_service_i::get
virtual const comment_vote_object & get(const comment_id_type &comment_id, const account_id_type &voter_id) const =0
scorum::chain::comment_vote_service_i::is_exists
virtual bool is_exists(const comment_id_type &comment_id, const account_id_type &voter_id) const =0
scorum::chain::comment_vote_service_i::remove_by_comment
virtual void remove_by_comment(const comment_id_type &comment_id)=0
scorum::chain::comment_vote_service_i::get_by_comment_weight_voter
virtual comment_vote_refs_type get_by_comment_weight_voter(const comment_id_type &comment_id) const =0
scorum::chain::comment_vote_service_i::comment_vote_refs_type
std::vector< std::reference_wrapper< const comment_vote_object > > comment_vote_refs_type
Definition:
comment_vote.hpp:17
scorum::chain::comment_vote_service_i::get_by_comment
virtual comment_vote_refs_type get_by_comment(const comment_id_type &comment_id) const =0
Generated on Thu Jun 9 2022 13:04:25 for Scorum by
1.9.1