Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge] Rapidjson #258

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "external/keccak"]
path = external/keccak
url = https://github.com/gvanas/KeccakCodePackage
[submodule "external/rapidjson"]
path = external/rapidjson
url = https://github.com/Tencent/rapidjson
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ configure_file(cmake/version.hpp.in
file(GLOB_RECURSE PROJECT_SOURCE_FILES ${PROJECT_SOURCE_DIR}/*.cpp)

include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("external/json/src")
include_directories("external/rapidjson/include")

########## DEPENDENCIES ##########

Expand Down
1 change: 1 addition & 0 deletions external/rapidjson
Submodule rapidjson added at 67a17c
4 changes: 3 additions & 1 deletion include/iota/api/requests/add_neighbors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <iota/api/requests/base.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -60,7 +62,7 @@ class AddNeighbors : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/attach_to_tangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/requests/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -74,7 +76,7 @@ class AttachToTangle : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
6 changes: 3 additions & 3 deletions include/iota/api/requests/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

#pragma once

#include <json.hpp>
#include <string>

using json = nlohmann::json;
#include <iota/utils/json.hpp>

namespace IOTA {

Expand Down Expand Up @@ -58,7 +58,7 @@ class Base {
*
* @param data where to store serialisation.
*/
virtual void serialize(json& data) const;
virtual void serialize(Utils::json& data) const;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/broadcast_transactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/requests/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -62,7 +64,7 @@ class BroadcastTransactions : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
2 changes: 1 addition & 1 deletion include/iota/api/requests/find_transactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class FindTransactions : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
2 changes: 1 addition & 1 deletion include/iota/api/requests/get_balances.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GetBalances : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/get_inclusion_states.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/requests/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -68,7 +70,7 @@ class GetInclusionStates : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GetTransactionsToApprove : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/get_trytes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/requests/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -62,7 +64,7 @@ class GetTrytes : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/remove_neighbors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <iota/api/requests/base.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -61,7 +63,7 @@ class RemoveNeighbors : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 3 additions & 1 deletion include/iota/api/requests/store_transactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/requests/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -62,7 +64,7 @@ class StoreTransactions : public Base {
*
* @param data where to store serialisation.
*/
void serialize(json& data) const override;
void serialize(Utils::json& data) const override;

public:
/**
Expand Down
4 changes: 2 additions & 2 deletions include/iota/api/responses/add_neighbors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AddNeighbors : public Base {
*
* @param res json to be used for deserialization.
*/
explicit AddNeighbors(const json& res);
explicit AddNeighbors(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -68,7 +68,7 @@ class AddNeighbors : public Base {
*
* @param res json data to be used for deserialization.
*/
void deserialize(const json& res) override;
void deserialize(const Utils::json& res) override;

public:
/**
Expand Down
6 changes: 4 additions & 2 deletions include/iota/api/responses/attach_to_tangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/responses/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -62,7 +64,7 @@ class AttachToTangle : public Base {
*
* @param res json to be used for deserialization.
*/
explicit AttachToTangle(const json& res);
explicit AttachToTangle(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -75,7 +77,7 @@ class AttachToTangle : public Base {
*
* @param res json data to be used for deserialization.
*/
void deserialize(const json& res) override;
void deserialize(const Utils::json& res) override;

public:
/**
Expand Down
8 changes: 3 additions & 5 deletions include/iota/api/responses/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

#include <cstdint>

#include <json.hpp>

using json = nlohmann::json;
#include <iota/utils/json.hpp>

namespace IOTA {

Expand All @@ -54,7 +52,7 @@ class Base {
*
* @param res json to be used for deserialization.
*/
explicit Base(const json& res);
explicit Base(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -67,7 +65,7 @@ class Base {
*
* @param res json data to be used for deserialization.
*/
virtual void deserialize(const json& res);
virtual void deserialize(const Utils::json& res);

public:
/**
Expand Down
6 changes: 4 additions & 2 deletions include/iota/api/responses/find_transactions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/responses/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -58,7 +60,7 @@ class FindTransactions : public Base {
*
* @param res json to be used for deserialization.
*/
explicit FindTransactions(const json& res);
explicit FindTransactions(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -71,7 +73,7 @@ class FindTransactions : public Base {
*
* @param res json data to be used for deserialization.
*/
void deserialize(const json& res) override;
void deserialize(const Utils::json& res) override;

public:
/**
Expand Down
2 changes: 2 additions & 0 deletions include/iota/api/responses/get_account_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <iota/models/fwd.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down
6 changes: 4 additions & 2 deletions include/iota/api/responses/get_balances.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/responses/base.hpp>
#include <iota/types/trytes.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -60,7 +62,7 @@ class GetBalances : public Base {
*
* @param res json to be used for deserialization.
*/
explicit GetBalances(const json& res);
explicit GetBalances(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -73,7 +75,7 @@ class GetBalances : public Base {
*
* @param res json data to be used for deserialization.
*/
void deserialize(const json& res) override;
void deserialize(const Utils::json& res) override;

public:
/**
Expand Down
2 changes: 2 additions & 0 deletions include/iota/api/responses/get_balances_and_format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/responses/base.hpp>
#include <iota/models/fwd.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down
2 changes: 2 additions & 0 deletions include/iota/api/responses/get_bundle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <iota/api/responses/base.hpp>
#include <iota/models/fwd.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down
6 changes: 4 additions & 2 deletions include/iota/api/responses/get_inclusion_states.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include <iota/api/responses/base.hpp>

#include <vector>

namespace IOTA {

namespace API {
Expand Down Expand Up @@ -59,7 +61,7 @@ class GetInclusionStates : public Base {
*
* @param res json to be used for deserialization.
*/
explicit GetInclusionStates(const json& res);
explicit GetInclusionStates(const Utils::json& res);

/**
* Default dtor.
Expand All @@ -72,7 +74,7 @@ class GetInclusionStates : public Base {
*
* @param res json data to be used for deserialization.
*/
void deserialize(const json& res) override;
void deserialize(const Utils::json& res) override;

public:
/**
Expand Down
Loading