forked from lthn/blockchain
added struct documentation macro
This commit is contained in:
parent
73b7123906
commit
a2b28806b1
2 changed files with 8 additions and 13 deletions
|
|
@ -68,10 +68,7 @@ public: \
|
|||
#define KV_SERIALIZE_N(varialble, val_name) \
|
||||
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name);
|
||||
|
||||
#define KV_SERIALIZE_N_DOC(varialble, val_name, substitute, description) \
|
||||
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name, auto_doc_mode, substitute, description);
|
||||
|
||||
#define KV_SERIALIZE_N_DOC2(varialble, val_name) \
|
||||
#define KV_SERIALIZE_N_DOC(varialble, val_name) \
|
||||
{ using var_type = decltype(this_ref.varialble); \
|
||||
epee::serialization::selector<is_store>::serialize(this_ref.varialble, stg, hparent_section, val_name); \
|
||||
if constexpr (t_storage::use_descriptions::value) \
|
||||
|
|
@ -140,11 +137,9 @@ public: \
|
|||
#define END_KV_SERIALIZE_MAP() return true;}
|
||||
|
||||
#define KV_SERIALIZE(varialble) KV_SERIALIZE_N(varialble, #varialble)
|
||||
#define KV_SERIALIZE_DOC2(varialble) KV_SERIALIZE_N_DOC2( varialble, #varialble)
|
||||
#define KV_SERIALIZE_DOC(varialble, substitute, description) KV_SERIALIZE_N_DOC( varialble, #varialble, substitute, description)
|
||||
|
||||
#define KV_SERIALIZE_DOC(varialble) KV_SERIALIZE_N_DOC( varialble, #varialble)
|
||||
|
||||
//#define KV_SERIALIZE_DOC(varialble, substitute, description) KV_SERIALIZE_N_DOC( varialble, #varialble, substitute, description)
|
||||
#define DOC_COMMAND(desciption_text) inline static const char* description;
|
||||
|
||||
|
||||
#define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, #varialble)
|
||||
|
|
|
|||
|
|
@ -152,8 +152,8 @@ namespace currency
|
|||
std::string status;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE_DOC2(height) DOC_DSCR("Some height of the block") DOC_EXMP(11111) DOC_END
|
||||
KV_SERIALIZE_DOC2(status) DOC_DSCR("Status of the operation") DOC_EXMP("OK") DOC_END
|
||||
KV_SERIALIZE_DOC(height) DOC_DSCR("Some height of the block") DOC_EXMP(11111) DOC_END
|
||||
KV_SERIALIZE_DOC(status) DOC_DSCR("Status of the operation") DOC_EXMP("OK") DOC_END
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
};
|
||||
|
|
@ -212,9 +212,9 @@ namespace currency
|
|||
std::string status;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE_DOC2(txs_as_hex) DOC_DSCR("Transactions stored as blobs") DOC_EXMP_AUTO(1, "7d914497d91442f8f3c2268397d914497d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc2f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc") DOC_END
|
||||
KV_SERIALIZE_DOC2(missed_tx) DOC_DSCR("Missed transactions hashes") DOC_EXMP_AUTO(1, "97d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc") DOC_END
|
||||
KV_SERIALIZE_DOC2(status) DOC_DSCR("Command response status") DOC_EXMP_AUTO("OK") DOC_END
|
||||
KV_SERIALIZE_DOC(txs_as_hex) DOC_DSCR("Transactions stored as blobs") DOC_EXMP_AUTO(1, "7d914497d91442f8f3c2268397d914497d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc2f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc") DOC_END
|
||||
KV_SERIALIZE_DOC(missed_tx) DOC_DSCR("Missed transactions hashes") DOC_EXMP_AUTO(1, "97d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc") DOC_END
|
||||
KV_SERIALIZE_DOC(status) DOC_DSCR("Command response status") DOC_EXMP_AUTO("OK") DOC_END
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue