Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Types | Public Member Functions | Public Attributes | List of all members
golos::tags::detail::operation_visitor Struct Reference

Public Types

typedef void result_type
 

Public Member Functions

 operation_visitor (database &db)
 
void remove_stats (const tag_object &tag, const tag_stats_object &stats) const
 
void add_stats (const tag_object &tag, const tag_stats_object &stats) const
 
void remove_tag (const tag_object &tag) const
 
const tag_stats_objectget_stats (const string &tag) const
 
comment_metadata filter_tags (const comment_object &c) const
 
void update_tag (const tag_object &current, const comment_object &comment, double hot, double trending) const
 
void create_tag (const string &tag, const comment_object &comment, double hot, double trending) const
 
template<int64_t S, int32_t T>
double calculate_score (const share_type &score, const time_point_sec &created) const
 
double calculate_hot (const share_type &score, const time_point_sec &created) const
 
double calculate_trending (const share_type &score, const time_point_sec &created) const
 
void update_tags (const comment_object &c, bool parse_tags=false) const
 
const peer_stats_objectget_or_create_peer_stats (account_object::id_type voter, account_object::id_type peer) const
 
void update_indirect_vote (account_object::id_type a, account_object::id_type b, int positive) const
 
void update_peer_stats (const account_object &voter, const account_object &author, const comment_object &c, int vote) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const comment_operation< Major, Hardfork, Release > &op) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const transfer_operation< Major, Hardfork, Release > &op) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const vote_operation< Major, Hardfork, Release > &op) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const delete_comment_operation< Major, Hardfork, Release > &op) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const comment_reward_operation< Major, Hardfork, Release > &op) const
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void operator() (const comment_payout_update_operation< Major, Hardfork, Release > &op) const
 
template<typename Op >
void operator() (Op &&) const
 

Public Attributes

database_db
 

Detailed Description

Definition at line 51 of file tags_plugin.cpp.

Member Typedef Documentation

◆ result_type

Definition at line 53 of file tags_plugin.cpp.

Constructor & Destructor Documentation

◆ operation_visitor()

golos::tags::detail::operation_visitor::operation_visitor ( database db)
inline

Definition at line 52 of file tags_plugin.cpp.

Member Function Documentation

◆ add_stats()

void golos::tags::detail::operation_visitor::add_stats ( const tag_object tag,
const tag_stats_object stats 
) const
inline

Definition at line 70 of file tags_plugin.cpp.

◆ calculate_hot()

double golos::tags::detail::operation_visitor::calculate_hot ( const share_type &  score,
const time_point_sec &  created 
) const
inline

Definition at line 236 of file tags_plugin.cpp.

◆ calculate_score()

template<int64_t S, int32_t T>
double golos::tags::detail::operation_visitor::calculate_score ( const share_type &  score,
const time_point_sec &  created 
) const
inline

◆ calculate_trending()

double golos::tags::detail::operation_visitor::calculate_trending ( const share_type &  score,
const time_point_sec &  created 
) const
inline

Definition at line 240 of file tags_plugin.cpp.

◆ create_tag()

void golos::tags::detail::operation_visitor::create_tag ( const string &  tag,
const comment_object comment,
double  hot,
double  trending 
) const
inline

Definition at line 172 of file tags_plugin.cpp.

◆ filter_tags()

comment_metadata golos::tags::detail::operation_visitor::filter_tags ( const comment_object c) const
inline

the universal tag applies to everything safe for work or nsfw with a non-negative payout

add it to the universal tag

Definition at line 107 of file tags_plugin.cpp.

◆ get_or_create_peer_stats()

const peer_stats_object& golos::tags::detail::operation_visitor::get_or_create_peer_stats ( account_object::id_type  voter,
account_object::id_type  peer 
) const
inline

Definition at line 295 of file tags_plugin.cpp.

◆ get_stats()

const tag_stats_object& golos::tags::detail::operation_visitor::get_stats ( const string &  tag) const
inline

Definition at line 95 of file tags_plugin.cpp.

◆ operator()() [1/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const comment_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 352 of file tags_plugin.cpp.

◆ operator()() [2/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const transfer_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 357 of file tags_plugin.cpp.

◆ operator()() [3/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const vote_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 387 of file tags_plugin.cpp.

◆ operator()() [4/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const delete_comment_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 398 of file tags_plugin.cpp.

◆ operator()() [5/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const comment_reward_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 414 of file tags_plugin.cpp.

◆ operator()() [6/7]

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::tags::detail::operation_visitor::operator() ( const comment_payout_update_operation< Major, Hardfork, Release > &  op) const
inline

Definition at line 428 of file tags_plugin.cpp.

◆ operator()() [7/7]

template<typename Op >
void golos::tags::detail::operation_visitor::operator() ( Op &&  ) const
inline

Definition at line 434 of file tags_plugin.cpp.

◆ remove_stats()

void golos::tags::detail::operation_visitor::remove_stats ( const tag_object tag,
const tag_stats_object stats 
) const
inline

Definition at line 58 of file tags_plugin.cpp.

◆ remove_tag()

void golos::tags::detail::operation_visitor::remove_tag ( const tag_object tag) const
inline

TODO: update tag stats object

Definition at line 82 of file tags_plugin.cpp.

◆ update_indirect_vote()

void golos::tags::detail::operation_visitor::update_indirect_vote ( account_object::id_type  a,
account_object::id_type  b,
int  positive 
) const
inline

Definition at line 308 of file tags_plugin.cpp.

◆ update_peer_stats()

void golos::tags::detail::operation_visitor::update_peer_stats ( const account_object voter,
const account_object author,
const comment_object c,
int  vote 
) const
inline

ignore votes for yourself

only count top level posts

Definition at line 326 of file tags_plugin.cpp.

◆ update_tag()

void golos::tags::detail::operation_visitor::update_tag ( const tag_object current,
const comment_object comment,
double  hot,
double  trending 
) const
inline

Definition at line 147 of file tags_plugin.cpp.

◆ update_tags()

void golos::tags::detail::operation_visitor::update_tags ( const comment_object c,
bool  parse_tags = false 
) const
inline

finds tags that have been added or removed or updated

Definition at line 246 of file tags_plugin.cpp.

Member Data Documentation

◆ _db

database& golos::tags::detail::operation_visitor::_db

Definition at line 56 of file tags_plugin.cpp.


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