beast cleanup and tidying:

* Replace custom types with C++11 <cstdint> types
* Fix sqlite integer intos and uses
* Fix String implicit integer constructors
* Escape the enclosing namespace in sqdb
* Replace contract checks with assert
* Make many header files compile independently
* Remove the dependence on beast_core.h in many places
* Remove unused or obsolete classes and functions
* Remove unused or obsolete macros
* Remove unused network functions and files
* Remove unused or obsolete classes:
  - ChildProcess
  - HighResolutionTimer
  - InterProcessLock
  - Throw
  - TrackedMutex
  - UntrackedMutex
  - XmlDocument
  - XmlElement
This commit is contained in:
Vinnie Falco
2014-03-22 09:43:11 -07:00
parent 936f45c7ec
commit b2d97703c6
440 changed files with 3139 additions and 9643 deletions

View File

@@ -23,6 +23,8 @@
#include "../../beast/beast/unit_test/suite.h"
#include <cassert>
namespace ripple {
MultiSocket* MultiSocket::New (
@@ -234,7 +236,7 @@ public:
template <typename Protocol>
void testProxyFlags (int extraClientFlags, int extraServerFlags)
{
check_precondition (! MultiSocket::Flag (extraClientFlags).any_set (
assert (! MultiSocket::Flag (extraClientFlags).any_set (
MultiSocket::Flag::client_role | MultiSocket::Flag::server_role));
runProxy <Protocol> (MultiSocket::Flag::client_role | extraClientFlags,
@@ -246,7 +248,7 @@ public:
template <typename Protocol>
void testFlags (int extraClientFlags, int extraServerFlags)
{
check_precondition (! MultiSocket::Flag (extraClientFlags).any_set (
assert (! MultiSocket::Flag (extraClientFlags).any_set (
MultiSocket::Flag::client_role | MultiSocket::Flag::server_role));
run <Protocol> (MultiSocket::Flag::client_role | extraClientFlags,

View File

@@ -28,6 +28,8 @@
#include "../../../beast/beast/cxx14/type_traits.h"
#include <cassert>
#ifndef RIPPLE_MULTISOCKET_NO_ALLOCATOR
#define RIPPLE_MULTISOCKET_NO_ALLOCATOR 0
#endif
@@ -387,7 +389,7 @@ protected:
static Flag cleaned_flags (Flag flags)
{
// Can't set both client and server
check_precondition (! flags.set (
assert (! flags.set (
Flag::client_role | Flag::server_role));
if (flags.set (Flag::client_role))

View File

@@ -28,6 +28,8 @@
#include "../ResolverAsio.h"
#include <cassert>
namespace ripple {
class ResolverAsioImpl
@@ -81,8 +83,8 @@ public:
~ResolverAsioImpl ()
{
check_precondition (m_work.empty ());
check_precondition (m_stopped);
assert (m_work.empty ());
assert (m_stopped);
}
//-------------------------------------------------------------------------
@@ -100,9 +102,9 @@ public:
void start ()
{
check_precondition (m_work.empty ());
check_precondition (m_stopped == true);
check_precondition (m_stop_called == false);
assert (m_work.empty ());
assert (m_stopped == true);
assert (m_stop_called == false);
if (m_stopped.exchange (false) == true)
{
@@ -136,9 +138,9 @@ public:
std::vector <std::string> const& names,
HandlerType const& handler)
{
check_precondition (m_stop_called == false);
check_precondition (m_stopped == true);
check_precondition (!names.empty());
assert (m_stop_called == false);
assert (m_stopped == true);
assert (!names.empty());
// TODO NIKB use rvalue references to construct and move
// reducing cost.
@@ -151,7 +153,7 @@ public:
// Resolver
void do_stop (CompletionCounter)
{
check_precondition (m_stop_called == true);
assert (m_stop_called == true);
if (m_stopped.exchange (true) == false)
{
@@ -277,7 +279,7 @@ public:
void do_resolve (std::vector <std::string> const& names,
HandlerType const& handler, CompletionCounter)
{
check_precondition (! names.empty());
assert (! names.empty());
if (m_stop_called == false)
{

View File

@@ -19,8 +19,6 @@
#include "../RippleSSLContext.h"
#include "../../beast/modules/beast_core/beast_core.h"
#include <cstdint>
#include <sstream>