Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS
This commit is contained in:
parent
47eb76597e
commit
3f6540ad8f
@ -46,7 +46,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -268,7 +268,7 @@ public:
|
||||
// This format is more complex, but significantly smaller (at most 1.5 MiB), and supports
|
||||
// changes to the ADDRMAN_ parameters without breaking the on-disk structure.
|
||||
//
|
||||
// We don't use IMPLEMENT_SERIALIZE since the serialization and deserialization code has
|
||||
// We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has
|
||||
// very little in common.
|
||||
template<typename Stream>
|
||||
void Serialize(Stream &s, int nType, int nVersionDummy) const
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
std::string strStatusBar;
|
||||
std::string strReserved;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -84,7 +84,7 @@ public:
|
||||
SetNull();
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn);
|
||||
CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
22
src/core.h
22
src/core.h
@ -31,7 +31,7 @@ public:
|
||||
COutPoint() { SetNull(); }
|
||||
COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; }
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -91,7 +91,7 @@ public:
|
||||
explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits<unsigned int>::max());
|
||||
CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits<uint32_t>::max());
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -145,7 +145,7 @@ public:
|
||||
friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; }
|
||||
std::string ToString() const;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -170,7 +170,7 @@ public:
|
||||
|
||||
CTxOut(int64_t nValueIn, CScript scriptPubKeyIn);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -253,7 +253,7 @@ public:
|
||||
|
||||
CTransaction& operator=(const CTransaction& tx);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -311,7 +311,7 @@ struct CMutableTransaction
|
||||
CMutableTransaction();
|
||||
CMutableTransaction(const CTransaction& tx);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -340,7 +340,7 @@ public:
|
||||
|
||||
CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -407,7 +407,7 @@ public:
|
||||
// undo information for all txins
|
||||
std::vector<CTxInUndo> vprevout;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -440,7 +440,7 @@ public:
|
||||
SetNull();
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -497,7 +497,7 @@ public:
|
||||
*((CBlockHeader*)this) = header;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -547,7 +547,7 @@ struct CBlockLocator
|
||||
vHave = vHaveIn;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
// such as the various parameters to scrypt
|
||||
std::vector<unsigned char> vchOtherDerivationParameters;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
14
src/main.h
14
src/main.h
@ -197,7 +197,7 @@ struct CDiskBlockPos
|
||||
int nFile;
|
||||
unsigned int nPos;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -230,7 +230,7 @@ struct CDiskTxPos : public CDiskBlockPos
|
||||
{
|
||||
unsigned int nTxOffset; // after header
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -313,7 +313,7 @@ class CBlockUndo
|
||||
public:
|
||||
std::vector<CTxUndo> vtxundo; // for all but the coinbase
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -420,7 +420,7 @@ protected:
|
||||
public:
|
||||
|
||||
// serialization implementation
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -496,7 +496,7 @@ public:
|
||||
uint64_t nTimeFirst; // earliest time of block in file
|
||||
uint64_t nTimeLast; // latest time of block in file
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -770,7 +770,7 @@ public:
|
||||
hashPrev = (pprev ? pprev->GetBlockHash() : 0);
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -992,7 +992,7 @@ public:
|
||||
// thus the filter will likely be modified.
|
||||
CMerkleBlock(const CBlock& block, CBloomFilter& filter);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -88,7 +88,7 @@ class CNetAddr
|
||||
friend bool operator!=(const CNetAddr& a, const CNetAddr& b);
|
||||
friend bool operator<(const CNetAddr& a, const CNetAddr& b);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -150,7 +150,7 @@ class CService : public CNetAddr
|
||||
CService(const struct in6_addr& ipv6Addr, unsigned short port);
|
||||
CService(const struct sockaddr_in6& addr);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -35,7 +35,7 @@ class CMessageHeader
|
||||
std::string GetCommand() const;
|
||||
bool IsValid() const;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -85,7 +85,7 @@ class CAddress : public CService
|
||||
|
||||
void Init();
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -119,7 +119,7 @@ class CInv
|
||||
CInv(int typeIn, const uint256& hashIn);
|
||||
CInv(const std::string& strType, const uint256& hashIn);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
QDateTime date;
|
||||
SendCoinsRecipient recipient;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
static const int CURRENT_VERSION = 1;
|
||||
int nVersion;
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -91,9 +91,9 @@ enum
|
||||
|
||||
/* Implement three methods for serializable objects. These are actually wrappers over
|
||||
* "SerializationOp" template, which implements the body of each class' serialization
|
||||
* code. Adding "IMPLEMENT_SERIALIZE" in the body of the class causes these wrappers to be
|
||||
* code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be
|
||||
* added as members. */
|
||||
#define IMPLEMENT_SERIALIZE \
|
||||
#define ADD_SERIALIZE_METHODS \
|
||||
size_t GetSerializeSize(int nType, int nVersion) const { \
|
||||
CSizeComputer s(nType, nVersion); \
|
||||
NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion);\
|
||||
@ -807,7 +807,7 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m, int nType, int nVersion)
|
||||
|
||||
|
||||
//
|
||||
// Support for IMPLEMENT_SERIALIZE and READWRITE macro
|
||||
// Support for ADD_SERIALIZE_METHODS and READWRITE macro
|
||||
//
|
||||
struct CSerActionSerialize
|
||||
{
|
||||
|
12
src/wallet.h
12
src/wallet.h
@ -64,7 +64,7 @@ public:
|
||||
CKeyPool();
|
||||
CKeyPool(const CPubKey& vchPubKeyIn);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -492,7 +492,7 @@ public:
|
||||
fMerkleVerified = false;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -605,7 +605,7 @@ public:
|
||||
nOrderPos = -1;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -893,7 +893,7 @@ public:
|
||||
|
||||
CWalletKey(int64_t nExpires=0);
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -929,7 +929,7 @@ public:
|
||||
vchPubKey = CPubKey();
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
@ -972,7 +972,7 @@ public:
|
||||
nEntryNo = 0;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
nCreateTime = nCreateTime_;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIALIZE;
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
|
Loading…
Reference in New Issue
Block a user