Levelization, improve structure of source files:

Source files are moved between modules, includes changed and added,
and some code rewritten, with the goal of reducing cross-module dependencies
and eliminating cycles in the dependency graph of classes.

* Remove RippleAddress dependency in CKey_test
* ByteOrder.h, Blob.h, and strHex.h are moved to basics/. This makes
  the basics/ module fully independent of other ripple sources.
* types/ is merged into protocol/. The protocol module now contains
  all primitive types specific to the Ripple protocol.
* Move ErrorCodes to protocol/
* Move base_uint to basics/
* Move Base58 to crypto/
* Remove dependence on Serializer in GenerateDeterministicKey
* Eliminate unity header json.h
* Remove obsolete unity headers
* Remove unnecessary includes
This commit is contained in:
Vinnie Falco
2014-12-19 08:57:30 -08:00
parent e3fbb83ad0
commit 60f27178b8
109 changed files with 859 additions and 493 deletions

View File

@@ -19,8 +19,8 @@
#include <BeastConfig.h>
#include <ripple/rpc/Manager.h>
#include <ripple/unity/app.h>
#include <ripple/unity/rpcx.h>
#include <ripple/unity/websocket.h>
#include <ripple/app/impl/BasicApp.cpp>
#include <ripple/app/main/CollectorManager.cpp>

View File

@@ -23,6 +23,7 @@
#include <BeastConfig.h>
#include <ripple/crypto/impl/Base58.cpp>
#include <ripple/crypto/impl/Base58Data.cpp>
#include <ripple/crypto/impl/CBigNum.cpp>
#include <ripple/crypto/impl/DHUtil.cpp>

View File

@@ -1,103 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_DATA_H_INCLUDED
#define RIPPLE_DATA_H_INCLUDED
#include <ripple/unity/types.h>
#include <ripple/unity/json.h>
#include <ripple/sslutil/ECDSACanonical.h>
struct bignum_st;
typedef struct bignum_st BIGNUM;
#include <ripple/crypto/Base58Data.h>
#include <ripple/crypto/RFC1751.h>
#include <ripple/protocol/BuildInfo.h>
#include <ripple/protocol/SField.h>
#include <ripple/protocol/HashPrefix.h>
#include <ripple/protocol/Protocol.h>
#include <ripple/protocol/RippleAddress.h>
#include <ripple/protocol/Serializer.h> // needs CKey
#include <ripple/protocol/TER.h>
#include <ripple/protocol/SerializedTypes.h> // needs Serializer, TER
#include <ripple/protocol/SerializedObjectTemplate.h>
#include <ripple/protocol/KnownFormats.h>
#include <ripple/protocol/LedgerFormats.h> // needs SOTemplate from SerializedObjectTemplate
#include <ripple/protocol/TxFormats.h>
#include <ripple/protocol/STObject.h>
#include <ripple/protocol/STArray.h>
#include <ripple/protocol/TxFlags.h>
#include <ripple/protocol/STParsedJSON.h>
//------------------------------------------------------------------------------
namespace boost
{
template <>
struct range_mutable_iterator <ripple::STPath>
{
typedef std::vector <ripple::STPathElement>::iterator type;
};
template <>
struct range_const_iterator <ripple::STPath>
{
typedef std::vector <ripple::STPathElement>::const_iterator type;
};
template <>
struct range_mutable_iterator <ripple::STPathSet>
{
typedef std::vector <ripple::STPath>::iterator type;
};
template <>
struct range_const_iterator <ripple::STPathSet>
{
typedef std::vector <ripple::STPath>::const_iterator type;
};
template <>
struct range_mutable_iterator <ripple::STObject>
{
typedef ripple::STObject::iterator type;
};
template <>
struct range_const_iterator <ripple::STObject>
{
typedef ripple::STObject::const_iterator type;
};
template <>
struct range_mutable_iterator <ripple::STArray>
{
typedef ripple::STArray::iterator type;
};
template <>
struct range_const_iterator <ripple::STArray>
{
typedef ripple::STArray::const_iterator type;
};
}
#endif

View File

@@ -34,8 +34,6 @@
#include <ripple/json/impl/json_batchallocator.h>
#endif
#include <ripple/unity/json.h>
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );

