Cleanups:

* Reduce Beast dependencies
* Remove unnecessary includes
* Don't use deprecated bassert macros
* Don't use beast::String in Json::Value
This commit is contained in:
Nik Bougalis
2016-01-18 21:20:08 -08:00
parent b4f8dc7abf
commit 555cd59a59
28 changed files with 39 additions and 49 deletions

View File

@@ -21,6 +21,7 @@
#include <ripple/resource/Consumer.h>
#include <ripple/resource/impl/Entry.h>
#include <ripple/resource/impl/Logic.h>
#include <cassert>
namespace ripple {
namespace Resource {
@@ -97,31 +98,31 @@ Disposition Consumer::disposition() const
Disposition Consumer::charge (Charge const& what)
{
bassert (m_entry != nullptr);
assert (m_entry != nullptr);
return m_logic->charge (*m_entry, what);
}
bool Consumer::warn ()
{
bassert (m_entry != nullptr);
assert (m_entry != nullptr);
return m_logic->warn (*m_entry);
}
bool Consumer::disconnect ()
{
bassert (m_entry != nullptr);
assert (m_entry != nullptr);
return m_logic->disconnect (*m_entry);
}
int Consumer::balance()
{
bassert (m_entry != nullptr);
assert (m_entry != nullptr);
return m_logic->balance (*m_entry);
}
Entry& Consumer::entry()
{
bassert (m_entry != nullptr);
assert (m_entry != nullptr);
return *m_entry;
}

View File

@@ -25,6 +25,7 @@
#include <ripple/resource/impl/Tuning.h>
#include <beast/chrono/abstract_clock.h>
#include <beast/intrusive/List.h>
#include <cassert>
namespace ripple {
namespace Resource {
@@ -58,7 +59,7 @@ struct Entry
case kindOutbound: return key->address.to_string();
case kindUnlimited: return std::string ("\"") + key->name + "\"";
default:
bassertfalse;
assert(false);
}
return "(undefined)";

View File

@@ -30,6 +30,7 @@
#include <beast/chrono/abstract_clock.h>
#include <beast/Insight.h>
#include <beast/utility/PropertyStream.h>
#include <cassert>
#include <mutex>
namespace ripple {
@@ -429,7 +430,7 @@ public:
admin_.iterator_to (entry));
break;
default:
bassertfalse;
assert(false);
break;
}
inactive_.push_back (entry);