![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <governance-votedb.h>
Public Types | |
typedef std::list< CGovernanceVote > | vote_l_t |
typedef vote_l_t::iterator | vote_l_it |
typedef vote_l_t::const_iterator | vote_l_cit |
typedef std::map< uint256, vote_l_it > | vote_m_t |
typedef vote_m_t::iterator | vote_m_it |
typedef vote_m_t::const_iterator | vote_m_cit |
Public Member Functions | |
CGovernanceObjectVoteFile () | |
CGovernanceObjectVoteFile (const CGovernanceObjectVoteFile &other) | |
void | AddVote (const CGovernanceVote &vote) |
bool | HasVote (const uint256 &nHash) const |
bool | GetVote (const uint256 &nHash, CGovernanceVote &vote) const |
int | GetVoteCount () |
std::vector< CGovernanceVote > | GetVotes () const |
CGovernanceObjectVoteFile & | operator= (const CGovernanceObjectVoteFile &other) |
void | RemoveVotesFromMasternode (const COutPoint &outpointMasternode) |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
Private Member Functions | |
void | RebuildIndex () |
Private Attributes | |
int | nMemoryVotes |
vote_l_t | listVotes |
vote_m_t | mapVoteIndex |
Static Private Attributes | |
static const int | MAX_MEMORY_VOTES = -1 |
Represents the collection of votes associated with a given CGovernanceObject Recently received votes are held in memory until a maximum size is reached after which older votes a flushed to a disk file.
Note: This is a stub implementation that doesn't limit the number of votes held in memory and doesn't flush to disk.
Definition at line 23 of file governance-votedb.h.
typedef vote_l_t::const_iterator CGovernanceObjectVoteFile::vote_l_cit |
Definition at line 30 of file governance-votedb.h.
typedef vote_l_t::iterator CGovernanceObjectVoteFile::vote_l_it |
Definition at line 28 of file governance-votedb.h.
typedef std::list<CGovernanceVote> CGovernanceObjectVoteFile::vote_l_t |
Definition at line 26 of file governance-votedb.h.
typedef vote_m_t::const_iterator CGovernanceObjectVoteFile::vote_m_cit |
Definition at line 36 of file governance-votedb.h.
typedef vote_m_t::iterator CGovernanceObjectVoteFile::vote_m_it |
Definition at line 34 of file governance-votedb.h.
typedef std::map<uint256,vote_l_it> CGovernanceObjectVoteFile::vote_m_t |
Definition at line 32 of file governance-votedb.h.
CGovernanceObjectVoteFile::CGovernanceObjectVoteFile | ( | ) |
Definition at line 7 of file governance-votedb.cpp.
CGovernanceObjectVoteFile::CGovernanceObjectVoteFile | ( | const CGovernanceObjectVoteFile & | other | ) |
Definition at line 13 of file governance-votedb.cpp.
void CGovernanceObjectVoteFile::AddVote | ( | const CGovernanceVote & | vote | ) |
Add a vote to the file
Definition at line 21 of file governance-votedb.cpp.
Referenced by CGovernanceObject::ProcessVote().
bool CGovernanceObjectVoteFile::GetVote | ( | const uint256 & | nHash, |
CGovernanceVote & | vote | ||
) | const |
Retrieve a vote cached in memory
Definition at line 37 of file governance-votedb.cpp.
Referenced by CGovernanceManager::SerializeVoteForHash().
|
inline |
Definition at line 67 of file governance-votedb.h.
Referenced by CGovernanceObject::SerializationOp().
std::vector< CGovernanceVote > CGovernanceObjectVoteFile::GetVotes | ( | ) | const |
Definition at line 47 of file governance-votedb.cpp.
Referenced by CGovernanceManager::GetMatchingVotes(), CGovernanceManager::RebuildIndexes(), CGovernanceManager::RequestGovernanceObject(), and CGovernanceManager::Sync().
bool CGovernanceObjectVoteFile::HasVote | ( | const uint256 & | nHash | ) | const |
Return true if the vote with this hash is currently cached in memory
Definition at line 28 of file governance-votedb.cpp.
Referenced by CGovernanceManager::HaveVoteForHash(), and CGovernanceObject::ProcessVote().
CGovernanceObjectVoteFile & CGovernanceObjectVoteFile::operator= | ( | const CGovernanceObjectVoteFile & | other | ) |
Definition at line 71 of file governance-votedb.cpp.
|
private |
Definition at line 79 of file governance-votedb.cpp.
Referenced by CGovernanceObjectVoteFile(), operator=(), and SerializationOp().
void CGovernanceObjectVoteFile::RemoveVotesFromMasternode | ( | const COutPoint & | outpointMasternode | ) |
Definition at line 56 of file governance-votedb.cpp.
Referenced by CGovernanceObject::ClearMasternodeVotes().
|
inline |
Definition at line 80 of file governance-votedb.h.
CGovernanceObjectVoteFile::ADD_SERIALIZE_METHODS |
Definition at line 77 of file governance-votedb.h.
|
private |
Definition at line 43 of file governance-votedb.h.
Referenced by AddVote(), GetVotes(), operator=(), RebuildIndex(), RemoveVotesFromMasternode(), and SerializationOp().
|
private |
Definition at line 45 of file governance-votedb.h.
Referenced by AddVote(), GetVote(), HasVote(), RebuildIndex(), and RemoveVotesFromMasternode().
|
staticprivate |
Definition at line 39 of file governance-votedb.h.
|
private |
Definition at line 41 of file governance-votedb.h.
Referenced by AddVote(), GetVoteCount(), operator=(), RebuildIndex(), RemoveVotesFromMasternode(), and SerializationOp().