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

Public Types

typedef void result_type
 

Public Member Functions

 operation_visitor (languages_plugin_impl &self)
 
void remove_stats (const language_object &tag, const language_stats_object &stats) const
 
void add_stats (const language_object &tag, const language_stats_object &stats) const
 
void remove_tag (const language_object &tag) const
 
const language_stats_objectget_stats (const string &tag) const
 
void update_tag (const language_object &current, const comment_object &comment, double hot, double trending) const
 
void create_tag (const string &language, const comment_object &comment, double hot, double trending) const
 
std::string filter_tags (const comment_object &c) 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) 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
 
template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
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 T >
void operator() (const T &o) const
 

Public Attributes

languages_plugin_impllanguages_plugin
 
golos::chain::database_db
 

Detailed Description

Definition at line 89 of file languages_plugin.cpp.

Member Typedef Documentation

◆ result_type

Definition at line 92 of file languages_plugin.cpp.

Constructor & Destructor Documentation

◆ operation_visitor()

golos::languages::detail::operation_visitor::operation_visitor ( languages_plugin_impl self)
inline

Definition at line 90 of file languages_plugin.cpp.

Member Function Documentation

◆ add_stats()

void golos::languages::detail::operation_visitor::add_stats ( const language_object tag,
const language_stats_object stats 
) const
inline

Definition at line 110 of file languages_plugin.cpp.

◆ calculate_hot()

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

Definition at line 240 of file languages_plugin.cpp.

◆ calculate_score()

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

◆ calculate_trending()

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

Definition at line 244 of file languages_plugin.cpp.

◆ create_tag()

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

Definition at line 172 of file languages_plugin.cpp.

◆ filter_tags()

std::string golos::languages::detail::operation_visitor::filter_tags ( const comment_object c) const
inline

Definition at line 216 of file languages_plugin.cpp.

◆ get_or_create_peer_stats()

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

Definition at line 272 of file languages_plugin.cpp.

◆ get_stats()

const language_stats_object& golos::languages::detail::operation_visitor::get_stats ( const string &  tag) const
inline

Definition at line 135 of file languages_plugin.cpp.

◆ operator()() [1/7]

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

Definition at line 330 of file languages_plugin.cpp.

◆ operator()() [2/7]

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

Definition at line 335 of file languages_plugin.cpp.

◆ operator()() [3/7]

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

Definition at line 365 of file languages_plugin.cpp.

◆ operator()() [4/7]

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

Definition at line 376 of file languages_plugin.cpp.

◆ operator()() [5/7]

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

Definition at line 394 of file languages_plugin.cpp.

◆ operator()() [6/7]

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

Definition at line 400 of file languages_plugin.cpp.

◆ operator()() [7/7]

template<typename T >
void golos::languages::detail::operation_visitor::operator() ( const T &  o) const
inline

Definition at line 406 of file languages_plugin.cpp.

◆ remove_stats()

void golos::languages::detail::operation_visitor::remove_stats ( const language_object tag,
const language_stats_object stats 
) const
inline

Definition at line 98 of file languages_plugin.cpp.

◆ remove_tag()

void golos::languages::detail::operation_visitor::remove_tag ( const language_object tag) const
inline

TODO: update tag stats object

Definition at line 122 of file languages_plugin.cpp.

◆ update_indirect_vote()

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

Definition at line 285 of file languages_plugin.cpp.

◆ update_peer_stats()

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::languages::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 304 of file languages_plugin.cpp.

◆ update_tag()

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

Definition at line 147 of file languages_plugin.cpp.

◆ update_tags()

void golos::languages::detail::operation_visitor::update_tags ( const comment_object c) const
inline

finds tags that have been added or updated

Definition at line 249 of file languages_plugin.cpp.

Member Data Documentation

◆ _db

golos::chain::database& golos::languages::detail::operation_visitor::_db

Definition at line 96 of file languages_plugin.cpp.

◆ languages_plugin

languages_plugin_impl& golos::languages::detail::operation_visitor::languages_plugin

Definition at line 95 of file languages_plugin.cpp.


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