Reorganize beast modules and files

This commit is contained in:
Vinnie Falco
2013-09-22 19:02:48 -07:00
parent 19eff08e16
commit 20b2e318eb
111 changed files with 1568 additions and 8991 deletions

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
#define RIPPLE_VALIDATORS_MANAGER_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Maintains the list of chosen validators.
@@ -57,7 +57,7 @@ public:
/** Add a live source of validators from a trusted URL.
The URL will be contacted periodically to update the list.
*/
virtual void addURL (UniformResourceLocator const& url) = 0;
virtual void addURL (URL const& url) = 0;
/** Add a live source of validators.
The caller loses ownership of the object.
@@ -79,6 +79,7 @@ public:
virtual void receiveValidation (ReceivedValidation const& rv) = 0;
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCE_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** A source of validator descriptors. */
class Source
@@ -57,6 +57,7 @@ public:
virtual Result fetch (CancelCallback& callback, Journal journal) = 0;
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_TYPES_H_INCLUDED
#define RIPPLE_VALIDATORS_TYPES_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
typedef RipplePublicKey PublicKey;
typedef RipplePublicKeyHash PublicKeyHash;
@@ -25,6 +25,7 @@ struct CancelCallback
virtual bool shouldCancel () = 0;
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_CANCELCALLBACKS_H_INCLUDED
#define RIPPLE_VALIDATORS_CANCELCALLBACKS_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
// Dummy CancelCallback that does nothing
//
@@ -49,6 +49,7 @@ private:
bool m_interrupted;
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
#define RIPPLE_VALIDATORS_CHOSENLIST_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
class ChosenList : public SharedObject
{
@@ -59,6 +59,7 @@ private:
MapType m_map;
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
#define RIPPLE_VALIDATORS_LOGIC_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
// Tunable constants
enum
@@ -400,6 +400,7 @@ public:
//----------------------------------------------------------------------
};
}
}
#endif

View File

@@ -84,8 +84,8 @@ What determines that a validator is good?
the behavior is measured.
*/
namespace Validators
{
namespace ripple {
namespace Validators {
class ManagerImp
: public Manager
@@ -180,7 +180,7 @@ public:
addStaticSource (SourceFile::New (file));
}
void addURL (UniformResourceLocator const& url)
void addURL (URL const& url)
{
addSource (SourceURL::New (url));
}
@@ -308,3 +308,4 @@ Validators::Manager* Validators::Manager::New (Stoppable& parent, Journal journa
}
}
}

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
Source::Result::Result ()
: success (false)
@@ -21,3 +21,4 @@ void Source::Result::swapWith (Result& other)
}
}
}

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCEDESC_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Additional state information associated with a Source. */
struct SourceDesc
@@ -52,6 +52,7 @@ struct SourceDesc
typedef DynamicList <SourceDesc> SourcesType;
}
}
#endif

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
class SourceFileImp : public SourceFile
{
@@ -56,3 +56,4 @@ SourceFile* SourceFile::New (File const& file)
}
}
}

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_SOURCEFILE_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCEFILE_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Provides validators from a text file.
Typically this will come from a local configuration file.
@@ -19,6 +19,7 @@ public:
static SourceFile* New (File const& path);
};
}
}
#endif

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
class SourceStringsImp : public SourceStrings
{
@@ -70,3 +70,4 @@ SourceStrings* SourceStrings::New (
}
}
}

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_SOURCESTRINGS_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCESTRINGS_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Provides validators from a set of Validator strings.
Typically this will come from a local configuration file.
@@ -20,6 +20,7 @@ public:
String name, StringArray const& strings);
};
}
}
#endif

View File

@@ -4,13 +4,13 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
class SourceURLImp : public SourceURL
{
public:
explicit SourceURLImp (UniformResourceLocator const& url)
explicit SourceURLImp (URL const& url)
: m_url (url)
{
}
@@ -57,13 +57,13 @@ public:
}
private:
UniformResourceLocator m_url;
URL m_url;
};
//------------------------------------------------------------------------------
SourceURL* SourceURL::New (
UniformResourceLocator const& url)
URL const& url)
{
ScopedPointer <SourceURL> object (
new SourceURLImp (url));
@@ -72,3 +72,4 @@ SourceURL* SourceURL::New (
}
}
}