View File

@@ -1,53 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_JSON_H_INCLUDED
#define RIPPLE_JSON_H_INCLUDED
#include <beast/Config.h>
#include <beast/strings/String.h>
#include <beast/utility/PropertyStream.h>
#include <deque>
#include <stack>
#include <vector>
// For json/
//
// VFALCO TODO Clean up these one-offs
#include <ripple/json/json_config.h> // Needed before these cpptl includes
#ifndef JSON_USE_CPPTL_SMALLMAP
#include <map>
#else
#include <cpptl/smallmap.h>
#endif
#ifdef JSON_USE_CPPTL
#include <cpptl/forwards.h>
#endif
#include <ripple/json/json_forwards.h>
#include <ripple/json/json_features.h>
#include <ripple/json/json_value.h>
#include <ripple/json/json_reader.h>
#include <ripple/json/to_string.h>
#include <ripple/json/JsonPropertyStream.h>
#endif

View File

@@ -24,13 +24,17 @@
#endif
#include <ripple/protocol/impl/BuildInfo.cpp>
#include <ripple/protocol/impl/SField.cpp>
#include <ripple/protocol/impl/ByteOrder.cpp>
#include <ripple/protocol/impl/ErrorCodes.cpp>
#include <ripple/protocol/impl/HashPrefix.cpp>
#include <ripple/protocol/impl/Indexes.cpp>
#include <ripple/protocol/impl/Issue.cpp>
#include <ripple/protocol/impl/LedgerFormats.cpp>
#include <ripple/protocol/impl/RippleAddress.cpp>
#include <ripple/protocol/impl/Serializer.cpp>
#include <ripple/protocol/impl/SField.cpp>
#include <ripple/protocol/impl/SOTemplate.cpp>
#include <ripple/protocol/impl/strHex.cpp>
#include <ripple/protocol/impl/TER.cpp>
#include <ripple/protocol/impl/TxFormats.cpp>
#include <ripple/protocol/impl/UintTypes.cpp>
@@ -49,5 +53,4 @@
#include <ripple/protocol/impl/STValidation.cpp>
#include <ripple/protocol/impl/STVector256.cpp>
// VFALCO Should be in a tests dir
#include <ripple/protocol/impl/STAmount.test.cpp>
#include <ripple/protocol/tests/STAmount.test.cpp>

View File

@@ -21,17 +21,11 @@
// Unfortunate but necessary since RPC handlers can literally do anything
#include <ripple/unity/app.h>
#include <ripple/unity/json.h>
#include <ripple/protocol/JsonFields.h>
#include <ripple/unity/rpcx.h>
#include <ripple/rpc/RPCHandler.h>
#include <ripple/overlay/Overlay.h>
#include <tuple>
#include <ripple/rpc/impl/Coroutine.cpp>
#include <ripple/rpc/impl/ErrorCodes.cpp>
#include <ripple/rpc/impl/JsonObject.cpp>
#include <ripple/rpc/impl/JsonWriter.cpp>
#include <ripple/rpc/impl/WriteJson.cpp>

View File

@@ -1,27 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_RPC_H_INCLUDED
#define RIPPLE_RPC_H_INCLUDED
#include <ripple/rpc/ErrorCodes.h>
#include <ripple/rpc/Manager.h>
#include <ripple/rpc/Request.h>
#endif

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#ifndef RIPPLE_SSLUTIL_H_INCLUDED
#define RIPPLE_SSLUTIL_H_INCLUDED
#include <ripple/unity/types.h>
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/ripemd.h>
#include <openssl/sha.h>
#include <ripple/sslutil/CAutoBN_CTX.h>
#include <ripple/sslutil/CBigNum.h>
#include <ripple/sslutil/DHUtil.h>
#include <ripple/sslutil/ECDSACanonical.h>
#endif

View File

@@ -1,25 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//==============================================================================
#include <BeastConfig.h>
#include <ripple/types/impl/Base58.cpp>
#include <ripple/types/impl/ByteOrder.cpp>
#include <ripple/types/impl/strHex.cpp>
#include <ripple/types/impl/Issue.cpp>