Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature cleanup #83

Merged
merged 3 commits into from
Jun 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 44 additions & 2 deletions RefactoringNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
--------------------------------------------------------------------------------
TODO
--------------------------------------------------------------------------------

- Document in order:
SerializedType
STObject
SerializedLedgerEntry

- Replace uint160, uint256 in argument lists, template parameter lists, and
data members with tyepdefs from ripple_ProtocolTypes.h

--------------------------------------------------------------------------------

LoadEvent

Is referenced with both a shared pointer and an auto pointer.

JobQueue

getLoadEvent and getLoadEventAP differ only in the style of pointer
container which is returned. Unnecessary complexity.

--------------------------------------------------------------------------------

Naming

Expand All @@ -24,7 +47,7 @@ Verbose names

Ledger "Skip List"

Is not really a skip list
Is not really a skip list data structure

--------------------------------------------------------------------------------

Expand All @@ -42,10 +65,29 @@ Interfaces
would be more clear:
bool write (OutputStream& stream);


--------------------------------------------------------------------------------

Implementation

LoadManager

What is going on in the destructor

--------------------------------------------------------------------------------

boost

Unclear from the class declaration what style of shared object management
is used. Prefer to derive from a ReferenceCountedObject class so that the
behavior is explicit. Furthermore the use of intrusive containers is
preferred over the alternative.

make_shared <> () is awkward.

boost::recursive_mutex

Recursive mutexes should never be necessary.
They require the "mutable" keyword for const members to acquire the lock (yuck)

Replace recursive_mutex with juce::Mutex to remove boost dependency

5 changes: 4 additions & 1 deletion modules/ripple_basics/containers/ripple_KeyCache.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_KEYCACHE_H
#define RIPPLE_KEYCACHE_H
Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/containers/ripple_RangeSet.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

SETUP_LOG (RangeSet)

Expand Down
9 changes: 9 additions & 0 deletions modules/ripple_basics/containers/ripple_RangeSet.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_RANGESET_H
#define RIPPLE_RANGESET_H

/** A sparse set of integers.
*/
// VFALCO TODO Replace with juce::SparseSet
class RangeSet
{
public:
Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/containers/ripple_SecureAllocator.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_SECUREALLOCATOR_H
#define RIPPLE_SECUREALLOCATOR_H
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/containers/ripple_TaggedCache.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

SETUP_LOG (TaggedCacheLog)
6 changes: 6 additions & 0 deletions modules/ripple_basics/containers/ripple_TaggedCache.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_TAGGEDCACHE_H
#define RIPPLE_TAGGEDCACHE_H

Expand Down
12 changes: 0 additions & 12 deletions modules/ripple_basics/ripple_basics.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================

Expand Down
12 changes: 0 additions & 12 deletions modules/ripple_basics/ripple_basics.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================

Expand Down
5 changes: 4 additions & 1 deletion modules/ripple_basics/types/ripple_BasicTypes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_TYPES_H
#define RIPPLE_TYPES_H
Expand Down
5 changes: 4 additions & 1 deletion modules/ripple_basics/types/ripple_HashMaps.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_HASHMAPS_H
#define RIPPLE_HASHMAPS_H
Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/types/ripple_UInt256.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

std::size_t hash_value (uint256 const& u)
{
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/types/ripple_UInt256.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_ByteOrder.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifdef WIN32

//#include <windows.h>
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_ByteOrder.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_BYTEORDER_H
#define RIPPLE_BYTEORDER_H

Expand Down
6 changes: 5 additions & 1 deletion modules/ripple_basics/utility/ripple_DiffieHellmanUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

std::string DH_der_gen (int iKeyLength)
{
Expand Down
6 changes: 5 additions & 1 deletion modules/ripple_basics/utility/ripple_DiffieHellmanUtil.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_DIFFIEHELLMANUTIL_H
#define RIPPLE_DIFFIEHELLMANUTIL_H
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_HashUtilities.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_HASHUTILITIES_H
#define RIPPLE_HASHUTILITIES_H

Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/utility/ripple_InstanceCounter.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

InstanceType* InstanceType::sHeadInstance = NULL;
bool InstanceType::sMultiThreaded = false;
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_InstanceCounter.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_INSTANCECOUNTER_H
#define RIPPLE_INSTANCECOUNTER_H

Expand Down
10 changes: 8 additions & 2 deletions modules/ripple_basics/utility/ripple_IntegerTypes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ifndef INTEGERTYPES_H
#define INTEGERTYPES_H
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_INTEGERTYPES_H
#define RIPPLE_INTEGERTYPES_H

// VFALCO TODO determine if Borland C is supported
#if defined (_MSC_VER) /*|| defined(__BORLANDC__)*/
Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/utility/ripple_Log.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

boost::recursive_mutex Log::sLock;

Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_Log.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_LOG_H
#define RIPPLE_LOG_H

Expand Down
12 changes: 0 additions & 12 deletions modules/ripple_basics/utility/ripple_PlatformMacros.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================

Expand Down
12 changes: 0 additions & 12 deletions modules/ripple_basics/utility/ripple_RandomNumbers.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================

Expand Down
12 changes: 0 additions & 12 deletions modules/ripple_basics/utility/ripple_RandomNumbers.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, 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.
*/
//==============================================================================

Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_ScopedLock.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_SCOPEDLOCK_H
#define RIPPLE_SCOPEDLOCK_H

Expand Down
5 changes: 5 additions & 0 deletions modules/ripple_basics/utility/ripple_StringUtilities.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#if !defined(WIN32) && !defined(WIN64)
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
Expand Down
6 changes: 6 additions & 0 deletions modules/ripple_basics/utility/ripple_StringUtilities.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================

#ifndef RIPPLE_STRINGUTILITIES_H
#define RIPPLE_STRINGUTILITIES_H

Expand Down
Loading