View File

@@ -7,17 +7,17 @@
#ifndef RIPPLE_VALIDATORS_SOURCEURL_H_INCLUDED
#define RIPPLE_VALIDATORS_SOURCEURL_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Provides validators from a trusted URI (e.g. HTTPS)
*/
/** Provides validators from a trusted URI (e.g. HTTPS) */
class SourceURL : public Source
{
public:
static SourceURL* New (UniformResourceLocator const& url);
static SourceURL* New (URL const& url);
};
}
}
#endif

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_STORE_H_INCLUDED
#define RIPPLE_VALIDATORS_STORE_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Abstract persistence for Validators data. */
class Store
@@ -29,6 +29,7 @@ protected:
Store () { }
};
}
}
#endif

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
StoreSqdb::StoreSqdb (Journal journal)
: m_journal (journal)
@@ -343,3 +343,4 @@ Error StoreSqdb::init ()
}
}
}

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_STORESQDB_H_INCLUDED
#define RIPPLE_VALIDATORS_STORESQDB_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Database persistence for Validators using SQLite */
class StoreSqdb : public Store
@@ -36,6 +36,7 @@ private:
sqdb::session m_session;
};
}
}
#endif

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
class Tests : public UnitTest
{
@@ -220,3 +220,4 @@ public:
static Tests tests;
}
}

View File

@@ -4,8 +4,8 @@
*/
//==============================================================================
namespace Validators
{
namespace ripple {
namespace Validators {
struct Utilities::Helpers
{
@@ -252,3 +252,4 @@ PublicKey Utilities::stringToPublicKey (std::string const& s)
//------------------------------------------------------------------------------
}
}

View File

@@ -7,8 +7,8 @@
#ifndef RIPPLE_VALIDATORS_UTILITIES_H_INCLUDED
#define RIPPLE_VALIDATORS_UTILITIES_H_INCLUDED
namespace Validators
{
namespace ripple {
namespace Validators {
/** Common code for Validators classes.
*/
@@ -67,6 +67,7 @@ public:
Source::Info& info, std::string const& line, Journal journal);
};
}
}
#endif

View File

@@ -12,12 +12,16 @@
#include <boost/regex.hpp>
#include <boost/unordered_set.hpp>
#include "beast/modules/beast_asio/beast_asio.h"
#include "beast/modules/beast_sqdb/beast_sqdb.h"
#include "../ripple_data/ripple_data.h" // for RippleAddress REMOVE ASAP
#include "../testoverlay/ripple_testoverlay.h" // for unit test
namespace ripple
{
namespace ripple {
using namespace beast;
}
# include "impl/CancelCallbacks.h"
# include "impl/ChosenList.h"
@@ -38,5 +42,3 @@ namespace ripple
#include "impl/StoreSqdb.cpp"
#include "impl/Tests.cpp"
#include "impl/Utilities.cpp"
}

View File

@@ -7,28 +7,16 @@
#ifndef RIPPLE_VALIDATORS_H_INCLUDED
#define RIPPLE_VALIDATORS_H_INCLUDED
// VFALCO TODO Remove buffers/beast_asio dependency
//
// VFALCO NOTE It is unfortunate that we are exposing boost/asio.hpp
// needlessly. Its only required because of the buffers types.
// The HTTPClient interface doesn't need asio (although the
// implementation does. This is also required for
// UniformResourceLocator.
//
#include "beast/modules/beast_asio/beast_asio.h"
#include "beast/modules/beast_core/beast_core.h"
#include "../ripple_basics/ripple_basics.h" // for RipplePublicKey, remove asap
#include "beast/beast/http/URL.h"
#include "../ripple/rpc/ripple_rpc.h"
#include "../ripple_data/ripple_data.h"
namespace ripple
{
using namespace beast;
#include "../ripple/types/ripple_types.h"
# include "api/Types.h"
# include "api/Source.h"
#include "api/Manager.h"
}
#endif