Use deleted members to prevent copying in rippled (RIPD-268)

This commit is contained in:
Nik Bougalis
2014-09-20 11:27:37 -07:00
committed by Vinnie Falco
parent 01e52e6f9f
commit 7933e5d1f9
7 changed files with 29 additions and 29 deletions

View File

@@ -60,7 +60,6 @@ class SqliteStatement;
class Ledger
: public std::enable_shared_from_this <Ledger>
, public CountedObject <Ledger>
, public beast::Uncopyable
{
public:
static char const* getCountedObjectName () { return "Ledger"; }
@@ -118,6 +117,9 @@ public:
Ledger (bool dummy, Ledger & previous); // ledger after this one
Ledger (Ledger & target, bool isMutable); // snapshot
Ledger (Ledger const&) = delete;
Ledger& operator= (Ledger const&) = delete;
~Ledger ();
static Ledger::pointer getSQL (std::string const& sqlStatement);

View File

@@ -23,10 +23,12 @@
namespace ripple {
/** Holds the cryptographic credentials identifying this instance of the server. */
class LocalCredentials : public beast::Uncopyable
class LocalCredentials
{
public:
LocalCredentials ();
LocalCredentials (LocalCredentials const&) = delete;
LocalCredentials& operator= (LocalCredentials const&) = delete;
// Begin processing.
// - Maintain peer connectivity through validation and peer management.
@@ -50,17 +52,14 @@ public:
bool dataStore (std::string const& strKey, std::string const& strValue);
private:
LocalCredentials (LocalCredentials const&); // disallowed
LocalCredentials& operator= (const LocalCredentials&); // disallowed
bool nodeIdentityLoad ();
bool nodeIdentityCreate ();
bool nodeIdentityLoad ();
bool nodeIdentityCreate ();
private:
std::recursive_mutex mLock;
RippleAddress mNodePublicKey;
RippleAddress mNodePrivateKey;
RippleAddress mNodePublicKey;
RippleAddress mNodePrivateKey;
LedgerIndex mLedger; // ledger we last synched to
};

View File

@@ -31,7 +31,6 @@ class WSConnection
: public std::enable_shared_from_this <WSConnection>
, public InfoSub
, public CountedObject <WSConnection>
, public beast::Uncopyable
{
public:
static char const* getCountedObjectName () { return "WSConnection"; }
@@ -43,6 +42,9 @@ protected:
Resource::Consumer usage, InfoSub::Source& source, bool isPublic,
beast::IP::Endpoint const& remoteAddress, boost::asio::io_service& io_service);
WSConnection(WSConnection const&) = delete;
WSConnection& operator= (WSConnection const&) = delete;
virtual ~WSConnection ();
virtual void preDestroy () = 0;
@@ -69,10 +71,6 @@ protected:
bool m_receiveQueueRunning;
bool m_isDead;
boost::asio::io_service& m_io_service;
private:
WSConnection (WSConnection const&);
WSConnection& operator= (WSConnection const&);
};
//------------------------------------------------------------------------------

View File

@@ -35,7 +35,7 @@ class WSConnectionType;
struct WSServerHandlerLog;
// This tag helps with mutex tracking
struct WSServerHandlerBase : public beast::Uncopyable
struct WSServerHandlerBase
{
};
@@ -90,6 +90,9 @@ public:
{
}
WSServerHandler(WSServerHandler const&) = delete;
WSServerHandler& operator= (WSServerHandler const&) = delete;
bool getPublic ()
{
return mPublic;

View File

@@ -29,15 +29,10 @@
namespace ripple {
class CAutoBN_CTX : public beast::Uncopyable
class CAutoBN_CTX
{
protected:
BN_CTX* pctx;
CAutoBN_CTX& operator= (BN_CTX* pnew)
{
pctx = pnew;
return *this;
}
public:
CAutoBN_CTX ()
@@ -54,6 +49,9 @@ public:
BN_CTX_free (pctx);
}
CAutoBN_CTX (CAutoBN_CTX const&) = delete;
CAutoBN_CTX& operator= (CAutoBN_CTX const&) = delete;
operator BN_CTX* ()
{
return pctx;

View File

@@ -29,7 +29,6 @@ namespace TestOverlay
template <class Config>
class PeerType
: public Config
, public beast::Uncopyable
{
public:
typedef typename Config::Peer Peer;
@@ -51,6 +50,9 @@ public:
{
}
PeerType (PeerType const&) = delete;
PeerType& operator= (PeerType const&) = delete;
/** Return the pending Results data associated with this peer. */
/** @{ */
Results& results ()

View File

@@ -29,7 +29,7 @@ namespace ripple {
done by seeding the hashing function with a random number generated
at program startup.
*/
class HashMaps : public beast::Uncopyable
class HashMaps
{
public:
/** Golden ratio constant used in hashing functions.
@@ -89,13 +89,11 @@ public:
}
private:
HashMaps ()
{
}
HashMaps () = default;
~HashMaps () = default;
~HashMaps ()
{
}
HashMaps (HashMaps const&) = delete;
HashMaps& operator= (HashMaps const&) = delete;
/** Creates and holds a nonce for a type.
*/