Compare commits

...

130 Commits

Author SHA1 Message Date
Vinnie Falco
3eb1c7bd6f Set version to 0.24.0 2014-05-05 10:20:46 -07:00
Vinnie Falco
2ed2158309 Set version to 0.24.0-rc2 2014-05-02 13:01:17 -07:00
JoelKatz
112d383698 Pathfinding dispatch improvements
* Simplify decision whether to update a path
* Prevent pathfinding threads from blocking each other
2014-05-02 13:01:17 -07:00
Vinnie Falco
11d0c89a59 Set version to 0.24.0-rc1 2014-05-01 16:14:20 -07:00
JoelKatz
7cffd0e0f5 Add comments to LedgerHistory 2014-05-01 16:14:14 -07:00
JoelKatz
d1f5006e44 Validation timing fixes:
* Log whether consensus built a ledger we already had or were acquiring
* Don't trigger an acquire for a validation for a ledger we might be building
* When we finish building a ledger, try to accept that ledger
* If we cannot accept a built ledger, check held validations
* Correctly set isCurrent for untrusted validations
* Add appropriate logging

This fixes a race condition that could cause spurious and expensive
ledger fetches across the network and delayed recognition of
fully-validated ledger.
2014-05-01 16:14:09 -07:00
Vinnie Falco
a10c48182f Move .proto and generated sources 2014-05-01 09:53:42 -07:00
Howard Hinnant
b5348980e2 Improve Json::Value special members (fixes RIPD-215):
* Add move special members
* Fix Json::Value::swap
2014-04-30 13:01:00 -07:00
Nik Bougalis
73c5a867c6 Fix out-of-order initialization 2014-04-30 11:32:18 -07:00
miguelportilla
b8162884d9 Finish implementation of Ledger process/Features logic:
* Defining RIPPLE_PROPOSE_FEATURES enables ledger features
* Reduce dependence on getApp via dependency injection
* Converted uint32 members to use Clock::time_point
* Inject Journal, tidy up classes:
    - Features
    - FeaturesImpl
    - FeeVote
    - FeeVoteImpl
2014-04-28 14:54:17 -07:00
David Schwartz
ebae927a3e Allow range-based for to work on STVector256 2014-04-28 14:54:17 -07:00
David Schwartz
3dde8b4345 If RocksDB high threads are configured, use them for flushes 2014-04-28 14:54:16 -07:00
Nik Bougalis
6f6720b346 Optimize composition of HTTP/RPC reply strings 2014-04-28 14:54:16 -07:00
JoelKatz
1ba0d40bb4 Small Ledger cleanups and improvements:
* Remove call to updateHash in LedgerConsensus::accept
 * Correct serialization size in updateHash
 * Add some comments to setImmutable and setAccepted
2014-04-28 14:54:15 -07:00
Nik Bougalis
3b87b140c9 Update README.md 2014-04-28 14:54:15 -07:00
Nik Bougalis
912d74e805 Tidy up some STAmount and base_uint operations:
* Constrain use of arithmetic operators in STAmount
* Prevent constructor conversion of uint256 to uint128 - make intent clear
* Prevent implicit conversion of uint64_t to uint256
* Prevent implicit conversion of uint64_t to uint160
2014-04-28 14:54:15 -07:00
JoelKatz
6ae329f4a6 Universal flags need to be added to tfAccountSetMask 2014-04-24 20:39:16 -07:00
Tom Swirly
360db3c7ca Fix RIPD-166:
* Allow RPC commands sign and submit to sign using the regular key.
* Allow command line RPC command submit to take an "offline" flag.
* Mark SerializedObject.getFlags() as const.
2014-04-24 20:27:45 -07:00
Tom Swirly
c39fd4e64d RPC: Improve wallet_propose, deprecate wallet_seed:
* Add master_key, public_key and public_key_hex to wallet_propose's JSON response.
* Report an error if we can't understand wallet_propose's passphrase.
* Deprecate wallet_seed by adding a "deprecated" parameter directing the user to wallet_propose.
2014-04-24 10:21:55 -07:00
Nik Bougalis
f4aec40fc1 Fix display formatting of STAmount 2014-04-22 12:39:43 -07:00
Tom Swirly
7fed69fc13 Split RPCHandler into a large number of small parts:
* Handler methods of RPCHandler are extracted into individual files.
* Helper methods of RPCHandler are converted into free functions, and
  extracted into individual files.
* Much code leaves ripple_app/rpc/RPCHandler.cpp and enters ripple_rpc/.
2014-04-18 11:22:29 -07:00
Nik Bougalis
f26d95d0bb Quality tests aren't manual 2014-04-18 09:31:22 -07:00
Vinnie Falco
29ee4899bc Fix VS2013 warnings about integer conversions 2014-04-17 13:06:06 -07:00
Howard Hinnant
6596c94eb9 Refactoring of container usage:
* New ripple container aliases use hardened_hash
* Use std::tuple instead of boost::tuple
* Use std unordered containers instead of boost
* Fix Destroyer for new containers
* Fix warning for fnv1a on 32-bit arch
* Validator fixes for new containers
2014-04-16 19:00:13 -07:00
Vinnie Falco
6f8145b696 Add [max_peers] doc to example cfg 2014-04-16 12:23:26 -07:00
Miguel Portilla
65f496fefb Fix 64-bit Visual Studio build 2014-04-16 12:19:32 -07:00
Vinnie Falco
3ca8bf5f98 Remove obsolete TODO files 2014-04-16 07:48:56 -07:00
Vinnie Falco
62354350a3 Refactor ripple_overlay:
* Use rvalue move to receive accepted sockets
  * Split asio dependent APIs to their own class and file
  * Update documentation
  * Organize code into different files
  * Make some members private
  * Rename things for clarity
2014-04-16 07:48:56 -07:00
Tom Swirly
898b7eb6f0 Add CleanCCPFiles.py, a utility for tidying up whitespace 2014-04-15 11:52:02 -07:00
Nik Bougalis
398edd39f8 Add beast::tagged_integer:
* Wraps standard integer types to provide type-safety
 * Named types provide self-documenting semantics
 * Catches programmer errors involving mismatched types at compile time
 * Operators restrict mutation to only safe and meaningful operations
2014-04-15 11:48:35 -07:00
Nik Bougalis
5fddf374f4 Refactor usage of boost::format 2014-04-15 11:48:34 -07:00
Nik Bougalis
2ed8edc19d Make is_set_bit a universal template function 2014-04-15 11:40:58 -07:00
Tom Swirly
feb88c4f7f Enforce minimum version requirements on OpenSSL and Boost 2014-04-15 10:22:51 -07:00
Vinnie Falco
ebcedcbe93 Fix Visual Studio 2013 build 2014-04-15 08:13:53 -07:00
The Doctor
e3995ac776 Updated example cfg for new validator public keys.
Signed-off-by: The Doctor <drwho@virtadpt.net>
2014-04-14 18:21:06 -07:00
Tom Swirly
64ee0d07d0 New Zero struct implements "compare with zero."
* Zero lets classes efficiently compare with 0, so
  you can use constructors like x < zero or y != zero.
* New BEAST_CONSTEXPR to handle Windows/C++11 differences
  regarding the constexpr specifier.
2014-04-14 11:14:11 -07:00
Tom Ritchford
524f41177c Improvements to scons build for beast.
* Common code extracted to Python directories.
* Read ~/.scons file for scons environment defaults.
* Override scons settings with shell environment variables.
* New "tags" for debug, nodebug, optimize, nooptimize builds.
* Universal platform detection.
* Default value of environment variables set through prefix dictionaries.
* Check for correct Boost value and fail otherwise.
* Extract git describe --tags into a preprocesor variable, -DTIP_BRANCH
* More colors - blue for unchanged defaults, green for changed defaults, red for error.
* Contain unit tests for non-obvious stuff.
* Check to see that boost libraries have been built.
* Right now, we accept both .dylib and .a versions but it'd be easy to enforce .a only.
2014-04-11 10:40:26 -07:00
Vinnie Falco
04ea9ff74c New classes for processing offers in order books:
* BookTip provides consume-and-step offer traversal
* OfferStream applies offer business rules and presents offers to callers
* Taker class manages state for the active party during order processing
* Offer class wraps book offers for presentation
2014-04-10 17:49:19 -07:00
Vinnie Falco
53bf5e7f36 New classes and types for handling asset amounts:
* Quality opaque type for order book quality
  * Amount replacement for STAmount
  * Amounts, in/out amount pair for offers
  * 'core' namespace with type aliases for Ripple primitives.
2014-04-10 17:49:19 -07:00
Nik Bougalis
bd60a93cd6 Fix conversion of binary data to hexadecimal strings in some cases. 2014-04-07 14:56:37 -07:00
The Doctor
8a608b5829 Configuration file improvements:
* Set default node_db to RocksDB from HyperlevelDB, to match gateway
  appliances and Ripple Labs server configurations.
* Set some rpc_startup options to reduce logging and save disk space.
* More sensible documentation regarding WebSocket SSL directives

Signed-off-by: The Doctor <drwho@virtadpt.net>
2014-04-07 13:19:21 -07:00
David Schwartz
151388692a Add bg_threads and high_threads RocksDB tunables 2014-04-04 19:01:01 -07:00
Nik Bougalis
bec876d062 Remove unused legacy code 2014-04-04 19:00:58 -07:00
Howard Hinnant
81238e21a5 Force BOOST_ASIO_HAS_STD_ARRAY to 1
for the clang / gcc libstdc++ 4.8 combination
2014-04-03 14:58:28 -04:00
Howard Hinnant
cc354ee9f2 Sub in std::array for boost::array and beast::FixedArray 2014-04-03 14:02:34 -04:00
JoelKatz
90842073bf Must set flags before signing validation. 2014-04-02 18:39:59 -07:00
Nik Bougalis
a5488c3727 Autobridging hooks and cleanups:
- Detect when we should autobridge and get bridge books.
- Move applyOffer from STAmount into the OfferCreate transactor.
2014-04-02 18:39:59 -07:00
Nik Bougalis
166b8963bb Don't create peer doors in standalone mode 2014-04-02 14:16:24 -07:00
Nik Bougalis
c51644f1b9 More robustly validate signature inputs, closes #313 2014-04-02 14:16:07 -07:00
Vinnie Falco
f124a34730 Fix assert invariant in Peers::close_all 2014-04-01 10:24:55 -07:00
Howard Hinnant
30e882196f New hash_append robust container hash function framework:
* is_contiguous_hashable trait identifies optimizable types
* hash_append() function overloads for basic types:
  - scalars, floats
  - array, C array
  - pair, tuple
  - boost array and tuple (if configured)
* Provided Spooky hash wrapper for use with hash_append
* Use hash_append in hardened_hash and other places
* New Utility meta functions for working with variadics:
  - static_and
  - static_sum
* Added type_name utility function for diagnostics
* hash_metrics suite of functions to evalulate hash functions
* Test suites to measure hash function performance
* Various fixes
2014-03-31 15:49:23 -07:00
David Schwartz
14830c7cb4 Avoid redundant unlock 2014-03-31 09:11:52 -07:00
JoelKatz
5a21269da4 mRecentPositions must be protected by the master lock. 2014-03-28 13:45:53 -07:00
JoelKatz
cc5466d450 Reject expired transactions immediately 2014-03-28 10:33:53 -07:00
JoelKatz
a068bff9c1 Set fully-canonical flag in transactions and validations. 2014-03-28 09:34:22 -07:00
David Schwartz
1e54472a1d Clean local transaction checks. Check account field size 2014-03-25 16:20:22 -07:00
David Schwartz
be9e18ddb8 Track and re-appply LocalTransactions as needed 2014-03-25 16:20:22 -07:00
JoelKatz
5d1aec6280 Charge for pathfinding updates. 2014-03-25 16:20:22 -07:00
JoelKatz
0442b3a683 Change resource costs. 2014-03-25 16:20:22 -07:00
Vinnie Falco
bbc8a8fdc4 Move hardened_hash to container/ 2014-03-25 15:22:34 -07:00
Vinnie Falco
428872731a Add beast SConstruct and .travis.yml 2014-03-25 15:22:34 -07:00
Nik Bougalis
015d91b50d OfferCreateTransactor cleanups:
- Use std containers instead of their boost counterparts
- Reduce transactor console verbosity
- Remove unneeded parameter shadowing member variable
- Remove BOOST_FOREACH
- Add comments
- Small cleanups
2014-03-25 15:22:33 -07:00
Nik Bougalis
436061be22 Transactor journal support and small cleanups 2014-03-25 15:22:13 -07:00
Nik Bougalis
d447a1db39 Refactor ECDSA canonical checks:
* Add signature canonicalization unit tests
* Tidy up into new classes and functions
2014-03-25 15:22:13 -07:00
Luke Cyca
a4a7dd4314 Fedora RPM support:
- Add RPM spec file
- Whitelist Fedora during SConstruct
2014-03-24 14:07:36 -07:00
Roberto Catini
4886772ca3 Add Arch Linux PKGBUILD:
The install process will first fetch the tip of the master branch
to build the latest official rippled release. It will also create
all the necessary data directories in /var.

An optional systemd service definition file is included.
2014-03-24 14:07:27 -07:00
The Doctor
0f19efac2d Example configuration file update:
- Fix config database default location.
  - Add SSL/TLS for WebSockets config. Currently commented out.
2014-03-24 14:07:19 -07:00
Vinnie Falco
b2d97703c6 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
2014-03-23 15:23:55 -07:00
Vinnie Falco
936f45c7ec Add hardened_hash, prevents adversarial inputs 2014-03-22 18:42:18 -07:00
Vinnie Falco
a865149c65 New unit_test framework:
* Header-only!
* No external dependencies or other beast modules
* Compilation options allow for:
  - Stand-alone application to run a single test suite
  - Stand-alone application to run a set of test suites
  - Global suite of tests inline with the host application
  - Disable test suite generation completely
* Existing tests reworked to use the new classes
2014-03-21 18:00:37 -07:00
Vinnie Falco
547019bd1b beast.streams improvements:
* New basic_std_ostream wraps any std::stream.
* New debug_ostream redirects output to debugger if attached.
2014-03-21 07:33:16 -07:00
Vinnie Falco
953805d97e Add const_container 2014-03-21 07:33:16 -07:00
Vinnie Falco
e344cb3d62 beast cleaning and tidying:
* Consolidate small modules into one
* Remove Android-specific platform support
* Remove Chrono.h from beast_core.h
* Removed files:
  - TypeTraits.h
  - Utility.h
  - Net.h
  - Asio.h
* Remove zlib support:
  - Remove inline zlib library sources
  - Remove GZIPCompressorOutputStream
  - Remove GZIPDecompressorInputStream
* Remove obsolete or unused classes:
  - AbstractObject
  - BigInteger
  - BufferedInputStream
  - CacheLine
  - CPUMeter
  - DatagramSocket
  - DynamicObject
  - FileLogger
  - FPUFlags
  - Identifier
  - JSON
  - LocalisedStrings
  - MACAddress
  - MemoryAlignment
  - MemoryInputStream
  - MemoryMappedFile
  - NamedValueSet
  - OptionalScopedPointer
  - PerformanceCounter
  - PropertySet
  - ScopedTimeInterval
  - SparseSet
  - SpinDelay
  - StreamingSocket
  - StringPool
  - SubregionStream
  - Uuid
  - Variant
2014-03-21 07:30:50 -07:00
Vinnie Falco
693a5927a9 Update to SQLite 3.8.4.1 2014-03-20 19:17:25 -07:00
Howard Hinnant
07e2f87079 Fix and add tests for empty_base_optimization. 2014-03-20 13:47:48 -07:00
Vinnie Falco
9b152d8098 Fix error code assignment in raw_parser 2014-03-20 10:43:01 -07:00
Vinnie Falco
8daecb5430 Add abstract streams module:
* New basic_abstract_ostream template for generic output
* New abstract_ostream, common type alias
* basic_scoped_ostream, RAII output to abstract streams
2014-03-19 15:42:20 -07:00
Vinnie Falco
f1462de729 Add workaround/noexcept.h for visual studio 2014-03-19 13:42:05 -07:00
Vinnie Falco
3cb3e5273f Change to the treatment of BeastConfig.h
* No longer requires its own compiler include path
* Includes use relative paths to locate the file
* Client applications include the file themselves
* Inclusion of BeastConfig.h can be controlled via preprocessor directive
2014-03-19 13:42:04 -07:00
Howard Hinnant
cad50c68a8 General tidy and refactoring:
* Use nullptr (C++11) instead of NULL.
* Put each file into its own namespace declaration.
* Remove "using namespace" directives and add scope qualifiers.
* Control when beast's implementation of std::equal (C++14) is used.
* Tidy up some const declarations.

Conflicts:
	src/ripple_app/shamap/SHAMapSync.cpp
	src/ripple_app/tx/TransactionEngine.cpp
2014-03-19 13:42:01 -07:00
Vinnie Falco
c581ffb8a4 Restructure joyent message parser (from Node.js):
* New http::raw_parser wrapper
* Convert parser errors to error_code
* Enumeration and strings for parsed HTTP method
* Move parser engine into joyent namespace
* Rename includes to be distinct
2014-03-19 10:41:24 -07:00
Vinnie Falco
556778dbdb beast, beast::asio improvements and fixes:
* New maybe_const_t alias for maybe_const
* New asio::enable_wait_for_async for safe cleanup
* New asio::memory_buffer, a managed boost::asio compatible buffer
* shared_handler improvements:
   - Can be 'empty' (no stored handler).
   - Default constructible as 'empty'.
   - Safe evaluation in bool contexts, false==empty
* Fix is_call_possible metafunction:
   - Works on empty argument lists
   - Works with reference types
* Replace SafeBool idiom with C++11 explicit operator bool
* Move IPAddress function definitions to the header
* Move cyclic_iterator to container/
* Remove unused BufferType
* Remove obsolete classes:
   - NamedPipe
   - ReadWriteLock
   - ScopedReadLock
   - ScopedWriteLock
   - LockGuard
2014-03-17 17:40:55 -07:00
Vinnie Falco
816fab000d Fix SConstruct compiler arguments 2014-03-17 14:49:31 -07:00
Nik Bougalis
66d1dd6f81 Build system improvements:
* Reduce console verbosity.
* Display configured build environment.
* Log build environment and commands in rippled-build.log.
* When compiling under Travis:
  - define TRAVIS_CI_BUILD for C and C++ code.
  - define RIPPLE_MASTER_BUILD for builds made against
    the official Ripple repository.
2014-03-17 09:22:11 -07:00
Vinnie Falco
3eae68fc34 Remove obsolete support scripts 2014-03-15 06:07:43 -07:00
Vinnie Falco
8545aee4c7 Better diagnostics for SSL certificate failures 2014-03-14 16:20:34 -07:00
Vinnie Falco
29a4f61551 Set version to 0.23.0 2014-03-14 13:01:23 -07:00
Vinnie Falco
c2fd1215f5 Refactor beast::asio:
* New tools for completion handlers:
  - wrap_handler provides composed io_service execution guarantees.
  - bind_handler rebinds arguments to handlers.
  - shared_handler type-erases any completion handler.
  - buffer_sequence type-erases templated BufferSequences
  - abstract_socket replaces Socket
  - socket_wrapper replaces SocketWrapper
  - beast::asio placeholders to work with std::bind

* Removed obsolete classes and functions
  - AbstractHandler
  - ComposedAsyncOperation
  - SharedFunction
  - SharedHandler
  - SharedHandlerAllocator
  - SharedHandlerPtr
  - SharedHandlerType
  - SocketBase
  - SocketWrapperStrand
  - wrapHandler

* Refactored classes to use new tools
  - abstract_socket
  - socket_wrapper
  - HandshakeDetector
  - HttpClientType

* Miscellanous tidying
  - socket classes moved to beast::asio namespace
  - beast asio files provide their own namespace declaration.
  - Fix IsCallPossible conflicting template parameter name
  - Use <boost/get_pointer.hpp> for C++11 compatibility.
  - Remove extraneous include path from build environment.
2014-03-14 08:03:48 -07:00
Vinnie Falco
e3c1375f36 Add std::integer_sequence C++14 compatibility 2014-03-14 07:57:20 -07:00
Vinnie Falco
4e357601ec Move MultiSocket, RippleSSLContext to common module 2014-03-14 07:57:20 -07:00
Vinnie Falco
3674b01634 Add ripple::byte_view, ripple::const_byte_view 2014-03-14 07:57:20 -07:00
Vinnie Falco
f66aee4e7f Add beast::buffer_view 2014-03-14 07:57:19 -07:00
Vinnie Falco
b2f06dbe3c Add C++11 noexcept compatibility for VS2013 2014-03-14 07:57:19 -07:00
sublimator
b78076670e Fix typos: tecMASTER_DISABLED, tecNO_REGULAR_KEY 2014-03-14 07:57:18 -07:00
sublimator
a08a0703b6 Remove Jenkins CI build status badge
This isn't used any more is it?
2014-03-13 21:15:13 -07:00
sublimator
f80561e6aa Travis: disable gdb thread event logging
Attempt 2
2014-03-13 21:15:13 -07:00
JoelKatz
f5765b71f2 Handle unexpected relative paths from __FILE__
Fixes comref#RIPD-133
2014-03-13 16:49:20 -07:00
Vinnie Falco
6a6be847c0 Set version to 0.23.0-rc1 2014-03-12 19:05:08 -07:00
Nik Bougalis
4e26108a06 Protect callers of MultiSocket::remote_endpoint from exceptions 2014-03-12 13:51:00 -07:00
JoelKatz
c517d261bb Return a sensible error for unknown inner JSON fields 2014-03-12 00:54:00 -07:00
JoelKatz
5522a23670 Don't relay old proposals. 2014-03-11 22:21:34 -07:00
JoelKatz
64345f90a8 Allow setting LedgerConsensus to TRACE 2014-03-11 22:12:48 -07:00
JoelKatz
879c0d6b78 Be less promiscuous relaying proposals 2014-03-11 21:49:46 -07:00
Nik Bougalis
2e8df429df Expose PeerImp::start instead of requiring the use of accept/connect 2014-03-11 19:02:18 -07:00
JoelKatz
7aa1222310 Fix the "peer action" transition from syncing to full 2014-03-11 19:02:18 -07:00
JoelKatz
2b5142ee4d Make transaction forwarding less promiscuous 2014-03-11 19:02:17 -07:00
Nik Bougalis
e8d7d339ef Transactor refactoring:
- Reorganize transactor source files and VS project
- Don't expose Transactor interfaces to anyone but the TransactionEngine
- Improve compile times
- Begin using Journal
2014-03-11 19:02:17 -07:00
Nik Bougalis
5324a6d59d Don't create a Transactor if we don't have a valid TxID 2014-03-11 19:02:17 -07:00
Nik Bougalis
569b3a46a1 Cleanups:
- Cleanup VotableInteger class and remove unused duplicate
 - Remove obsolete function and move to std functions
 - Fix typos
 - Make isMemoOkay a free function
 - Sanitize error returns
2014-03-11 19:02:17 -07:00
JoelKatz
fc129e43fd Cleanup handling of expired offers 2014-03-11 19:02:16 -07:00
JoelKatz
b22a0f4a97 Ensure offer cleanup is deterministic 2014-03-11 19:02:16 -07:00
JoelKatz
cf63b5c859 Fix logging transactions that throw 2014-03-11 19:02:16 -07:00
David Schwartz
b4593a274d Limit how many reads we defer to avoid overflowing the cache 2014-03-11 19:02:16 -07:00
David Schwartz
163daf012a Add 'MemoData' field 2014-03-11 19:02:16 -07:00
JoelKatz
63df034bcf Clean up job renaming 2014-03-11 19:02:16 -07:00
David Schwartz
60787be80c Check the node store for transaction nodes with metadata 2014-03-11 19:02:15 -07:00
David Schwartz
f42ae3af21 Add ledger_data command to get full ledgers in pieces 2014-03-11 19:02:15 -07:00
David Schwartz
b1fea3c51e Disable retrieving full state trees for non-admins. 2014-03-11 19:02:15 -07:00
David Schwartz
16d2bbd6e5 Avoid disk I/O when data 'moves' in a SHAMap 2014-03-11 19:02:15 -07:00
David Schwartz
2505a908c5 Logging reduction in PeerImp 2014-03-11 19:02:15 -07:00
Nik Bougalis
4b71673ee9 Improve validation of JSON inputs 2014-03-11 19:02:14 -07:00
Nik Bougalis
242494a9ad Allow a server to keep no ledger history, closes #299 2014-03-11 19:02:14 -07:00
Nik Bougalis
3a684ce280 Robust HashPrefix initialization, closes #300 2014-03-11 19:02:14 -07:00
Nik Bougalis
756da7b844 Fix strUnHex parsing of odd-length strings and add unit tests 2014-03-11 19:02:14 -07:00
Nik Bougalis
9c465487ae Cache the result of remote_endpoint at connect/accept time and use it 2014-03-11 19:02:14 -07:00
Donovan Hide
e8002a7a62 Fix ledger log warning, closes #298 2014-03-11 19:02:13 -07:00
Nik Bougalis
5a53b48026 Require a C++11 conforming compiler 2014-03-11 19:02:13 -07:00
Vinnie Falco
b3f725d9fd Update http code for http parser API changes 2014-03-06 21:44:29 -08:00
Vinnie Falco
50f5d5bdf3 Merge commit '6c0edd2190bfd18ffc523f486367da3724cf98a3' into develop 2014-03-06 21:22:22 -08:00
Vinnie Falco
6c0edd2190 Squashed 'src/beast/beast/http/impl/http-parser/' changes from 547553b..cba704c
cba704c Bump version to 2.2.1
a252d4e fix content-length and chunk-size overflow test
42d6541 add vc project files to .gitignore
fd609ab Bump version to 2.2
efcf75d test: better fix for __APPLE__ test build
9ca484d test: fix build on osx
d7b938b Parse and emit status message of response
11419c8 Use unsigned int as bitfield type.
c4079e7 Add syntax highlighting to README C code
f5c779b Update misleading comment.
3cbd13d test: add amazon.com response test

git-subtree-dir: src/beast/beast/http/impl/http-parser
git-subtree-split: cba704cb2d9f1df80994dd4a791a0fa6cce65720
2014-03-06 21:22:22 -08:00
1221 changed files with 54702 additions and 68860 deletions

3
.gitignore vendored
View File

@@ -72,3 +72,6 @@ My Amplifier XE Results - RippleD
# Compiler intermediate output
/out.txt
# Build Log
rippled-build.log

View File

@@ -41,7 +41,7 @@ script:
echo "run" >> script.gdb
echo "backtrace full" >> script.gdb
# gdb --help
- cat script.gdb | gdb --return-child-result --args ./build/rippled --unittest
- cat script.gdb | gdb --ex 'set print thread-events off' --return-child-result --args ./build/rippled --unittest
# Run integration tests
- npm install
- npm test

41
Builds/ArchLinux/PKGBUILD Normal file
View File

@@ -0,0 +1,41 @@
# Maintainer: Roberto Catini <roberto.catini@gmail.com>
pkgname=rippled
pkgrel=1
pkgver=0
pkgdesc="Ripple peer-to-peer network daemon"
arch=('i686' 'x86_64')
url="https://github.com/ripple/rippled"
license=('custom:ISC')
depends=('protobuf' 'openssl' 'boost-libs')
makedepends=('git' 'scons' 'boost')
checkdepends=('nodejs')
backup=("etc/$pkgname/rippled.cfg")
source=("git://github.com/ripple/rippled.git#branch=master")
sha512sums=('SKIP')
pkgver() {
cd "$srcdir/$pkgname"
git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}
build() {
cd "$srcdir/$pkgname"
scons build/rippled
}
check() {
cd "$srcdir/$pkgname"
npm install
npm test
build/rippled --unittest
}
package() {
cd "$srcdir/$pkgname"
install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -D build/rippled "$pkgdir/usr/bin/rippled"
install -D -m644 doc/rippled-example.cfg "$pkgdir/etc/$pkgname/rippled.cfg"
mkdir -p "$pkgdir/var/lib/$pkgname/db"
mkdir -p "$pkgdir/var/log/$pkgname"
}

View File

@@ -45,7 +45,6 @@ linux-g++:QMAKE_CXXFLAGS += \
-pthread
INCLUDEPATH += \
"../../src" \
"../../src/leveldb/" \
"../../src/leveldb/port" \
"../../src/leveldb/include" \

View File

@@ -14,13 +14,15 @@
<PreprocessorDefinitions>_VARIADIC_MAX=10;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>$(RepoDir)\src\protobuf\src;$(RepoDir)\src\protobuf\vsprojects;$(RepoDir)\src;$(RepoDir)\src\leveldb;$(RepoDir)\src\leveldb\include;$(RepoDir)\build\proto;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(RepoDir)\src\protobuf\src;$(RepoDir)\src\protobuf\vsprojects;$(RepoDir)\src\leveldb;$(RepoDir)\src\leveldb\include;$(RepoDir)\build\proto;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<ExceptionHandling>Async</ExceptionHandling>
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SpecifySectionAttributes>
</SpecifySectionAttributes>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@@ -19,16 +19,15 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\build\proto\ripple.pb.cc" />
<ClCompile Include="..\..\src\ripple\beast\ripple_beast.cpp" />
<ClCompile Include="..\..\src\ripple\beast\ripple_beastc.c" />
<ClCompile Include="..\..\src\ripple\common\impl\counted_bind.cpp">
<ClCompile Include="..\..\src\ripple\common\impl\KeyCache.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\KeyCache.cpp">
<ClCompile Include="..\..\src\ripple\common\impl\MultiSocket.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -40,6 +39,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\TaggedCache.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -182,6 +187,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\proto\ripple.pb.cc" />
<ClCompile Include="..\..\src\ripple\radmap\impl\BasicFullBelowCache.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -690,6 +696,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\HashUtilities.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -808,6 +820,18 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\validators\ripple_validators.cpp" />
<ClCompile Include="..\..\src\ripple_app\book\tests\OfferStream.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\book\tests\Quality.test.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\consensus\DisputedTx.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1006,7 +1030,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\main\RippleMain.cpp">
<ClCompile Include="..\..\src\ripple_app\main\Main.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -1048,13 +1072,13 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\Features.cpp">
<ClCompile Include="..\..\src\ripple_app\misc\FeaturesImpl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\FeeVote.cpp">
<ClCompile Include="..\..\src\ripple_app\misc\FeeVoteImpl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -1223,6 +1247,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\ripple_app_pt9.cpp" />
<ClCompile Include="..\..\src\ripple_app\rpc\RPCServerHandler.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1295,43 +1320,61 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\AccountSetTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\AccountSetTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\ChangeTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\ChangeTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\OfferCancelTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\OfferCreateTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\PaymentTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\PaymentTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
<ClCompile Include="..\..\src\ripple_app\transactors\Transactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\TrustSetTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\WalletAddTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\LocalTxs.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -1343,6 +1386,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionCheck.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1373,30 +1422,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\Transactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TrustSetTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TxQueueEntry.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\WalletAddTransactor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\websocket\WSConnection.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1693,6 +1724,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_data\protocol\HashPrefix.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_data\protocol\LedgerFormats.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1762,12 +1799,6 @@
<ClCompile Include="..\..\src\ripple_data\ripple_data.cpp" />
<ClCompile Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.cpp" />
<ClCompile Include="..\..\src\ripple_leveldb\ripple_leveldb.cpp" />
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\HTTPRequest.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1780,12 +1811,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\MultiSocket.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\RPCDoor.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1831,7 +1856,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\PackedMessage.cpp">
<ClCompile Include="..\..\src\ripple_overlay\impl\Message.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -1843,13 +1868,385 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\Peers.cpp">
<ClCompile Include="..\..\src\ripple_overlay\impl\OverlayImpl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\ripple_overlay.cpp" />
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountCurrencies.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountLines.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountOffers.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTx.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTxOld.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTxSwitch.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\BlackList.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\BookOffers.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Connect.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ConsensusInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Feature.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\FetchInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\GetCounts.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Ledger.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerAccept.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerCleaner.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerClosed.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerCurrent.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerData.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerEntry.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerHeader.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LogLevel.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LogRotate.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\NicknameInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\OwnerInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\PathFind.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Peers.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Ping.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Print.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Profile.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofCreate.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofSolve.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofVerify.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Random.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\RipplePathFind.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ServerInfo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ServerState.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Sign.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\SMS.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Stop.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Submit.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Subscribe.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\TransactionEntry.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Tx.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\TxHistory.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlAdd.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlDelete.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlList.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlLoad.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlNetwork.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlReset.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlScore.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Unsubscribe.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ValidationCreate.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ValidationSeed.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletAccounts.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletPropose.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletSeed.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\AccountFromString.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Accounts.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Authorize.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\DoPrint.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1862,12 +2259,48 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\GetMasterGenerator.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Handlers.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\LegacyPathFind.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\LookupLedger.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Manager.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\ParseAccountIds.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\TransactionSign.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\ripple_rpc.cpp" />
<ClCompile Include="..\..\src\ripple_websocket\autosocket\AutoSocket.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
@@ -2227,14 +2660,19 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\BeastConfig.h" />
<ClInclude Include="..\..\src\ripple\algorithm\api\CycledSet.h" />
<ClInclude Include="..\..\src\ripple\algorithm\api\DecayingSample.h" />
<ClInclude Include="..\..\src\ripple\common\counted_bind.h" />
<ClInclude Include="..\..\src\ripple\common\byte_view.h" />
<ClInclude Include="..\..\src\ripple\common\impl\MultiSocketType.h" />
<ClInclude Include="..\..\src\ripple\common\KeyCache.h" />
<ClInclude Include="..\..\src\ripple\common\MultiSocket.h" />
<ClInclude Include="..\..\src\ripple\common\Resolver.h" />
<ClInclude Include="..\..\src\ripple\common\ResolverAsio.h" />
<ClInclude Include="..\..\src\ripple\common\RippleSSLContext.h" />
<ClInclude Include="..\..\src\ripple\common\seconds_clock.h" />
<ClInclude Include="..\..\src\ripple\common\TaggedCache.h" />
<ClInclude Include="..\..\src\ripple\common\UnorderedMap.h" />
<ClInclude Include="..\..\src\ripple\http\api\Handler.h" />
<ClInclude Include="..\..\src\ripple\http\api\Server.h" />
<ClInclude Include="..\..\src\ripple\http\api\Port.h" />
@@ -2289,6 +2727,7 @@
<ClInclude Include="..\..\src\ripple\peerfinder\sim\Predicates.h" />
<ClInclude Include="..\..\src\ripple\peerfinder\sim\sync_timer.h" />
<ClInclude Include="..\..\src\ripple\peerfinder\sim\WrappedSink.h" />
<ClInclude Include="..\..\src\ripple\proto\ripple.pb.h" />
<ClInclude Include="..\..\src\ripple\radmap\api\BasicFullBelowCache.h" />
<ClInclude Include="..\..\src\ripple\radmap\api\Tuning.h" />
<ClInclude Include="..\..\src\ripple\radmap\ripple_radmap.h" />
@@ -2462,6 +2901,14 @@
<ClInclude Include="..\..\src\ripple\validators\impl\Validation.h" />
<ClInclude Include="..\..\src\ripple\validators\impl\Validator.h" />
<ClInclude Include="..\..\src\ripple\validators\ripple_validators.h" />
<ClInclude Include="..\..\src\ripple_app\book\Amount.h" />
<ClInclude Include="..\..\src\ripple_app\book\Amounts.h" />
<ClInclude Include="..\..\src\ripple_app\book\BookTip.h" />
<ClInclude Include="..\..\src\ripple_app\book\Offer.h" />
<ClInclude Include="..\..\src\ripple_app\book\OfferStream.h" />
<ClInclude Include="..\..\src\ripple_app\book\Quality.h" />
<ClInclude Include="..\..\src\ripple_app\book\Taker.h" />
<ClInclude Include="..\..\src\ripple_app\book\Types.h" />
<ClInclude Include="..\..\src\ripple_app\consensus\DisputedTx.h" />
<ClInclude Include="..\..\src\ripple_app\consensus\LedgerConsensus.h" />
<ClInclude Include="..\..\src\ripple_app\contracts\Contract.h" />
@@ -2497,7 +2944,6 @@
<ClInclude Include="..\..\src\ripple_app\main\FatalErrorReporter.h" />
<ClInclude Include="..\..\src\ripple_app\main\LoadManager.h" />
<ClInclude Include="..\..\src\ripple_app\main\LocalCredentials.h" />
<ClInclude Include="..\..\src\ripple_app\main\RippleMain.h" />
<ClInclude Include="..\..\src\ripple_app\main\RPCHTTPServer.h" />
<ClInclude Include="..\..\src\ripple_app\main\Tuning.h" />
<ClInclude Include="..\..\src\ripple_app\misc\NetworkOPs.h" />
@@ -2506,8 +2952,8 @@
<ClInclude Include="..\..\src\ripple_app\misc\AccountItems.h" />
<ClInclude Include="..\..\src\ripple_app\misc\AccountState.h" />
<ClInclude Include="..\..\src\ripple_app\misc\CanonicalTXSet.h" />
<ClInclude Include="..\..\src\ripple_app\misc\IFeatures.h" />
<ClInclude Include="..\..\src\ripple_app\misc\IFeeVote.h" />
<ClInclude Include="..\..\src\ripple_app\misc\FeatureTable.h" />
<ClInclude Include="..\..\src\ripple_app\misc\FeeVote.h" />
<ClInclude Include="..\..\src\ripple_app\misc\IHashRouter.h" />
<ClInclude Include="..\..\src\ripple_app\misc\ProofOfWorkFactory.h" />
<ClInclude Include="..\..\src\ripple_app\misc\NicknameState.h" />
@@ -2540,22 +2986,23 @@
<ClInclude Include="..\..\src\ripple_app\shamap\SHAMapSyncFilters.h" />
<ClInclude Include="..\..\src\ripple_app\shamap\RadixMapTest.h" />
<ClInclude Include="..\..\src\ripple_app\shamap\SHAMapTreeNode.h" />
<ClInclude Include="..\..\src\ripple_app\tx\AccountSetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\ChangeTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\OfferCancelTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\OfferCreateTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\PaymentTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\AccountSetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\ChangeTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\PaymentTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\Transactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\TrustSetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\transactors\WalletAddTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\LocalTxs.h" />
<ClInclude Include="..\..\src\ripple_app\tx\Transaction.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TransactionEngine.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMaster.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMeta.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TxQueue.h" />
<ClInclude Include="..\..\src\ripple_app\tx\Transactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TrustSetTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\tx\TxQueueEntry.h" />
<ClInclude Include="..\..\src\ripple_app\tx\WalletAddTransactor.h" />
<ClInclude Include="..\..\src\ripple_app\websocket\WSConnection.h" />
<ClInclude Include="..\..\src\ripple_app\websocket\WSDoor.h" />
<ClInclude Include="..\..\src\ripple_app\websocket\WSServerHandler.h" />
@@ -2580,6 +3027,9 @@
<ClInclude Include="..\..\src\ripple_basics\utility\UptimeTimer.h" />
<ClInclude Include="..\..\src\ripple_core\functional\Config.h" />
<ClInclude Include="..\..\src\ripple_core\functional\ConfigSections.h" />
<ClInclude Include="..\..\src\ripple_core\functional\JobTypeData.h" />
<ClInclude Include="..\..\src\ripple_core\functional\JobTypeInfo.h" />
<ClInclude Include="..\..\src\ripple_core\functional\JobTypes.h" />
<ClInclude Include="..\..\src\ripple_core\functional\LoadFeeTrack.h" />
<ClInclude Include="..\..\src\ripple_core\functional\Job.h" />
<ClInclude Include="..\..\src\ripple_core\functional\JobQueue.h" />
@@ -2633,12 +3083,9 @@
<ClInclude Include="..\..\src\ripple_data\utility\UptimeTimerAdapter.h" />
<ClInclude Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.h" />
<ClInclude Include="..\..\src\ripple_leveldb\ripple_leveldb.h" />
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h" />
<ClInclude Include="..\..\src\ripple_net\basics\impl\RPCServerImp.h" />
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h" />
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h" />
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h" />
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h" />
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h" />
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h" />
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h" />
@@ -2648,20 +3095,30 @@
<ClInclude Include="..\..\src\ripple_net\rpc\RPCErr.h" />
<ClInclude Include="..\..\src\ripple_net\rpc\RPCSub.h" />
<ClInclude Include="..\..\src\ripple_net\rpc\RPCUtil.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\PackedMessage.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\make_Overlay.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\Message.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\Peer.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\Peers.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\Overlay.h" />
<ClInclude Include="..\..\src\ripple_overlay\api\predicates.h" />
<ClInclude Include="..\..\src\ripple_overlay\impl\MessageStream.h" />
<ClInclude Include="..\..\src\ripple_overlay\impl\OverlayImpl.h" />
<ClInclude Include="..\..\src\ripple_overlay\impl\PeerDoor.h" />
<ClInclude Include="..\..\src\ripple_overlay\impl\PeerImp.h" />
<ClInclude Include="..\..\src\ripple_overlay\ripple_overlay.h" />
<ClInclude Include="..\..\src\ripple_rpc\api\ErrorCodes.h" />
<ClInclude Include="..\..\src\ripple_rpc\api\Manager.h" />
<ClInclude Include="..\..\src\ripple_rpc\api\Request.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\AccountFromString.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\Accounts.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\Authorize.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\Command.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\GetMasterGenerator.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\LegacyPathFind.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\LookupLedger.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\ParseAccountIds.h" />
<ClInclude Include="..\..\src\ripple_rpc\impl\TransactionSign.h" />
<ClInclude Include="..\..\src\ripple_rpc\ripple_rpc.h" />
<ClInclude Include="..\..\src\ripple_websocket\autosocket\AutoSocket.h" />
<ClInclude Include="..\..\src\ripple_websocket\ripple_websocket.h" />
<ClInclude Include="..\..\src\BeastConfig.h" />
<ClInclude Include="..\..\src\leveldb\db\builder.h" />
<ClInclude Include="..\..\src\leveldb\db\dbformat.h" />
<ClInclude Include="..\..\src\leveldb\db\db_impl.h" />
@@ -2736,17 +3193,6 @@
<ItemGroup>
<None Include="..\..\doc\CheatSheet.md" />
<None Include="..\..\doc\CodingStyle.md" />
<CustomBuild Include="..\..\src\ripple_data\protocol\ripple.proto">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">protoc --cpp_out=$(RepoDir)\build\proto -I=$(RepoDir)\src\ripple_data\protocol\ "$(RepoDir)\src\ripple_data\protocol\%(Filename)%(Extension)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">protoc --cpp_out=$(RepoDir)\build\proto -I=$(RepoDir)\src\ripple_data\protocol\ "$(RepoDir)\src\ripple_data\protocol\%(Filename)%(Extension)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">protoc --cpp_out=$(RepoDir)\build\proto -I=$(RepoDir)\src\ripple_data\protocol\ "$(RepoDir)\src\ripple_data\protocol\%(Filename)%(Extension)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">protoc --cpp_out=$(RepoDir)\build\proto -I=$(RepoDir)\src\ripple_data\protocol\ "$(RepoDir)\src\ripple_data\protocol\%(Filename)%(Extension)"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc</Outputs>
</CustomBuild>
<None Include="..\..\doc\Doxyfile" />
<None Include="..\..\doc\rippled-example.cfg" />
<None Include="..\..\LICENSE" />
@@ -2771,6 +3217,22 @@
<None Include="..\..\src\ripple\json\TODO.md" />
<None Include="..\..\src\ripple\peerfinder\README.md" />
<None Include="..\..\src\ripple\peerfinder\TODO.md" />
<CustomBuild Include="..\..\src\ripple\proto\ripple.proto">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(RelativeDir)%(Filename).pb.h;%(RelativeDir)%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(RelativeDir)%(Filename).pb.h;%(RelativeDir)%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(RelativeDir)%(Filename).pb.h;%(RelativeDir)%(Filename).pb.cc</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(RelativeDir)%(Filename).pb.h;%(RelativeDir)%(Filename).pb.cc</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">protoc --cpp_out=%(RelativeDir) --proto_path=%(RelativeDir) %(Identity)</Message>
</CustomBuild>
<None Include="..\..\src\ripple\radmap\README.md" />
<None Include="..\..\src\ripple\radmap\TODO.md" />
<None Include="..\..\src\ripple\resource\README.md" />
@@ -2793,10 +3255,6 @@
<None Include="..\..\src\ripple_rpc\TODO.md" />
<None Include="..\QtCreator\rippled.pro" />
</ItemGroup>
<ItemGroup>
<Text Include="..\..\doc\todo\NIKB_TODO.txt" />
<Text Include="..\..\doc\todo\VFALCO_TODO.txt" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B7F39ECD-473C-484D-BC34-31F8362506A5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
@@ -2834,20 +3292,24 @@
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="Common.props" />
<Import Project="Win32.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="RippleD.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="Common.props" />
<Import Project="x64.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="RippleD.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="Common.props" />
<Import Project="Win32.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="RippleD.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="Common.props" />
<Import Project="x64.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="RippleD.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -2892,6 +3354,7 @@
<FunctionLevelLinking>false</FunctionLevelLinking>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@@ -316,6 +316,24 @@
<Filter Include="[2] Old Ripple\ripple_overlay\impl">
<UniqueIdentifier>{0ff855ac-5038-4b16-a324-ba85d782c0e2}</UniqueIdentifier>
</Filter>
<Filter Include="[2] Old Ripple\ripple_app\transactors">
<UniqueIdentifier>{dcb7c75c-4f1d-486c-8079-52dc43644ae6}</UniqueIdentifier>
</Filter>
<Filter Include="[1] Ripple\common\tests">
<UniqueIdentifier>{1aa56407-a927-42be-862b-cd5324b4d63b}</UniqueIdentifier>
</Filter>
<Filter Include="[2] Old Ripple\ripple_app\book">
<UniqueIdentifier>{56248509-436d-4034-ab4e-64afbb532418}</UniqueIdentifier>
</Filter>
<Filter Include="[2] Old Ripple\ripple_app\book\tests">
<UniqueIdentifier>{28b72c9f-02e3-4b57-9386-957478e1f0b7}</UniqueIdentifier>
</Filter>
<Filter Include="[2] Old Ripple\ripple_rpc\handlers">
<UniqueIdentifier>{f8e935e2-e54d-4681-9e7d-7e4a01192d6b}</UniqueIdentifier>
</Filter>
<Filter Include="[1] Ripple\proto">
<UniqueIdentifier>{ae6e40a1-a2ff-4a9e-b510-92192b96db44}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\ripple_basics\containers\RangeSet.cpp">
@@ -663,12 +681,6 @@
<ClCompile Include="..\..\src\ripple_app\misc\CanonicalTXSet.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\Features.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\FeeVote.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\HashRouter.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
@@ -747,54 +759,6 @@
<ClCompile Include="..\..\src\ripple_app\consensus\DisputedTx.cpp">
<Filter>[2] Old Ripple\ripple_app\consensus</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\AccountSetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\ChangeTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\OfferCancelTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\OfferCreateTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\PaymentTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\Transaction.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionCheck.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionEngine.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionMaster.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionMeta.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\Transactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TrustSetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\WalletAddTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\main\RippleMain.cpp">
<Filter>[2] Old Ripple\ripple_app\main</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\websocket\WSConnection.cpp">
<Filter>[2] Old Ripple\ripple_app\websocket</Filter>
</ClCompile>
@@ -807,18 +771,12 @@
<ClCompile Include="..\..\src\ripple_data\protocol\BuildInfo.cpp">
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\HTTPRequest.cpp">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\HTTPClient.cpp">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\MultiSocket.cpp">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_net\basics\SNTPClient.cpp">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClCompile>
@@ -849,12 +807,6 @@
<ClCompile Include="..\..\src\ripple_app\misc\ProofOfWork.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TxQueue.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TxQueueEntry.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\protobuf_core.cpp">
<Filter>[0] Libraries\protobuf</Filter>
</ClCompile>
@@ -927,9 +879,6 @@
<ClCompile Include="..\..\src\ripple_app\ripple_app_pt8.cpp">
<Filter>[2] Old Ripple\ripple_app</Filter>
</ClCompile>
<ClCompile Include="..\..\build\proto\ripple.pb.cc">
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_basics\ripple_basics.cpp">
<Filter>[2] Old Ripple\ripple_basics</Filter>
</ClCompile>
@@ -1410,9 +1359,6 @@
<ClCompile Include="..\..\src\ripple\radmap\impl\BasicFullBelowCache.cpp">
<Filter>[1] Ripple\radmap\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\counted_bind.cpp">
<Filter>[1] Ripple\common\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\KeyCache.cpp">
<Filter>[1] Ripple\common\impl</Filter>
</ClCompile>
@@ -1464,12 +1410,6 @@
<ClCompile Include="..\..\src\ripple_overlay\impl\PeerDoor.cpp">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\Peers.cpp">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\PackedMessage.cpp">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\ripple_overlay.cpp">
<Filter>[2] Old Ripple\ripple_overlay</Filter>
</ClCompile>
@@ -1488,6 +1428,303 @@
<ClCompile Include="..\..\src\ripple\peerfinder\impl\SlotImp.cpp">
<Filter>[1] Ripple\peerfinder\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\ripple_app_pt9.cpp">
<Filter>[2] Old Ripple\ripple_app</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\Transaction.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionAcquire.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionCheck.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionEngine.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionMaster.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TransactionMeta.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TxQueue.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\TxQueueEntry.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\AccountSetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\ChangeTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\PaymentTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\Transactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\TrustSetTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\transactors\WalletAddTransactor.cpp">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\MultiSocket.cpp">
<Filter>[1] Ripple\common\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
<Filter>[1] Ripple\common\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<Filter>[1] Ripple\sslutil\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_data\protocol\HashPrefix.cpp">
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\main\Main.cpp">
<Filter>[2] Old Ripple\ripple_app\main</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\tx\LocalTxs.cpp">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\book\tests\Quality.test.cpp">
<Filter>[2] Old Ripple\ripple_app\book\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\book\tests\OfferStream.test.cpp">
<Filter>[2] Old Ripple\ripple_app\book\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\Message.cpp">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_overlay\impl\OverlayImpl.cpp">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ConsensusInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Feature.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\FetchInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\GetCounts.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Ledger.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerAccept.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerCleaner.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerClosed.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerCurrent.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerData.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerEntry.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LedgerHeader.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LogLevel.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\LogRotate.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\NicknameInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\OwnerInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\PathFind.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Peers.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Ping.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Print.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Profile.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofCreate.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofSolve.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ProofVerify.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Random.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\RipplePathFind.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ServerInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ServerState.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Sign.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\SMS.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Stop.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Submit.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Subscribe.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\TransactionEntry.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Tx.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\TxHistory.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlAdd.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlDelete.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlList.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlLoad.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlNetwork.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlReset.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\UnlScore.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Unsubscribe.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ValidationCreate.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\ValidationSeed.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletAccounts.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletPropose.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\WalletSeed.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountCurrencies.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountInfo.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountLines.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountOffers.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTx.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTxOld.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\AccountTxSwitch.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\BlackList.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\BookOffers.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\handlers\Connect.cpp">
<Filter>[2] Old Ripple\ripple_rpc\handlers</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\ParseAccountIds.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\TransactionSign.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\AccountFromString.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Accounts.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Authorize.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\GetMasterGenerator.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\Handlers.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\LegacyPathFind.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_rpc\impl\LookupLedger.cpp">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\FeaturesImpl.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple_app\misc\FeeVoteImpl.cpp">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ripple\proto\ripple.pb.cc">
<Filter>[1] Ripple\proto</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">
@@ -1892,12 +2129,6 @@
<ClInclude Include="..\..\src\ripple_app\misc\CanonicalTXSet.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\IFeatures.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\IFeeVote.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\IHashRouter.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
@@ -1973,51 +2204,6 @@
<ClInclude Include="..\..\src\ripple_app\consensus\LedgerConsensus.h">
<Filter>[2] Old Ripple\ripple_app\consensus</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\AccountSetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\ChangeTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\OfferCancelTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\OfferCreateTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\PaymentTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\RegularKeySetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\Transaction.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionEngine.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMaster.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMeta.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\Transactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TrustSetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\WalletAddTransactor.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\main\RippleMain.h">
<Filter>[2] Old Ripple\ripple_app\main</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\websocket\WSConnection.h">
<Filter>[2] Old Ripple\ripple_app\websocket</Filter>
</ClInclude>
@@ -2033,27 +2219,18 @@
<ClInclude Include="..\..\src\ripple_data\protocol\BuildInfo.h">
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h">
<Filter>[2] Old Ripple\ripple_net\basics\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h">
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
</ClInclude>
@@ -2063,27 +2240,18 @@
<ClInclude Include="..\..\src\ripple_data\protocol\BuildInfo.h">
<Filter>[1] Ripple\ripple_data\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\HTTPRequest.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\HTTPClient.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\MultiSocket.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RPCServer.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\SNTPClient.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h">
<Filter>[1] Ripple\ripple_net\basics\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_net\basics\RPCDoor.h">
<Filter>[1] Ripple\ripple_net\basics</Filter>
</ClInclude>
@@ -2120,16 +2288,9 @@
<ClInclude Include="..\..\src\ripple_app\misc\ProofOfWorkFactory.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TxQueue.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TxQueueEntry.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\Validations.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\BeastConfig.h" />
<ClInclude Include="..\..\src\ripple_core\functional\Config.h">
<Filter>[2] Old Ripple\ripple_core\functional</Filter>
</ClInclude>
@@ -2892,9 +3053,6 @@
<ClInclude Include="..\..\src\ripple\radmap\api\Tuning.h">
<Filter>[1] Ripple\radmap\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\counted_bind.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\KeyCache.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
@@ -3027,15 +3185,6 @@
<ClInclude Include="..\..\src\ripple_overlay\api\Peer.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\Peers.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\PackedMessage.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\ripple_overlay.h">
<Filter>[2] Old Ripple\ripple_overlay</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\peerfinder\impl\handout.h">
<Filter>[1] Ripple\peerfinder\impl</Filter>
</ClInclude>
@@ -3051,11 +3200,157 @@
<ClInclude Include="..\..\src\ripple\peerfinder\impl\StoreSqdb.h">
<Filter>[1] Ripple\peerfinder\impl</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\..\src\ripple_data\protocol\ripple.proto">
<Filter>[2] Old Ripple\ripple_data\protocol</Filter>
</CustomBuild>
<ClInclude Include="..\..\src\ripple_app\tx\Transaction.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionAcquire.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionEngine.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMaster.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TransactionMeta.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TxQueue.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\TxQueueEntry.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\AccountSetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\ChangeTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCancelTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\OfferCreateTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\PaymentTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\RegularKeySetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\Transactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\TrustSetTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\transactors\WalletAddTransactor.h">
<Filter>[2] Old Ripple\ripple_app\transactors</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\impl\MultiSocketType.h">
<Filter>[1] Ripple\common\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\MultiSocket.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\RippleSSLContext.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\byte_view.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\BeastConfig.h" />
<ClInclude Include="..\..\src\ripple_core\functional\JobTypeData.h">
<Filter>[2] Old Ripple\ripple_core\functional</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_core\functional\JobTypeInfo.h">
<Filter>[2] Old Ripple\ripple_core\functional</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_core\functional\JobTypes.h">
<Filter>[2] Old Ripple\ripple_core\functional</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\tx\LocalTxs.h">
<Filter>[2] Old Ripple\ripple_app\tx</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Amount.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Amounts.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Quality.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Types.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\OfferStream.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Taker.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\BookTip.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\book\Offer.h">
<Filter>[2] Old Ripple\ripple_app\book</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\make_Overlay.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\impl\OverlayImpl.h">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\predicates.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\impl\MessageStream.h">
<Filter>[2] Old Ripple\ripple_overlay\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\Message.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_overlay\api\Overlay.h">
<Filter>[2] Old Ripple\ripple_overlay\api</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\common\UnorderedMap.h">
<Filter>[1] Ripple\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\LookupLedger.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\ParseAccountIds.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\TransactionSign.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\AccountFromString.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\Accounts.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\Authorize.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\GetMasterGenerator.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_rpc\impl\LegacyPathFind.h">
<Filter>[2] Old Ripple\ripple_rpc\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\FeeVote.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple_app\misc\FeatureTable.h">
<Filter>[2] Old Ripple\ripple_app\misc</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ripple\proto\ripple.pb.h">
<Filter>[1] Ripple\proto</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\doc\CheatSheet.md">
@@ -3180,11 +3475,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\doc\todo\NIKB_TODO.txt">
<Filter>%28Notes%29</Filter>
</Text>
<Text Include="..\..\doc\todo\VFALCO_TODO.txt">
<Filter>%28Notes%29</Filter>
</Text>
<CustomBuild Include="..\..\src\ripple\proto\ripple.proto">
<Filter>[1] Ripple\proto</Filter>
</CustomBuild>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup />
</Project>

View File

@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "beast", "..\..\src\beast\Builds\VisualStudio2013\beast.vcxproj", "{73C5A0F0-7629-4DE7-9194-BE7AC6C19535}"

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4018;4244;4267</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

53
Builds/rpm/rippled.spec Normal file
View File

@@ -0,0 +1,53 @@
Name: rippled
Version: 0.23.0
Release: 1%{?dist}
Summary: Ripple peer-to-peer network daemon
Group: Applications/Internet
License: ISC
URL: https://github.com/ripple/rippled
# curl -L -o SOURCES/rippled-release.zip https://github.com/ripple/rippled/archive/release.zip
Source0: rippled-release.zip
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: gcc-c++ scons openssl-devel protobuf-devel
Requires: protobuf openssl
%description
Rippled is the server component of the Ripple network.
%prep
%setup -n rippled-release
%build
# Assume boost is manually installed
export RIPPLED_BOOST_HOME=/usr/local/boost_1_55_0
scons -j `grep -c processor /proc/cpuinfo` build/rippled
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/share/%{name}
cp LICENSE %{buildroot}/usr/share/%{name}/
mkdir -p %{buildroot}/usr/bin
cp build/rippled %{buildroot}/usr/bin/rippled
mkdir -p %{buildroot}/etc/%{name}
cp doc/rippled-example.cfg %{buildroot}/etc/%{name}/rippled.cfg
mkdir -p %{buildroot}/var/lib/%{name}/db
mkdir -p %{buildroot}/var/log/%{name}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
/usr/bin/rippled
/usr/share/rippled/LICENSE
/etc/rippled/rippled-example.cfg

BIN
LICENSE

Binary file not shown.

View File

@@ -1,9 +1,8 @@
#Ripple - P2P Payment Network
#rippled - Ripple P2P server
##[![Build Status](https://travis-ci.org/ripple/rippled.png?branch=develop)](https://travis-ci.org/ripple/rippled)
##[![Build Status](https://ci.ripple.com/jenkins/buildStatus/icon?job=rippled)](https://ci.ripple.com/jenkins/job/rippled/)
This is the repository for Ripple's `rippled`, reference P2P network server.
This is the repository for Ripple's `rippled`, reference P2P server.
###Build instructions:
* https://ripple.com/wiki/Rippled_build_instructions
@@ -34,20 +33,8 @@ README for more details.
Javascript / Mocha tests.
## License
Provided under the terms of the ISC License:
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.
Ripple is open source and permissively licensed under the ISC license. See the
LICENSE file for more details.
###For more information:
* https://ripple.com

View File

@@ -9,12 +9,14 @@ import os
import platform
import re
import sys
import textwrap
OSX = bool(platform.mac_ver()[0])
FreeBSD = bool('FreeBSD' == platform.system())
Linux = bool('Linux' == platform.system())
Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
Debian = bool(Linux and 'debian' == platform.linux_distribution()[0])
Fedora = bool(Linux and 'Fedora' == platform.linux_distribution()[0])
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
USING_CLANG = OSX or os.environ.get('CC', None) == 'clang'
@@ -24,7 +26,6 @@ USING_CLANG = OSX or os.environ.get('CC', None) == 'clang'
#
BOOST_HOME = os.environ.get("RIPPLED_BOOST_HOME", None)
if OSX or Ubuntu or Debian or Archlinux:
CTAGS = 'ctags'
elif FreeBSD:
@@ -40,10 +41,18 @@ HONOR_ENVS = ['CC', 'CXX', 'PATH']
env = Environment(
tools = ['default', 'protoc'],
#ENV = dict((k, os.environ[k]) for k in HONOR_ENVS)
ENV = dict((k, os.environ[k]) for k in HONOR_ENVS if k in os.environ)
)
if os.environ.get('CC', None):
env.Replace(CC = os.environ['CC'])
if os.environ.get('CXX', None):
env.Replace(CXX = os.environ['CXX'])
if os.environ.get('PATH', None):
env.Replace(PATH = os.environ['PATH'])
# Use a newer gcc on FreeBSD
if FreeBSD:
env.Replace(CC = 'gcc46')
@@ -60,7 +69,8 @@ if USING_CLANG:
env.Append(LINKFLAGS='-stdlib=libstdc++')
if OSX:
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libc++'])
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libc++',
'-Wno-deprecated-register'])
env.Append(LINKFLAGS='-stdlib=libc++')
env['FRAMEWORKS'] = ['AppKit','Foundation']
@@ -113,7 +123,7 @@ BOOST_LIBS = [
# included the platform can be whitelisted.
# if FreeBSD or Ubuntu or Archlinux:
if not (USING_CLANG and Linux) and (FreeBSD or Ubuntu or Archlinux or OSX):
if not (USING_CLANG and Linux) and (FreeBSD or Ubuntu or Archlinux or Debian or OSX or Fedora):
# non-mt libs do link with pthreads.
env.Append(
LIBS = BOOST_LIBS
@@ -133,6 +143,56 @@ else:
LIBS = [l + '-mt' for l in BOOST_LIBS]
)
#-------------------------------------------------------------------------------
# Change the way that information is printed so that we can get a nice
# output
#-------------------------------------------------------------------------------
BuildLogFile = None
def print_cmd_line_worker(item, fmt, cmd):
sys.stdout.write(fmt % (" \033[94m" + item + "\033[0m"))
global BuildLogFile
if not BuildLogFile:
BuildLogFile = open('rippled-build.log', 'w')
if BuildLogFile:
wrapper = textwrap.TextWrapper()
wrapper.break_long_words = False
wrapper.break_on_hyphens = False
wrapper.width = 75
lines = wrapper.wrap(cmd)
for line in lines:
BuildLogFile.write("%s\n" % line)
def print_cmd_line(s, target, src, env):
target = (''.join([str(x) for x in target]))
source = (''.join([str(x) for x in src]))
if ('build/rippled' == target):
print_cmd_line_worker(target, "%s\n", s)
elif ('tags' == target):
sys.stdout.write(" Generating tags")
else:
print_cmd_line_worker(source, "%s\n", s)
# Originally, we wanted to suppress verbose display when running on Travis,
# but we no longer want that functionality. Just use the following if to
# get the suppression functionality again:
#
#if (os.environ.get('TRAVIS', '0') != 'true') and
# (os.environ.get('CI', '0') != 'true'):
#
# env['PRINT_CMD_LINE_FUNC'] = print_cmd_line
env['PRINT_CMD_LINE_FUNC'] = print_cmd_line
#-------------------------------------------------------------------------------
#
# VFALCO NOTE Clean area.
@@ -148,12 +208,9 @@ else:
#
INCLUDE_PATHS = [
'.',
'src',
'src/leveldb',
'src/leveldb/port',
'src/leveldb/include',
'src/beast',
'build/proto'
'src/leveldb/include'
]
# if BOOST_HOME:
@@ -191,7 +248,7 @@ COMPILED_FILES.extend([
'src/ripple/testoverlay/ripple_testoverlay.cpp',
'src/ripple/types/ripple_types.cpp',
'src/ripple/validators/ripple_validators.cpp',
'src/ripple/common/ripple_common.cpp',
'src/ripple/common/ripple_common.cpp',
])
# ------------------------------
@@ -207,6 +264,7 @@ COMPILED_FILES.extend([
'src/ripple_app/ripple_app_pt6.cpp',
'src/ripple_app/ripple_app_pt7.cpp',
'src/ripple_app/ripple_app_pt8.cpp',
'src/ripple_app/ripple_app_pt9.cpp',
'src/ripple_basics/ripple_basics.cpp',
'src/ripple_core/ripple_core.cpp',
'src/ripple_data/ripple_data.cpp',
@@ -276,11 +334,12 @@ if not USING_CLANG:
else:
# This disables the "You said it was a struct AND a class, wth is going on
# warnings"
more_warnings = ['-Wno-mismatched-tags']
more_warnings = ['-Wno-mismatched-tags'] # add '-Wshorten-64-to-32' some day
# This needs to be a CCFLAGS not a CXXFLAGS
env.Append(CCFLAGS = more_warnings)
env.Append(CXXFLAGS = ['-O1','-pthread', '-Wno-invalid-offsetof', '-Wformat']+more_warnings+DEBUGFLAGS)
# add '-Wconversion' some day
env.Append(CXXFLAGS = ['-O3', '-fno-strict-aliasing', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+more_warnings+DEBUGFLAGS)
# RTTI is required for Beast and CountedObject.
#
@@ -290,11 +349,13 @@ UBUNTU_GCC_48_INSTALL_STEPS = '''
https://ripple.com/wiki/Ubuntu_build_instructions#Ubuntu_versions_older_than_13.10_:_Install_gcc_4.8'''
if not USING_CLANG:
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) < 7):
print "\nrippled, using c++11, requires g++ version >= 4.8 to compile"
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) < 8):
print "\n\033[91mTo compile rippled using GCC you need version 4.8.1 or later.\033[0m\n"
if Ubuntu:
print "For information how to update your GCC, please visit:"
print UBUNTU_GCC_48_INSTALL_STEPS
print "\n"
sys.exit(1)
else:
@@ -308,8 +369,86 @@ if OSX:
env.Append(LINKFLAGS = ['-L/usr/local/opt/openssl/lib'])
env.Append(CXXFLAGS = ['-I/usr/local/opt/openssl/include'])
PROTO_SRCS = env.Protoc([], 'src/ripple_data/protocol/ripple.proto', PROTOCOUTDIR='build/proto', PROTOCPYTHONOUTDIR=None)
env.Clean(PROTO_SRCS, 'site_scons/site_tools/protoc.pyc')
# Determine if this is a Travis continuous integration build:
TravisBuild = (os.environ.get('TRAVIS', '0') == 'true') and \
(os.environ.get('CI', '0') == 'true')
RippleRepository = False
# Determine if we're building against the main ripple repo or a developer repo
if TravisBuild:
Slug = os.environ.get('TRAVIS_REPO_SLUG', '')
if (Slug.find ("ripple/") == 0):
RippleRepository = True
if TravisBuild:
env.Append(CFLAGS = ['-DTRAVIS_CI_BUILD'])
env.Append(CXXFLAGS = ['-DTRAVIS_CI_BUILD'])
if RippleRepository:
env.Append(CFLAGS = ['-DRIPPLE_MASTER_BUILD'])
env.Append(CXXFLAGS = ['-DRIPPLE_MASTER_BUILD'])
# Display build configuration information for debugging purposes
def print_nv_pair(n, v):
name = ("%s" % n.rjust(10))
sys.stdout.write("%s \033[94m%s\033[0m\n" % (name, v))
def print_build_config(var):
val = env.get(var, '')
if val and val != '':
name = ("%s" % var.rjust(10))
wrapper = textwrap.TextWrapper()
wrapper.break_long_words = False
wrapper.break_on_hyphens = False
wrapper.width = 69
if type(val) is str:
lines = wrapper.wrap(val)
else:
lines = wrapper.wrap(" ".join(str(x) for x in val))
for line in lines:
print_nv_pair (name, line)
name = " "
config_vars = ['CC', 'CXX', 'CFLAGS', 'CPPFLAGS', 'CXXFLAGS', 'LINKFLAGS', 'LIBS']
if TravisBuild:
Slug = os.environ.get('TRAVIS_REPO_SLUG', None)
Branch = os.environ.get('TRAVIS_BRANCH', None)
Commit = os.environ.get('TRAVIS_COMMIT', None)
sys.stdout.write("\nBuild Type:\n")
if (Slug.find ("ripple/") == 0):
print_nv_pair ("Build", "Travis - Ripple Master Repository")
else:
print_nv_pair ("Build", "Travis - Ripple Developer Fork")
if (Slug):
print_nv_pair ("Repo", Slug)
if (Branch):
print_nv_pair ("Branch", Branch)
if (Commit):
print_nv_pair ("Commit", Commit)
sys.stdout.write("\nConfiguration:\n")
for var in config_vars:
print_build_config(var)
sys.stdout.write("\nBuilding:\n")
PROTO_SRCS = env.Protoc([], 'src/ripple/proto/ripple.proto',
PROTOCOUTDIR='src/ripple/proto',
PROTOCPROTOPATH=['src/ripple/proto'],
PROTOCPYTHONOUTDIR=None)
# Only tag actual Ripple files.
TAG_SRCS = copy.copy(COMPILED_FILES)

View File

@@ -1,6 +0,0 @@
#!/bin/sh -x
cd ~/NewCoin
git pull
scons -j 2
cp -p newcoind bin/

View File

@@ -1,10 +0,0 @@
#!/bin/sh
# XXX Should not need to make db directory. newcoind should do this.
for SITE in $HOSTS
do
echo "Clearing db for:" $SITE
DB_DIR="/var/www/$SITE/db/"
mkdir -p "/var/www/$SITE/db/"
rm -rf "/var/www/$SITE/db/*"
done

View File

@@ -1,5 +0,0 @@
#!/bin/sh -x
network-stop
sleep 1
network-start

View File

@@ -1,6 +0,0 @@
#!/bin/sh
for SITE in $HOSTS
do
(nx $SITE &)
done

View File

@@ -1,6 +0,0 @@
#!/bin/sh
for SITE in $HOSTS
do
(nx $SITE stop &)
done

View File

@@ -1,5 +0,0 @@
#!/bin/sh -x
echo "Building and restarting."
network-build
network-restart

7
bin/nx
View File

@@ -1,7 +0,0 @@
#!/bin/sh
SITE=$1
shift
COMMAND=$@
cd "/var/www/$SITE"
newcoind $COMMAND

View File

@@ -91,6 +91,8 @@
# One IPv4 address or domain names per line is allowed. A port may optionally
# be specified after adding a space to the address.
#
#
#
# [peer_ip]
#
# IP address or domain to bind to allow external connections from peers.
@@ -123,6 +125,8 @@
# to configure your server instance to receive PROXY Protocol handshakes,
# and also to restrict access to your instance to the Elastic Load Balancer.
#
#
#
# [peer_private]
#
# 0 or 1.
@@ -132,6 +136,15 @@
#
#
#
# [max_peers]
#
# The largest number of desired peer connections (incoming or outgoing).
# Cluster and fixed peers do not count towards this total. There are
# implementation-defined lower limits imposed on this value for security
# purposes.
#
#
#
# [peer_ssl_cipher_list]
#
# A colon delimited string with the allowed SSL cipher modes for peer. The
@@ -793,10 +806,20 @@
[node_size]
medium
# Note that HyperLevelDB is unavailable on Windows platforms
# This is primary persistent datastore for rippled. This includes transaction
# metadata, account states, and ledger headers. Helpful information can be
# found here: https://ripple.com/wiki/NodeBackEnd
[node_db]
type=HyperLevelDB
path=/etc/ripple/db/hyperldb
type=RocksDB
path=/var/lib/rippled/db/rocksdb
open_files=2000
filter_bits=12
cache_mb=256
file_size_mb=8
file_size_mult=2
[database_path]
/var/lib/rippled/db
# This needs to be an absolute directory reference, not a relative one.
# Modify this value as required.
@@ -817,13 +840,37 @@ r.ripple.com 51235
# These validators are taken from the v0.16 release notes on the wiki:
# https://ripple.com/wiki/Latest_rippled_release_notes
[validators]
n9KPnVLn7ewVzHvn218DcEYsnWLzKerTDwhpofhk4Ym1RUq4TeGw RIP1
n9LFzWuhKNvXStHAuemfRKFVECLApowncMAM5chSCL9R5ECHGN4V RIP2
n94rSdgTyBNGvYg8pZXGuNt59Y5bGAZGxbxyvjDaqD9ceRAgD85P RIP3
n9LeQeDcLDMZKjx1TZtrXoLBLo5q1bR1sUQrWG7tEADFU6R27UBp RIP4
n9KF6RpvktjNs2MDBkmxpJbup4BKrKeMKDXPhaXkq7cKTwLmWkFr RIP5
n949f75evCHwgyP4fPVgaHqNHxUVN15PsJEZ3B3HnXPcPjcZAoy7 RL1
n9MD5h24qrQqiyBC8aeqqCWvpiBiYQ3jxSr91uiDvmrkyHRdYLUj RL2
n9L81uNCaPgtUJfaHh89gmdvXKAmSt5Gdsw2g1iPWaPkAHW5Nm4C RL3
n9KiYM9CgngLvtRCQHZwgC2gjpdaZcCcbt3VboxiNFcKuwFVujzS RL4
n9LdgEtkmGB9E2h3K4Vp7iGUaKuq23Zr32ehxiU8FWY7xoxbWTSA RL5
# Ditto.
[validation_quorum]
3
# Turn down default logging to save disk space in the long run.
# Valid values here are trace, debug, info, warning, error, and fatal
[rpc_startup]
{ "command": "log_level", "severity": "warning" }
# Configure SSL for WebSockets. Not enabled by default because not everybody
# has an SSL cert on their server, but if you uncomment the following lines and
# set the path to the SSL certificate and private key the WebSockets protocol
# will be protected by SSL/TLS.
#[websocket_secure]
#1
#[websocket_ssl_cert]
#/etc/ssl/certs/server.crt
#[websocket_ssl_key]
#/etc/ssl/private/server.key
# Defaults to 0 ("no") so that you can use self-signed SSL certificates for
# development, or internally.
#[ssl_verify]
#0

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Ripple Peer-to-Peer Network Daemon
[Service]
Type=simple
User=nobody
ExecStart=/usr/bin/rippled --conf=/etc/rippled/rippled.cfg
[Install]
WantedBy=multi-user.target

View File

@@ -1,207 +0,0 @@
--------------------------------------------------------------------------------
RIPPLE TODO
--------------------------------------------------------------------------------
Vinnie's List: Changes day to day, descending priority
- PeerFinder work
- Validators work
- HTTPClient improvements based on HTTPServer
- HTTPMessage improvements
- Ditch old HTTPClient so I can take the name
- Finish RPCAsyncServer, RPCService and RPCService::Manager
- Fix RPCDoor to respect config setting for [rpc_secure]
- Clean up calculation of COnfig file location.
- Remove TESTNET and all related code and settings.
- Remove addRpcSub, findRpcSub, and notify the appropriate partner(s)
David Features:
- override config items from command line
- change config via RPC, this is for debugging
--------------------------------------------------------------------------------
- std::priority_queue for DeadlineTimer
- Change ProxyInfo to use IP::Endpoint, get rid of IPv4Address from the parsing
code
- Validators should delay the application of newly downloaded lists from
sources, to mitigate the effects of attacks. Unless there's no validators
in the list.
- Validators RPC options to immediately apply UNL,
manually revisit sources, etc...
- Look into using CMake
- IPv6 support in IP::Endpoint
- Configuration list for Jenkins
- Fix all crash and leaks on exit
Say there's a leak, a ledger that can never be accessed is locked in some
structure. If the organized teardown code frees that structure, the leak
will not be reported.
Yes, so you'll detect some small subset of leaks that way.
You'll still have to be vigilant for the leaks that won't detect.
The problem is ordering. There are lots of circular dependencies.
The biggest problem is the order of destruction of global objects. (I think)
Getting rid of global objects is a good solution to that.
Vinnie Falco: Those I can resolve with my ReferenceCountedSingleton. And
yeah thats a good approach, one that I am doing slowly anyway
Yeah, that's good for other reasons too, not just the unpredictability of
creation order that can hide bugs.
There may also just be some missing destructors.
Some of it may be things being shut down in the wrong order. Like if you shut
down the cache and then something that uses the cache, objects may get
put in the cache after it was shut down.
- Do something about the throw() reporting weaknesses:
* Make sure all Sconstruct and .pro builds have debug symbols in release
* Replace all throw with beast::Throw()
(Only in ripple sources, not in Subtrees/, protobuf, or websocket)
- Improved Beast exception object, provides __FILE__ and __LINE__
- Add file and line capabilities to beast::Throw()
- Allow beast::Throw to be hooked for logging
- Add stack trace capability to beast::Throw() diagnostics via the hook
(use the existing beast::SystemStats::getStackBacktrace())
- Implement getStackBacktrace for BEAST_BSD targets
- Add UnhandledExceptionCatcher to beast
- Return EXIT_FAILURE on unhandled exception
- Consolidate JSON code maybe use Beast
- Deeply create directories specified in config settings
- Refactor Section code into ConfigFile
- Supress useless gcc warnings
http://stackoverflow.com/questions/3378560/how-to-disable-gcc-warnings-for-a-few-lines-of-code
- Get rid of boost::filesystem
- What the heck is up with site_scons/site_tools/protoc.py?
- Add convenience variadic functions to JobQueue that do the bind for you
- Consolidate databases
- Figure out why we need WAL sqlite mode if we no longer use sqlite for the node store
- Add "skipped" field to beginTestCase() to disable a test but still record
that it was skipped in the output. Like for mdb import.
- Get rid of 'ref' typedefs that really mean const&
- Use secp256k1 from beast
- Fix xsd/dtd line in JUnit XML output
- Get rid of the WriteLog() stuff in the ripple tests and make it report the
message directly to the UnitTest object. Then update the JUnit XML output
routines to also write the auxiliary messages.
* Restyle all the macros in ConfigSection.h
- Move src/protobuf to Subtrees and deal with protobuf_core.cpp
- Replace home-made database wrappers with beast::sqdb
- Use static creation member functions instead of endless constructor
variations in base_uint, uint256, and family.
- Raise the warning level and fix everything
- Replace base_uint and uintXXX with UnsignedInteger
* Need to specialize UnsignedInteger to work efficiently with 4 and 8 byte
multiples of the size.
- Rewrite boost program_options in Beast
- Replace endian conversion calls with beast calls:
htobe32, be32toh, ntohl, etc...
Start by removing the system headers which provide these routines, if possible
- Rename RPCHandler to CallHandler
- Rename "fullBelow" to something like haveAllDescendants or haveAllChildren.
- Rewrite Sustain to use Beast and work on Windows as well
* Do not enable watchdog process if a debugger is attached
- Make sure the leak detector output appears on Linux and FreeBSD debug builds.
- Rename LoadMonitor to LoadMeter, change LoadEvent to LoadMeter::ScopedSample
- Rename LedgerMaster to Ledgers, create ILedgers interface.
- Replace all NULL with nullptr
- Make TxFormats a member of ICore instead of a singleton.
PROBLEM: STObject derived classes like STInt16 make direct use of the
singleton. It might have to remain a singleton. At the very least,
it should be a SharedSingleton to resolve ordering issues.
- Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS
- Remove "ENABLE_INSECURE" when the time is right.
- lift unique_ptr / auto_ptr into ripple namespace,
or replace with ScopedPointer (preferred)
- Go searching through VFALCO notes and fix everything
- Deal with function-level statics used for SqliteDatabase (like in
HSBESQLite::visitAll)
- Document in order:
SerializedType
STObject
SerializedLedgerEntry
- Consolidate SQLite database classes: DatabaseCon, Database, SqliteDatabase.
--------------------------------------------------------------------------------
WEBSOCKET TODO
--------------------------------------------------------------------------------
- Rewrite for sanity
--------------------------------------------------------------------------------
PROTOCOL BUFFERS TODO
--------------------------------------------------------------------------------
- Create/maintain the protobuf Git repo (original uses SVN)
- Update the subtree
- Make a Visual Studio 2012 Project for source browsing
--------------------------------------------------------------------------------
Davidisms
--------------------------------------------------------------------------------
(Figure out a good place to record information like this permanently)
Regarding a defect where a failing transaction was being submitted over and over
again on the network (July 3, 2013)
The core problem was an interaction between two bits of logic.
1) Normally, we won't relay a transaction again if we already recently relayed
it. But this is bypassed if the transaction failed in a way that could
allow it to succeed later. This way, if one server discovers a transaction
can now work, it can get all servers to retry it.
2) Normally, we won't relay a transaction if we think it can't claim a fee.
But if we're not sure it can't claim a fee because we're in an unhealthy
state, we propagate the transaction to let other servers decide if they
think it can claim a fee.
With these two bits of logic, two unhealthy servers could infinitely propagate
a transaction back and forth between each other.
A node is "full below" if we believe we have (either in the database or
scheduled to be stored in the database) the contents of every node below that
node in a hash tree. When trying to acquire a hash tree/map, if a node is
full below, we know not to bother with anything below that node.
The fullBelowCache is a cache of hashes of nodes that are full below. Which means
there are no missing children

View File

@@ -1,13 +1,38 @@
#!python
#
# Copyright (c) 2009 Scott Stafford
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Author : Scott Stafford
# Date : 2009-12-09 20:36:14
#
# Changes : Vinnie Falco <vinnie.falco@gmail.com>
# Date : 2014--4-25
"""
protoc.py: Protoc Builder for SCons
This Builder invokes protoc to generate C++ and Python
from a .proto file.
This Builder invokes protoc to generate C++ and Python from a .proto file.
NOTE: Java is not currently supported.
From: http://www.scons.org/wiki/ProtocBuilder
"""
__author__ = "Scott Stafford"
@@ -25,42 +50,25 @@ import os.path
protocs = 'protoc'
ProtocAction = SCons.Action.Action('$PROTOCCOM', '$PROTOCCOMSTR')
def ProtocEmitter(target, source, env):
dirOfCallingSConscript = Dir('.').srcnode()
env.Prepend(PROTOCPROTOPATH = dirOfCallingSConscript.path)
source_with_corrected_path = []
for src in source:
commonprefix = os.path.commonprefix([dirOfCallingSConscript.path, src.srcnode().path])
if len(commonprefix)>0:
source_with_corrected_path.append( src.srcnode().path[len(commonprefix + os.sep):] )
else:
source_with_corrected_path.append( src.srcnode().path )
source = source_with_corrected_path
for src in source:
modulename = os.path.splitext(os.path.basename(src))[0]
if env['PROTOCOUTDIR']:
base = os.path.join(env['PROTOCOUTDIR'] , modulename)
target.extend( [ base + '.pb.cc', base + '.pb.h' ] )
if env['PROTOCPYTHONOUTDIR']:
base = os.path.join(env['PROTOCPYTHONOUTDIR'] , modulename)
target.append( base + '_pb2.py' )
def ProtocEmitter(target, source, env):
PROTOCOUTDIR = env['PROTOCOUTDIR']
PROTOCPYTHONOUTDIR = env['PROTOCPYTHONOUTDIR']
for source_path in [str(x) for x in source]:
base = os.path.splitext(os.path.basename(source_path))[0]
if PROTOCOUTDIR:
target.extend([os.path.join(PROTOCOUTDIR, base + '.pb.cc'),
os.path.join(PROTOCOUTDIR, base + '.pb.h')])
if PROTOCPYTHONOUTDIR:
target.append(os.path.join(PROTOCPYTHONOUTDIR, base + '_pb2.py'))
try:
target.append(env['PROTOCFDSOUT'])
except KeyError:
pass
# XXX KLUDGE: Force things to be right.
env['PROTOCOUTDIR'] = 'build/proto'
env['PROTOCPROTOPATH'] = ['src/ripple_data/protocol']
#~ print "PROTOC SOURCE:", [str(s) for s in source]
#~ print "PROTOC TARGET:", [str(s) for s in target]
#print "PROTOC SOURCE:", [str(s) for s in source]
#print "PROTOC TARGET:", [str(s) for s in target]
return target, source
@@ -75,7 +83,7 @@ def generate(env):
except KeyError:
bld = ProtocBuilder
env['BUILDERS']['Protoc'] = bld
env['PROTOC'] = env.Detect(protocs) or 'protoc'
env['PROTOCFLAGS'] = SCons.Util.CLVar('')
env['PROTOCPROTOPATH'] = SCons.Util.CLVar('')
@@ -85,4 +93,4 @@ def generate(env):
env['PROTOCSRCSUFFIX'] = '.proto'
def exists(env):
return env.Detect(protocs)
return env.Detect(protocs)

View File

@@ -27,6 +27,21 @@
@file BeastConfig.h
*/
//------------------------------------------------------------------------------
//
// Unit Tests
//
//------------------------------------------------------------------------------
/** Config: BEAST_NO_UNIT_TEST_INLINE
Prevents unit test definitions from being inserted into a global table.
The default is to include inline unit test definitions.
*/
#ifndef BEAST_NO_UNIT_TEST_INLINE
//#define BEAST_NO_UNIT_TEST_INLINE 1
#endif
//------------------------------------------------------------------------------
//
// Diagnostics
@@ -184,4 +199,20 @@
#define RIPPLE_USE_VALIDATORS 0
#endif
/** Config: BEAST_USE_BOOST_FEATURES
This activates boost specific features and improvements. If this is
turned on, the include paths for your build environment must be set
correctly to find the boost headers.
*/
#ifndef BEAST_USE_BOOST_FEATURES
//#define BEAST_USE_BOOST_FEATURES 1
#endif
/** Config: RIPPLE_PROPOSE_FEATURES
This determines whether to add any features to the proposed transaction set.
*/
#ifndef RIPPLE_PROPOSE_FEATURES
#define RIPPLE_PROPOSE_FEATURES 0
#endif
#endif

View File

@@ -27,3 +27,4 @@ Builds/VisualStudio2012/Debug
Builds/VisualStudio2012/Release
project.xcworkspace
modules/beast_cryptopp
bin/

26
src/beast/.travis.yml Normal file
View File

@@ -0,0 +1,26 @@
language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:boost-latest/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq python-software-properties
- sudo apt-get install -qq g++-4.8
- sudo apt-get install -qq libboost1.55-all-dev
- sudo apt-get install -qq libssl-dev
- sudo apt-get install -qq gcc-4.8
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- sudo update-alternatives --set gcc /usr/bin/gcc-4.8
# - sudo apt-get -y install binutils-gold
- g++ -v
- clang -v
script:
# Abort build on failure
- set -e
- scons
notifications:
email:
false

View File

@@ -27,6 +27,19 @@
@file BeastConfig.h
*/
//------------------------------------------------------------------------------
//
// Unit Tests
//
//------------------------------------------------------------------------------
/** Config: BEAST_NO_UNIT_TEST_INLINE
Prevents unit test definitions from being inserted into a global table.
*/
#ifndef BEAST_NO_UNIT_TEST_INLINE
#define BEAST_NO_UNIT_TEST_INLINE 0
#endif
//------------------------------------------------------------------------------
//
// Diagnostics

View File

@@ -8,10 +8,11 @@
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>BEAST_COMPILING_STATIC_LIBARARY=1;_CRTDBG_MAP_ALLOC;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BEAST_INCLUDE_BEASTCONFIG=1;_CRTDBG_MAP_ALLOC;_WIN32_WINNT=0x0600;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<AdditionalIncludeDirectories>$(RepoDir)\config;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -120,7 +120,7 @@ overlooked. Blank lines are used to separate code into "paragraphs."
`static_cast`. And when you're reinterpreting data, always use
`reinterpret_cast`.
* Until C++ gets a universal 64-bit primitive type (part of the C++11
standard), it's best to stick to the `int64` and `uint64` typedefs.
standard), it's best to stick to the `std::int64_t` and `std::uint64_t` typedefs.
## Object lifetime and ownership

48
src/beast/SConstruct Normal file
View File

@@ -0,0 +1,48 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
import os
import sys
def add_beast_to_path():
python_home = os.path.join(os.getcwd(), 'python')
if python_home not in sys.path:
sys.path.append(python_home)
add_beast_to_path()
from beast.env.AddCommonFlags import add_common_flags
from beast.env.AddUserEnv import add_user_env
from beast.env import Print
from beast.platform import GetEnvironment
from beast.util import Boost
from beast.util import File
from beast.util import Tests
VARIANT_DIRECTORIES = {
'beast': ('bin', 'beast'),
'modules': ('bin', 'modules'),
}
BOOST_LIBRARIES = 'boost_system',
MAIN_PROGRAM_FILE = 'beast/unit_test/tests/main.cpp'
DOTFILE = '~/.scons'
def main():
File.validate_libraries(Boost.LIBPATH, BOOST_LIBRARIES)
defaults = GetEnvironment.get_environment(ARGUMENTS)
working = copy.deepcopy(defaults)
add_common_flags(defaults)
add_user_env(working, DOTFILE)
add_common_flags(working)
Print.print_build_config(working, defaults)
env = Environment(**working)
for name, path in VARIANT_DIRECTORIES.items():
env.VariantDir(os.path.join(*path), name, duplicate=0)
env.Replace(PRINT_CMD_LINE_FUNC=Print.print_cmd_line)
Tests.run_tests(env, MAIN_PROGRAM_FILE, '.', '.test.cpp')
main()

View File

@@ -2,12 +2,12 @@
BEAST TODO
--------------------------------------------------------------------------------
- Change sqdb to use exceptions instead of errors
- Use SemanticVersion for beast version numbers to replace BEAST_VERSION
- add support for a __PRETTY_FUNCTION__ equivalent for all environments
- add expectThrow() to UnitTest, where it expects an exception
- Import secp256k1 from sipa
- Set sqlite thread safety model to '2' in beast_sqlite
@@ -18,8 +18,6 @@ BEAST TODO
- Rename HeapBlock routines to not conflict with _CRTDBG_MAP_ALLOC macros
- Design a WeakPtr / SharedPtr / SharedObject intrusive system
- Implement beast::Bimap?
- Use Bimap for storage in the DeadlineTimer::Manager, to support
@@ -28,44 +26,18 @@ BEAST TODO
- Think about adding a shouldStop bool to InterruptibleThread, along
with a shouldStop () function returning bool, and a stop() method.
- Make OwnedArray add routines return a pointer instead of reference
- Tidy up CacheLine, MemoryAlignment
- Remove anything having to do with DLL builds like
BEAST_DLL, BEAST_DLL_BUILD, BEAST_DISABLE_DLL_ALLOCATORS
- Fix FifoFreeStoreWithTLS reference counting bug
- Implement a reasonable substitute for boost's thread_local_storage
- Think about doing away with BEAST_CALLTYPE and BEAST_API
- Decide if headers should just include BeastConfig.h instead of making the
host program do it.
- Rename malloc/calloc JUCE members that conflict with the debug CRT from MSVC
- Reformat every Doxygen comment
- Fix Doxygen metatags
- update Beast Doxyfile
- Rename include guards to boost style, e.g. BEAST_THROW_H_INCLUDED
- Clean up CacheLine, StaticObject
- Clean up ConcurrentObject
- Rename SharedData to SharedState or something?
- Figure out what to do with ReadWriteLock, and NamedPipe which uses it?
- Put BEAST_PUBLIC_FUNCTION in front of all loose functions
- restructure the repo sources to look like this:
/Source/beast/beast_core/beast_core.h
etc...
- Put the BeastConfig.h at the root of the repo.
- Make sure the template BeastConfig.h is included in the Doxyfile
- Implement robust key/value database with bulk write

View File

@@ -25,9 +25,11 @@
#define BEAST_ARITHMETIC_H_INCLUDED
#include "Config.h"
#include "CStdInt.h"
#include "utility/noexcept.h"
#include <cmath>
#include <cstdint>
#include <algorithm>
namespace beast {
@@ -195,12 +197,6 @@ inline bool isPositiveAndNotGreaterThan (const int valueToTest, const int upperL
}
//==============================================================================
/** Handy function to swap two values. */
template <typename Type>
inline void swapVariables (Type& variable1, Type& variable2)
{
std::swap (variable1, variable2);
}
/** Handy function for getting the number of elements in a simple const C array.
E.g.
@@ -218,54 +214,12 @@ int numElementsInArray (Type (&array)[N])
return N;
}
//==============================================================================
// Some useful maths functions that aren't always present with all compilers and build settings.
/** Using beast_hypot is easier than dealing with the different types of hypot function
that are provided by the various platforms and compilers. */
template <typename Type>
inline Type beast_hypot (Type a, Type b) noexcept
{
#if BEAST_MSVC
return static_cast <Type> (_hypot (a, b));
#else
return static_cast <Type> (hypot (a, b));
#endif
}
/** 64-bit abs function. */
inline int64 abs64 (const int64 n) noexcept
inline std::int64_t abs64 (const std::int64_t n) noexcept
{
return (n >= 0) ? n : -n;
}
//==============================================================================
/** A predefined value for Pi, at double-precision.
@see float_Pi
*/
const double double_Pi = 3.1415926535897932384626433832795;
/** A predefined value for Pi, at single-precision.
@see double_Pi
*/
const float float_Pi = 3.14159265358979323846f;
//==============================================================================
/** The isfinite() method seems to vary between platforms, so this is a
platform-independent function for it.
*/
template <typename FloatingPointType>
inline bool beast_isfinite (FloatingPointType value)
{
#if BEAST_WINDOWS
return _finite (value);
#elif BEAST_ANDROID
return isfinite (value);
#else
return std::isfinite (value);
#endif
}
//==============================================================================
#if BEAST_MSVC
@@ -309,149 +263,6 @@ inline int roundToInt (const FloatType value) noexcept
#pragma optimize ("", on) // resets optimisations to the project defaults
#endif
/** Fast floating-point-to-integer conversion.
This is a slightly slower and slightly more accurate version of roundDoubleToInt(). It works
fine for values above zero, but negative numbers are rounded the wrong way.
*/
inline int roundToIntAccurate (const double value) noexcept
{
#ifdef __INTEL_COMPILER
#pragma float_control (pop)
#endif
return roundToInt (value + 1.5e-8);
}
/** Fast floating-point-to-integer conversion.
This is faster than using the normal c++ cast to convert a double to an int, and
it will round the value to the nearest integer, rather than rounding it down
like the normal cast does.
Note that this routine gets its speed at the expense of some accuracy, and when
rounding values whose floating point component is exactly 0.5, odd numbers and
even numbers will be rounded up or down differently. For a more accurate conversion,
see roundDoubleToIntAccurate().
*/
inline int roundDoubleToInt (const double value) noexcept
{
return roundToInt (value);
}
/** Fast floating-point-to-integer conversion.
This is faster than using the normal c++ cast to convert a float to an int, and
it will round the value to the nearest integer, rather than rounding it down
like the normal cast does.
Note that this routine gets its speed at the expense of some accuracy, and when
rounding values whose floating point component is exactly 0.5, odd numbers and
even numbers will be rounded up or down differently.
*/
inline int roundFloatToInt (const float value) noexcept
{
return roundToInt (value);
}
//==============================================================================
/** Returns true if the specified integer is a power-of-two.
*/
template <typename IntegerType>
bool isPowerOfTwo (IntegerType value)
{
return (value & (value - 1)) == 0;
}
/** Returns the smallest power-of-two which is equal to or greater than the given integer.
*/
inline int nextPowerOfTwo (int n) noexcept
{
--n;
n |= (n >> 1);
n |= (n >> 2);
n |= (n >> 4);
n |= (n >> 8);
n |= (n >> 16);
return n + 1;
}
/** Performs a modulo operation, but can cope with the dividend being negative.
The divisor must be greater than zero.
*/
template <typename IntegerType>
IntegerType negativeAwareModulo (IntegerType dividend, const IntegerType divisor) noexcept
{
bassert (divisor > 0);
dividend %= divisor;
return (dividend < 0) ? (dividend + divisor) : dividend;
}
//==============================================================================
#if (BEAST_INTEL && BEAST_32BIT) || defined (DOXYGEN)
/** This macro can be applied to a float variable to check whether it contains a denormalised
value, and to normalise it if necessary.
On CPUs that aren't vulnerable to denormalisation problems, this will have no effect.
*/
#define BEAST_UNDENORMALISE(x) x += 1.0f; x -= 1.0f;
#else
#define BEAST_UNDENORMALISE(x)
#endif
//==============================================================================
/** This namespace contains a few template classes for helping work out class type variations.
*/
namespace TypeHelpers
{
#if BEAST_VC8_OR_EARLIER
#define PARAMETER_TYPE(type) const type&
#else
/** The ParameterType struct is used to find the best type to use when passing some kind
of object as a parameter.
Of course, this is only likely to be useful in certain esoteric template situations.
Because "typename TypeHelpers::ParameterType<SomeClass>::type" is a bit of a mouthful, there's
a PARAMETER_TYPE(SomeClass) macro that you can use to get the same effect.
E.g. "myFunction (PARAMETER_TYPE (int), PARAMETER_TYPE (MyObject))"
would evaluate to "myfunction (int, const MyObject&)", keeping any primitive types as
pass-by-value, but passing objects as a const reference, to avoid copying.
*/
template <typename Type> struct ParameterType { typedef const Type& type; };
#if ! DOXYGEN
template <typename Type> struct ParameterType <Type&> { typedef Type& type; };
template <typename Type> struct ParameterType <Type*> { typedef Type* type; };
template <> struct ParameterType <char> { typedef char type; };
template <> struct ParameterType <unsigned char> { typedef unsigned char type; };
template <> struct ParameterType <short> { typedef short type; };
template <> struct ParameterType <unsigned short> { typedef unsigned short type; };
template <> struct ParameterType <int> { typedef int type; };
template <> struct ParameterType <unsigned int> { typedef unsigned int type; };
template <> struct ParameterType <long> { typedef long type; };
template <> struct ParameterType <unsigned long> { typedef unsigned long type; };
template <> struct ParameterType <int64> { typedef int64 type; };
template <> struct ParameterType <uint64> { typedef uint64 type; };
template <> struct ParameterType <bool> { typedef bool type; };
template <> struct ParameterType <float> { typedef float type; };
template <> struct ParameterType <double> { typedef double type; };
#endif
/** A helpful macro to simplify the use of the ParameterType template.
@see ParameterType
*/
#define PARAMETER_TYPE(a) typename TypeHelpers::ParameterType<a>::type
#endif
/** These templates are designed to take a type, and if it's a double, they return a double
type; for anything else, they return a float type.
*/
template <typename Type> struct SmallestFloatType { typedef float type; };
template <> struct SmallestFloatType <double> { typedef double type; };
}
}
#endif

View File

@@ -25,9 +25,12 @@
#define BEAST_ATOMIC_H_INCLUDED
#include "Config.h"
#include "CStdInt.h"
#include "StaticAssert.h"
#include "utility/noexcept.h"
#include <cstdint>
namespace beast {
//==============================================================================
@@ -156,10 +159,10 @@ private:
template <typename Dest, typename Source>
static inline Dest castTo (Source value) noexcept { union { Dest d; Source s; } u; u.s = value; return u.d; }
static inline Type castFrom32Bit (int32 value) noexcept { return castTo <Type, int32> (value); }
static inline Type castFrom64Bit (int64 value) noexcept { return castTo <Type, int64> (value); }
static inline int32 castTo32Bit (Type value) noexcept { return castTo <int32, Type> (value); }
static inline int64 castTo64Bit (Type value) noexcept { return castTo <int64, Type> (value); }
static inline Type castFrom32Bit (std::int32_t value) noexcept { return castTo <Type, std::int32_t> (value); }
static inline Type castFrom64Bit (std::int64_t value) noexcept { return castTo <Type, std::int64_t> (value); }
static inline std::int32_t castTo32Bit (Type value) noexcept { return castTo <std::int32_t, Type> (value); }
static inline std::int64_t castTo64Bit (Type value) noexcept { return castTo <std::int64_t, Type> (value); }
Type operator++ (int); // better to just use pre-increment with atomics..
@@ -172,14 +175,14 @@ private:
return sizeof (ValueType) == 1 ? (ValueType) -(signed char) n
: (sizeof (ValueType) == 2 ? (ValueType) -(short) n
: (sizeof (ValueType) == 4 ? (ValueType) -(int) n
: ((ValueType) -(int64) n)));
: ((ValueType) -(std::int64_t) n)));
}
/** This templated negate function will negate pointers as well as integers */
template <typename PointerType>
inline PointerType* negateValue (PointerType* n) noexcept
{
return reinterpret_cast <PointerType*> (-reinterpret_cast <pointer_sized_int> (n));
return reinterpret_cast <PointerType*> (-reinterpret_cast <std::intptr_t> (n));
}
};
@@ -272,14 +275,14 @@ template <typename Type>
inline Type Atomic<Type>::get() const noexcept
{
#if BEAST_ATOMICS_MAC
return sizeof (Type) == 4 ? castFrom32Bit ((int32) OSAtomicAdd32Barrier ((int32_t) 0, (BEAST_MAC_ATOMICS_VOLATILE int32_t*) &value))
: castFrom64Bit ((int64) OSAtomicAdd64Barrier ((int64_t) 0, (BEAST_MAC_ATOMICS_VOLATILE int64_t*) &value));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) OSAtomicAdd32Barrier ((int32_t) 0, (BEAST_MAC_ATOMICS_VOLATILE int32_t*) &value))
: castFrom64Bit ((std::int64_t) OSAtomicAdd64Barrier ((int64_t) 0, (BEAST_MAC_ATOMICS_VOLATILE int64_t*) &value));
#elif BEAST_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? castFrom32Bit ((int32) beast_InterlockedExchangeAdd ((volatile long*) &value, (long) 0))
: castFrom64Bit ((int64) beast_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) beast_InterlockedExchangeAdd ((volatile long*) &value, (long) 0))
: castFrom64Bit ((std::int64_t) beast_InterlockedExchangeAdd64 ((volatile __int64*) &value, (__int64) 0));
#elif BEAST_ATOMICS_GCC
return sizeof (Type) == 4 ? castFrom32Bit ((int32) __sync_add_and_fetch ((volatile int32*) &value, 0))
: castFrom64Bit ((int64) __sync_add_and_fetch ((volatile int64*) &value, 0));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) __sync_add_and_fetch ((volatile std::int32_t*) &value, 0))
: castFrom64Bit ((std::int64_t) __sync_add_and_fetch ((volatile std::int64_t*) &value, 0));
#endif
}
@@ -291,8 +294,8 @@ inline Type Atomic<Type>::exchange (const Type newValue) noexcept
while (! compareAndSetBool (newValue, currentVal)) { currentVal = value; }
return currentVal;
#elif BEAST_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? castFrom32Bit ((int32) beast_InterlockedExchange ((volatile long*) &value, (long) castTo32Bit (newValue)))
: castFrom64Bit ((int64) beast_InterlockedExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue)));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) beast_InterlockedExchange ((volatile long*) &value, (long) castTo32Bit (newValue)))
: castFrom64Bit ((std::int64_t) beast_InterlockedExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue)));
#endif
}
@@ -377,8 +380,8 @@ inline bool Atomic<Type>::compareAndSetBool (const Type newValue, const Type val
#elif BEAST_ATOMICS_WINDOWS
return compareAndSetValue (newValue, valueToCompare) == valueToCompare;
#elif BEAST_ATOMICS_GCC
return sizeof (Type) == 4 ? __sync_bool_compare_and_swap ((volatile int32*) &value, castTo32Bit (valueToCompare), castTo32Bit (newValue))
: __sync_bool_compare_and_swap ((volatile int64*) &value, castTo64Bit (valueToCompare), castTo64Bit (newValue));
return sizeof (Type) == 4 ? __sync_bool_compare_and_swap ((volatile std::int32_t*) &value, castTo32Bit (valueToCompare), castTo32Bit (newValue))
: __sync_bool_compare_and_swap ((volatile std::int64_t*) &value, castTo64Bit (valueToCompare), castTo64Bit (newValue));
#endif
}
@@ -397,11 +400,11 @@ inline Type Atomic<Type>::compareAndSetValue (const Type newValue, const Type va
}
#elif BEAST_ATOMICS_WINDOWS
return sizeof (Type) == 4 ? castFrom32Bit ((int32) beast_InterlockedCompareExchange ((volatile long*) &value, (long) castTo32Bit (newValue), (long) castTo32Bit (valueToCompare)))
: castFrom64Bit ((int64) beast_InterlockedCompareExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue), (__int64) castTo64Bit (valueToCompare)));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) beast_InterlockedCompareExchange ((volatile long*) &value, (long) castTo32Bit (newValue), (long) castTo32Bit (valueToCompare)))
: castFrom64Bit ((std::int64_t) beast_InterlockedCompareExchange64 ((volatile __int64*) &value, (__int64) castTo64Bit (newValue), (__int64) castTo64Bit (valueToCompare)));
#elif BEAST_ATOMICS_GCC
return sizeof (Type) == 4 ? castFrom32Bit ((int32) __sync_val_compare_and_swap ((volatile int32*) &value, castTo32Bit (valueToCompare), castTo32Bit (newValue)))
: castFrom64Bit ((int64) __sync_val_compare_and_swap ((volatile int64*) &value, castTo64Bit (valueToCompare), castTo64Bit (newValue)));
return sizeof (Type) == 4 ? castFrom32Bit ((std::int32_t) __sync_val_compare_and_swap ((volatile std::int32_t*) &value, castTo32Bit (valueToCompare), castTo32Bit (newValue)))
: castFrom64Bit ((std::int64_t) __sync_val_compare_and_swap ((volatile std::int64_t*) &value, castTo64Bit (valueToCompare), castTo64Bit (newValue)));
#endif
}

View File

@@ -25,9 +25,10 @@
#define BEAST_BYTEORDER_H_INCLUDED
#include "Config.h"
#include "CStdInt.h"
#include "Uncopyable.h"
#include <cstdint>
namespace beast {
//==============================================================================
@@ -39,51 +40,51 @@ class ByteOrder : public Uncopyable
public:
//==============================================================================
/** Swaps the upper and lower bytes of a 16-bit integer. */
static uint16 swap (uint16 value);
static std::uint16_t swap (std::uint16_t value);
/** Reverses the order of the 4 bytes in a 32-bit integer. */
static uint32 swap (uint32 value);
static std::uint32_t swap (std::uint32_t value);
/** Reverses the order of the 8 bytes in a 64-bit integer. */
static uint64 swap (uint64 value);
static std::uint64_t swap (std::uint64_t value);
//==============================================================================
/** Swaps the byte order of a 16-bit int if the CPU is big-endian */
static uint16 swapIfBigEndian (uint16 value);
static std::uint16_t swapIfBigEndian (std::uint16_t value);
/** Swaps the byte order of a 32-bit int if the CPU is big-endian */
static uint32 swapIfBigEndian (uint32 value);
static std::uint32_t swapIfBigEndian (std::uint32_t value);
/** Swaps the byte order of a 64-bit int if the CPU is big-endian */
static uint64 swapIfBigEndian (uint64 value);
static std::uint64_t swapIfBigEndian (std::uint64_t value);
/** Swaps the byte order of a 16-bit int if the CPU is little-endian */
static uint16 swapIfLittleEndian (uint16 value);
static std::uint16_t swapIfLittleEndian (std::uint16_t value);
/** Swaps the byte order of a 32-bit int if the CPU is little-endian */
static uint32 swapIfLittleEndian (uint32 value);
static std::uint32_t swapIfLittleEndian (std::uint32_t value);
/** Swaps the byte order of a 64-bit int if the CPU is little-endian */
static uint64 swapIfLittleEndian (uint64 value);
static std::uint64_t swapIfLittleEndian (std::uint64_t value);
//==============================================================================
/** Turns 2 bytes into a little-endian integer. */
static uint16 littleEndianShort (const void* bytes);
static std::uint16_t littleEndianShort (const void* bytes);
/** Turns 4 bytes into a little-endian integer. */
static uint32 littleEndianInt (const void* bytes);
static std::uint32_t littleEndianInt (const void* bytes);
/** Turns 4 bytes into a little-endian integer. */
static uint64 littleEndianInt64 (const void* bytes);
static std::uint64_t littleEndianInt64 (const void* bytes);
/** Turns 2 bytes into a big-endian integer. */
static uint16 bigEndianShort (const void* bytes);
static std::uint16_t bigEndianShort (const void* bytes);
/** Turns 4 bytes into a big-endian integer. */
static uint32 bigEndianInt (const void* bytes);
static std::uint32_t bigEndianInt (const void* bytes);
/** Turns 4 bytes into a big-endian integer. */
static uint64 bigEndianInt64 (const void* bytes);
static std::uint64_t bigEndianInt64 (const void* bytes);
//==============================================================================
/** Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). */
@@ -111,16 +112,16 @@ private:
#pragma intrinsic (_byteswap_ulong)
#endif
inline uint16 ByteOrder::swap (uint16 n)
inline std::uint16_t ByteOrder::swap (std::uint16_t n)
{
#if BEAST_USE_INTRINSICSxxx // agh - the MS compiler has an internal error when you try to use this intrinsic!
return static_cast <uint16> (_byteswap_ushort (n));
return static_cast <std::uint16_t> (_byteswap_ushort (n));
#else
return static_cast <uint16> ((n << 8) | (n >> 8));
return static_cast <std::uint16_t> ((n << 8) | (n >> 8));
#endif
}
inline uint32 ByteOrder::swap (uint32 n)
inline std::uint32_t ByteOrder::swap (std::uint32_t n)
{
#if BEAST_MAC || BEAST_IOS
return OSSwapInt32 (n);
@@ -143,48 +144,48 @@ inline uint32 ByteOrder::swap (uint32 n)
#endif
}
inline uint64 ByteOrder::swap (uint64 value)
inline std::uint64_t ByteOrder::swap (std::uint64_t value)
{
#if BEAST_MAC || BEAST_IOS
return OSSwapInt64 (value);
#elif BEAST_USE_INTRINSICS
return _byteswap_uint64 (value);
#else
return (((int64) swap ((uint32) value)) << 32) | swap ((uint32) (value >> 32));
return (((std::int64_t) swap ((std::uint32_t) value)) << 32) | swap ((std::uint32_t) (value >> 32));
#endif
}
#if BEAST_LITTLE_ENDIAN
inline uint16 ByteOrder::swapIfBigEndian (const uint16 v) { return v; }
inline uint32 ByteOrder::swapIfBigEndian (const uint32 v) { return v; }
inline uint64 ByteOrder::swapIfBigEndian (const uint64 v) { return v; }
inline uint16 ByteOrder::swapIfLittleEndian (const uint16 v) { return swap (v); }
inline uint32 ByteOrder::swapIfLittleEndian (const uint32 v) { return swap (v); }
inline uint64 ByteOrder::swapIfLittleEndian (const uint64 v) { return swap (v); }
inline uint16 ByteOrder::littleEndianShort (const void* const bytes) { return *static_cast <const uint16*> (bytes); }
inline uint32 ByteOrder::littleEndianInt (const void* const bytes) { return *static_cast <const uint32*> (bytes); }
inline uint64 ByteOrder::littleEndianInt64 (const void* const bytes) { return *static_cast <const uint64*> (bytes); }
inline uint16 ByteOrder::bigEndianShort (const void* const bytes) { return swap (*static_cast <const uint16*> (bytes)); }
inline uint32 ByteOrder::bigEndianInt (const void* const bytes) { return swap (*static_cast <const uint32*> (bytes)); }
inline uint64 ByteOrder::bigEndianInt64 (const void* const bytes) { return swap (*static_cast <const uint64*> (bytes)); }
inline std::uint16_t ByteOrder::swapIfBigEndian (const std::uint16_t v) { return v; }
inline std::uint32_t ByteOrder::swapIfBigEndian (const std::uint32_t v) { return v; }
inline std::uint64_t ByteOrder::swapIfBigEndian (const std::uint64_t v) { return v; }
inline std::uint16_t ByteOrder::swapIfLittleEndian (const std::uint16_t v) { return swap (v); }
inline std::uint32_t ByteOrder::swapIfLittleEndian (const std::uint32_t v) { return swap (v); }
inline std::uint64_t ByteOrder::swapIfLittleEndian (const std::uint64_t v) { return swap (v); }
inline std::uint16_t ByteOrder::littleEndianShort (const void* const bytes) { return *static_cast <const std::uint16_t*> (bytes); }
inline std::uint32_t ByteOrder::littleEndianInt (const void* const bytes) { return *static_cast <const std::uint32_t*> (bytes); }
inline std::uint64_t ByteOrder::littleEndianInt64 (const void* const bytes) { return *static_cast <const std::uint64_t*> (bytes); }
inline std::uint16_t ByteOrder::bigEndianShort (const void* const bytes) { return swap (*static_cast <const std::uint16_t*> (bytes)); }
inline std::uint32_t ByteOrder::bigEndianInt (const void* const bytes) { return swap (*static_cast <const std::uint32_t*> (bytes)); }
inline std::uint64_t ByteOrder::bigEndianInt64 (const void* const bytes) { return swap (*static_cast <const std::uint64_t*> (bytes)); }
inline bool ByteOrder::isBigEndian() { return false; }
#else
inline uint16 ByteOrder::swapIfBigEndian (const uint16 v) { return swap (v); }
inline uint32 ByteOrder::swapIfBigEndian (const uint32 v) { return swap (v); }
inline uint64 ByteOrder::swapIfBigEndian (const uint64 v) { return swap (v); }
inline uint16 ByteOrder::swapIfLittleEndian (const uint16 v) { return v; }
inline uint32 ByteOrder::swapIfLittleEndian (const uint32 v) { return v; }
inline uint64 ByteOrder::swapIfLittleEndian (const uint64 v) { return v; }
inline uint32 ByteOrder::littleEndianInt (const void* const bytes) { return swap (*static_cast <const uint32*> (bytes)); }
inline uint16 ByteOrder::littleEndianShort (const void* const bytes) { return swap (*static_cast <const uint16*> (bytes)); }
inline uint16 ByteOrder::bigEndianShort (const void* const bytes) { return *static_cast <const uint16*> (bytes); }
inline uint32 ByteOrder::bigEndianInt (const void* const bytes) { return *static_cast <const uint32*> (bytes); }
inline uint64 ByteOrder::bigEndianInt64 (const void* const bytes) { return *static_cast <const uint64*> (bytes); }
inline std::uint16_t ByteOrder::swapIfBigEndian (const std::uint16_t v) { return swap (v); }
inline std::uint32_t ByteOrder::swapIfBigEndian (const std::uint32_t v) { return swap (v); }
inline std::uint64_t ByteOrder::swapIfBigEndian (const std::uint64_t v) { return swap (v); }
inline std::uint16_t ByteOrder::swapIfLittleEndian (const std::uint16_t v) { return v; }
inline std::uint32_t ByteOrder::swapIfLittleEndian (const std::uint32_t v) { return v; }
inline std::uint64_t ByteOrder::swapIfLittleEndian (const std::uint64_t v) { return v; }
inline std::uint32_t ByteOrder::littleEndianInt (const void* const bytes) { return swap (*static_cast <const std::uint32_t*> (bytes)); }
inline std::uint16_t ByteOrder::littleEndianShort (const void* const bytes) { return swap (*static_cast <const std::uint16_t*> (bytes)); }
inline std::uint16_t ByteOrder::bigEndianShort (const void* const bytes) { return *static_cast <const std::uint16_t*> (bytes); }
inline std::uint32_t ByteOrder::bigEndianInt (const void* const bytes) { return *static_cast <const std::uint32_t*> (bytes); }
inline std::uint64_t ByteOrder::bigEndianInt64 (const void* const bytes) { return *static_cast <const std::uint64_t*> (bytes); }
inline bool ByteOrder::isBigEndian() { return true; }
#endif
inline int ByteOrder::littleEndian24Bit (const char* const bytes) { return (((int) bytes[2]) << 16) | (((int) (uint8) bytes[1]) << 8) | ((int) (uint8) bytes[0]); }
inline int ByteOrder::bigEndian24Bit (const char* const bytes) { return (((int) bytes[0]) << 16) | (((int) (uint8) bytes[1]) << 8) | ((int) (uint8) bytes[2]); }
inline int ByteOrder::littleEndian24Bit (const char* const bytes) { return (((int) bytes[2]) << 16) | (((int) (std::uint8_t) bytes[1]) << 8) | ((int) (std::uint8_t) bytes[0]); }
inline int ByteOrder::bigEndian24Bit (const char* const bytes) { return (((int) bytes[0]) << 16) | (((int) (std::uint8_t) bytes[1]) << 8) | ((int) (std::uint8_t) bytes[2]); }
inline void ByteOrder::littleEndian24BitToChars (const int value, char* const destBytes) { destBytes[0] = (char)(value & 0xff); destBytes[1] = (char)((value >> 8) & 0xff); destBytes[2] = (char)((value >> 16) & 0xff); }
inline void ByteOrder::bigEndian24BitToChars (const int value, char* const destBytes) { destBytes[0] = (char)((value >> 16) & 0xff); destBytes[1] = (char)((value >> 8) & 0xff); destBytes[2] = (char)(value & 0xff); }
@@ -211,29 +212,29 @@ struct SwapBytes
// Specializations for signed integers
template <>
struct SwapBytes <int16>
struct SwapBytes <std::int16_t>
{
inline int16 operator() (int16 value) const noexcept
inline std::int16_t operator() (std::int16_t value) const noexcept
{
return static_cast <int16> (ByteOrder::swap (static_cast <uint16> (value)));
return static_cast <std::int16_t> (ByteOrder::swap (static_cast <std::uint16_t> (value)));
}
};
template <>
struct SwapBytes <int32>
struct SwapBytes <std::int32_t>
{
inline int32 operator() (int32 value) const noexcept
inline std::int32_t operator() (std::int32_t value) const noexcept
{
return static_cast <int32> (ByteOrder::swap (static_cast <uint32> (value)));
return static_cast <std::int32_t> (ByteOrder::swap (static_cast <std::uint32_t> (value)));
}
};
template <>
struct SwapBytes <int64>
struct SwapBytes <std::int64_t>
{
inline int64 operator() (int64 value) const noexcept
inline std::int64_t operator() (std::int64_t value) const noexcept
{
return static_cast <int64> (ByteOrder::swap (static_cast <uint64> (value)));
return static_cast <std::int64_t> (ByteOrder::swap (static_cast <std::uint64_t> (value)));
}
};

View File

@@ -1,88 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Portions of this file are from JUCE.
Copyright (c) 2013 - Raw Material Software Ltd.
Please visit http://www.juce.com
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.
*/
//==============================================================================
#ifndef BEAST_CSTDINT_H_INCLUDED
#define BEAST_CSTDINT_H_INCLUDED
#include "Config.h"
namespace beast {
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
#if BEAST_MSVC
typedef __int64 int64;
typedef unsigned __int64 uint64;
/** A platform-independent macro for writing 64-bit literals, needed because
different compilers have different syntaxes for this.
E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for
GCC, or 0x1000000000 for MSVC.
*/
#define literal64bit(longLiteral) ((__int64) longLiteral)
#else
/** A platform-independent 64-bit integer type. */
typedef long long int64;
/** A platform-independent 64-bit unsigned integer type. */
typedef unsigned long long uint64;
/** A platform-independent macro for writing 64-bit literals, needed because
different compilers have different syntaxes for this.
E.g. writing literal64bit (0x1000000000) will translate to 0x1000000000LL for
GCC, or 0x1000000000 for MSVC.
*/
#define literal64bit(longLiteral) (longLiteral##LL)
#endif
#if BEAST_64BIT
/** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef int64 pointer_sized_int;
/** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef uint64 pointer_sized_uint;
#elif BEAST_MSVC
/** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef _W64 int pointer_sized_int;
/** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef _W64 unsigned int pointer_sized_uint;
#else
/** A signed integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef int pointer_sized_int;
/** An unsigned integer type that's guaranteed to be large enough to hold a pointer without truncating it. */
typedef unsigned int pointer_sized_uint;
#endif
#if BEAST_MSVC
typedef pointer_sized_int ssize_t;
#endif
}
#endif

View File

@@ -27,8 +27,6 @@
#include "chrono/manual_clock.h"
#include "chrono/ratio_io.h"
#include "chrono/CPUMeter.h"
#include "chrono/RelativeTime.h"
#include "chrono/ScopedTimeInterval.h"
#endif

View File

@@ -26,6 +26,9 @@
// VFALCO NOTE this is analogous to <boost/config.hpp>
// Assert to boost that we always have std::array support
#define BOOST_ASIO_HAS_STD_ARRAY 1
#if !defined(BEAST_COMPILER_CONFIG) && !defined(BEAST_NO_COMPILER_CONFIG) && !defined(BEAST_NO_CONFIG)
#include "config/SelectCompilerConfig.h"
#endif

View File

@@ -1,166 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_FIXEDARRAY_H_INCLUDED
#define BEAST_FIXEDARRAY_H_INCLUDED
#include "Config.h"
#include <cstddef>
#include <iterator>
#include <stdexcept>
namespace beast {
// Ideas from Boost
/** An array whose size is determined at compile-time.
The interface tries to follow std::vector as closely as possible within
the limitations of having a fixed size.
*/
template <class T, std::size_t N>
class FixedArray
{
public:
T values [N];
typedef T value_type;
typedef T* iterator;
typedef T const* const_iterator;
typedef T& reference;
typedef T const& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// iterators
iterator begin() { return values; }
const_iterator begin() const { return values; }
const_iterator cbegin() const { return values; }
iterator end() { return values+N; }
const_iterator end() const { return values+N; }
const_iterator cend() const { return values+N; }
typedef std::reverse_iterator <iterator> reverse_iterator;
typedef std::reverse_iterator <const_iterator> const_reverse_iterator;
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
const_reverse_iterator crend() const { return const_reverse_iterator(begin()); }
reference operator[](size_type i)
{
bassert (i < N);
return values[i];
}
const_reference operator[](size_type i) const
{
bassert (i < N);
return values[i];
}
reference at(size_type i) { rangecheck(i); return values[i]; }
const_reference at(size_type i) const { rangecheck(i); return values[i]; }
reference front() { return values[0]; }
reference back() { return values[N-1]; }
const_reference front () const { return values[0]; }
const_reference back() const { return values[N-1]; }
static size_type size() { return N; }
static bool empty() { return false; }
static size_type max_size() { return N; }
enum { static_size = N };
T const* data() const { return values; }
T* data() { return values; }
T* c_array() { return values; }
template <typename T2>
FixedArray<T,N>& operator= (FixedArray<T2,N> const& rhs)
{
std::copy (rhs.begin(), rhs.end(), begin());
return *this;
}
void assign (T const& value) { fill (value); }
void fill (T const& value)
{
std::fill_n (begin(), size(), value);
}
void clear ()
{
fill (T ());
}
static void rangecheck (size_type i)
{
if (i >= size())
throw std::out_of_range ("FixedArray<>: index out of range");
}
};
//------------------------------------------------------------------------------
template <class T, std::size_t N>
bool operator== (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return std::equal (lhs.begin(), lhs.end(), rhs.begin());
}
template <class T, std::size_t N>
bool operator!= (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return !(lhs==rhs);
}
template <class T, std::size_t N>
bool operator< (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return std::lexicographical_compare (
lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
template <class T, std::size_t N>
bool operator> (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return rhs<lhs;
}
template <class T, std::size_t N>
bool operator<= (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return !(rhs<lhs);
}
template <class T, std::size_t N>
bool operator>= (FixedArray <T, N> const& lhs, FixedArray <T, N> const& rhs)
{
return !(lhs<rhs);
}
}
#endif

View File

@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_HTTP_H_INCLUDED
#define BEAST_HTTP_H_INCLUDED
#include "http/URL.h"
#include "http/ParsedURL.h"
#endif

View File

@@ -119,7 +119,7 @@ namespace HeapBlockHelper
then a failed allocation will just leave the heapblock with a null pointer (assuming
that the system's malloc() function doesn't throw).
@see Array, OwnedArray, MemoryBlock
@see Array, MemoryBlock
*/
template <class ElementType, bool throwOnFailure = false>
class HeapBlock : public Uncopyable
@@ -294,7 +294,7 @@ public:
The semantics of this method are the same as malloc() and calloc(), but it
uses realloc() to keep as much of the existing data as possible.
*/
void realloc (const size_t newNumElements, const size_t elementSize = sizeof (ElementType))
void reallocate (const size_t newNumElements, const size_t elementSize = sizeof (ElementType))
{
data = static_cast <ElementType*> (data == nullptr ? std::malloc (newNumElements * elementSize)
: std::realloc (data, newNumElements * elementSize));
@@ -304,7 +304,7 @@ public:
/** Frees any currently-allocated data.
This will free the data and reset this object to be a null pointer.
*/
void free()
void free_up()
{
std::free (data);
data = nullptr;
@@ -339,10 +339,6 @@ private:
{
HeapBlockHelper::ThrowOnFail<throwOnFailure>::check (data);
}
#if ! (defined (BEAST_DLL) || defined (BEAST_DLL_BUILD))
BEAST_PREVENT_HEAP_ALLOCATION // Creating a 'new HeapBlock' would be missing the point!
#endif
};
}

View File

@@ -78,7 +78,7 @@ Type* createCopyIfNotNull (const Type* pointer)
/** A handy C++ wrapper that creates and deletes an NSAutoreleasePool object using RAII.
You should use the BEAST_AUTORELEASEPOOL macro to create a local auto-release pool on the stack.
*/
class BEAST_API ScopedAutoReleasePool : public Uncopyable
class ScopedAutoReleasePool : public Uncopyable
{
public:
ScopedAutoReleasePool();

View File

@@ -1,31 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_NET_H_INCLUDED
#define BEAST_NET_H_INCLUDED
#include "net/BufferType.h"
#include "net/DynamicBuffer.h"
#include "net/IPEndpoint.h"
#include "net/IPAddressV4.h"
#include "net/IPAddressV6.h"
#include "net/IPEndpoint.h"
#endif

View File

@@ -1,95 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_SAFEBOOL_H_INCLUDED
#define BEAST_SAFEBOOL_H_INCLUDED
namespace beast {
namespace detail {
class SafeBoolBase
{
private:
void disallowed () const { }
public:
void allowed () const { }
protected:
typedef void (SafeBoolBase::*boolean_t) () const;
SafeBoolBase () { }
SafeBoolBase (SafeBoolBase const&) { }
SafeBoolBase& operator= (SafeBoolBase const&)
{
return *this;
}
~SafeBoolBase () { }
};
}
/** Safe evaluation of class as `bool`.
This allows a class to be safely evaluated as a bool without the usual
harmful side effects of the straightforward operator conversion approach.
To use it, derive your class from SafeBool and implement `asBoolean()` as:
@code
bool asBoolean () const;
@endcode
Ideas from http://www.artima.com/cppsource/safebool.html
@class SafeBool
*/
template <typename T = void>
class SafeBool : public detail::SafeBoolBase
{
public:
operator detail::SafeBoolBase::boolean_t () const
{
return (static_cast <T const*> (this))->asBoolean ()
? &SafeBoolBase::allowed : 0;
}
protected:
~SafeBool () { }
};
template <typename T, typename U>
void operator== (SafeBool <T> const& lhs, SafeBool <U> const& rhs)
{
lhs.disallowed ();
}
template <typename T, typename U>
void operator!= (SafeBool <T> const& lhs, SafeBool <U> const& rhs)
{
lhs.disallowed ();
}
}
#endif

View File

@@ -22,7 +22,6 @@
#include "Config.h"
#include "smart_ptr/AbstractObject.h"
#include "smart_ptr/ContainerDeletePolicy.h"
#include "smart_ptr/SharedObject.h"
#include "smart_ptr/SharedPtr.h"

View File

@@ -20,7 +20,6 @@
#ifndef BEAST_THREADS_H_INCLUDED
#define BEAST_THREADS_H_INCLUDED
#include "threads/LockGuard.h"
#include "threads/UnlockGuard.h"
#include "threads/TryLockGuard.h"
#include "threads/SharedLockGuard.h"

View File

@@ -1,27 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_TYPETRAITS_H_INCLUDED
#define BEAST_TYPETRAITS_H_INCLUDED
#include "type_traits/IntegralConstant.h"
#include "type_traits/IsIntegral.h"
#include "type_traits/IsSigned.h"
#endif

View File

@@ -1,33 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_UTILITY_H_INCLUDED
#define BEAST_UTILITY_H_INCLUDED
#include "utility/Debug.h"
#include "utility/Error.h"
#include "utility/Journal.h"
#include "utility/LeakChecked.h"
#include "utility/PropertyStream.h"
#include "utility/StaticObject.h"
#include "utility/hash_pair.h"
#endif

View File

@@ -17,6 +17,16 @@
*/
//==============================================================================
#include "BeastConfig.h"
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../BeastConfig.h"
#endif
#include "impl/IPAddressConversion.cpp"
#include "tests/wrap_handler.test.cpp"
#include "tests/bind_handler.test.cpp"
#include "tests/enable_wait_for_async.test.cpp"
#include "tests/shared_handler.test.cpp"
#include "abstract_socket.cpp" // TEMPORARY!

View File

@@ -0,0 +1,14 @@
# beast::asio
Wrappers and utilities to make working with boost::asio easier.
## Rules for asynchronous objects
If an object calls asynchronous initiating functions it must either:
1. Manage its lifetime by being reference counted
or
2. Wait for all pending completion handlers to be called before
allowing itself to be destroyed.

View File

@@ -0,0 +1,217 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#include "abstract_socket.h"
#include "bind_handler.h"
namespace beast {
namespace asio {
#if ! BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
//------------------------------------------------------------------------------
//
// Socket
//
//------------------------------------------------------------------------------
void* abstract_socket::this_layer_ptr (char const*) const
{
pure_virtual_called ();
return nullptr;
}
//------------------------------------------------------------------------------
//
// native_handle
//
//------------------------------------------------------------------------------
bool abstract_socket::native_handle (char const*, void*)
{
pure_virtual_called ();
return false;
}
//------------------------------------------------------------------------------
//
// basic_io_object
//
//------------------------------------------------------------------------------
boost::asio::io_service& abstract_socket::get_io_service ()
{
pure_virtual_called ();
return *static_cast <boost::asio::io_service*>(nullptr);
}
//------------------------------------------------------------------------------
//
// basic_socket
//
//------------------------------------------------------------------------------
void*
abstract_socket::lowest_layer_ptr (char const*) const
{
pure_virtual_called ();
return nullptr;
}
auto
abstract_socket::cancel (boost::system::error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
auto
abstract_socket::shutdown (shutdown_type, boost::system::error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
auto
abstract_socket::close (boost::system::error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
//------------------------------------------------------------------------------
//
// basic_socket_acceptor
//
//------------------------------------------------------------------------------
auto
abstract_socket::accept (abstract_socket&, error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
void
abstract_socket::async_accept (abstract_socket&, error_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error()));
}
//------------------------------------------------------------------------------
//
// basic_stream_socket
//
//------------------------------------------------------------------------------
std::size_t
abstract_socket::read_some (mutable_buffers, error_code& ec)
{
ec = pure_virtual_error ();
return 0;
}
std::size_t
abstract_socket::write_some (const_buffers, error_code& ec)
{
ec = pure_virtual_error ();
return 0;
}
void
abstract_socket::async_read_some (mutable_buffers, transfer_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error(), 0));
}
void
abstract_socket::async_write_some (const_buffers, transfer_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error(), 0));
}
//------------------------------------------------------------------------------
//
// ssl::stream
//
//------------------------------------------------------------------------------
void*
abstract_socket::next_layer_ptr (char const*) const
{
pure_virtual_called ();
return nullptr;
}
bool
abstract_socket::needs_handshake ()
{
return false;
}
void
abstract_socket::set_verify_mode (int)
{
pure_virtual_called ();
}
auto
abstract_socket::handshake (handshake_type, error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
void
abstract_socket::async_handshake (handshake_type, error_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error()));
}
auto
abstract_socket::handshake (handshake_type, const_buffers, error_code& ec) ->
error_code
{
return pure_virtual_error (ec);
}
void
abstract_socket::async_handshake (handshake_type, const_buffers,
transfer_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error(), 0));
}
auto
abstract_socket::shutdown (error_code& ec) -> error_code
{
return pure_virtual_error (ec);
}
void
abstract_socket::async_shutdown (error_handler handler)
{
get_io_service ().post (bind_handler (
handler, pure_virtual_error()));
}
#endif
}
}

View File

@@ -17,8 +17,28 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_SOCKETS_SOCKET_H_INCLUDED
#define BEAST_ASIO_SOCKETS_SOCKET_H_INCLUDED
#ifndef BEAST_ASIO_ABSTRACT_SOCKET_H_INCLUDED
#define BEAST_ASIO_ABSTRACT_SOCKET_H_INCLUDED
#include "buffer_sequence.h"
#include "shared_handler.h"
#include <boost/asio/socket_base.hpp>
#include <boost/asio/ssl/stream_base.hpp>
// Checking overrides replaces unimplemented stubs with pure virtuals
#ifndef BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
# define BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES 1
#endif
#if BEAST_COMPILER_CHECKS_SOCKET_OVERRIDES
# define BEAST_SOCKET_VIRTUAL = 0
#else
# define BEAST_SOCKET_VIRTUAL
#endif
namespace beast {
namespace asio {
/** A high level socket abstraction.
@@ -29,18 +49,61 @@
When member functions are called and the underlying implementation does
not support the operation, a fatal error is generated.
*/
class Socket
: public SocketBase
, public boost::asio::ssl::stream_base
class abstract_socket
: public boost::asio::ssl::stream_base
, public boost::asio::socket_base
{
protected:
typedef boost::system::error_code error_code;
typedef asio::shared_handler <void (void)> post_handler;
typedef asio::shared_handler <void (error_code)> error_handler;
typedef asio::shared_handler <
void (error_code, std::size_t)> transfer_handler;
static
void
pure_virtual_called()
{
throw std::runtime_error ("pure virtual called");
}
static
error_code
pure_virtual_error ()
{
pure_virtual_called();
return boost::system::errc::make_error_code (
boost::system::errc::function_not_supported);
}
static
error_code
pure_virtual_error (error_code& ec)
{
return ec = pure_virtual_error();
}
static
void
throw_if (error_code const& ec)
{
if (ec)
throw boost::system::system_error (ec);
}
public:
virtual ~Socket ();
virtual ~abstract_socket ()
{
}
//--------------------------------------------------------------------------
//
// Socket
// abstract_socket
//
//--------------------------------------------------------------------------
/** Retrieve the underlying object.
@@ -48,32 +111,32 @@ public:
exception is thrown if trying to acquire a reference.
*/
/** @{ */
template <typename Object>
template <class Object>
Object& this_layer ()
{
Object* object (this->this_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object const& this_layer () const
{
Object const* object (this->this_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object* this_layer_ptr ()
{
return static_cast <Object*> (
this->this_layer_ptr (typeid (Object).name ()));
}
template <typename Object>
template <class Object>
Object const* this_layer_ptr () const
{
return static_cast <Object const*> (
@@ -88,6 +151,7 @@ public:
//
// native_handle
//
//--------------------------------------------------------------------------
/** Retrieve the native representation of the object.
@@ -101,7 +165,7 @@ public:
void native_handle (Handle* dest)
{
if (! native_handle (typeid (Handle).name (), dest))
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
}
virtual bool native_handle (char const* type_name, void* dest)
@@ -111,6 +175,7 @@ public:
//
// basic_io_object
//
//--------------------------------------------------------------------------
virtual boost::asio::io_service& get_io_service ()
BEAST_SOCKET_VIRTUAL;
@@ -119,6 +184,7 @@ public:
//
// basic_socket
//
//--------------------------------------------------------------------------
/** Retrieve the lowest layer object.
@@ -126,32 +192,32 @@ public:
exception is thrown if trying to acquire a reference.
*/
/** @{ */
template <typename Object>
template <class Object>
Object& lowest_layer ()
{
Object* object (this->lowest_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object const& lowest_layer () const
{
Object const* object (this->lowest_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object* lowest_layer_ptr ()
{
return static_cast <Object*> (
this->lowest_layer_ptr (typeid (Object).name ()));
}
template <typename Object>
template <class Object>
Object const* lowest_layer_ptr () const
{
return static_cast <Object const*> (
@@ -167,7 +233,8 @@ public:
void cancel ()
{
error_code ec;
throw_error (cancel (ec), __FILE__, __LINE__);
cancel (ec);
throw_if (ec);
}
virtual error_code cancel (error_code& ec)
@@ -176,7 +243,8 @@ public:
void shutdown (shutdown_type what)
{
error_code ec;
throw_error (shutdown (what, ec), __FILE__, __LINE__);
shutdown (what, ec);
throw_if (ec);
}
virtual error_code shutdown (shutdown_type what,
@@ -186,7 +254,8 @@ public:
void close ()
{
error_code ec;
throw_error (close (ec), __FILE__, __LINE__);
close (ec);
throw_if (ec);
}
virtual error_code close (error_code& ec)
@@ -196,82 +265,39 @@ public:
//
// basic_socket_acceptor
//
//--------------------------------------------------------------------------
virtual error_code accept (Socket& peer, error_code& ec)
virtual error_code accept (abstract_socket& peer, error_code& ec)
BEAST_SOCKET_VIRTUAL;
template <typename AcceptHandler>
void async_accept (Socket& peer, BOOST_ASIO_MOVE_ARG(AcceptHandler) handler)
{
return async_accept (peer,
newAcceptHandler (BOOST_ASIO_MOVE_CAST(AcceptHandler)(handler)));
}
virtual void async_accept (Socket& peer, SharedHandlerPtr handler)
virtual void async_accept (abstract_socket& peer, error_handler handler)
BEAST_SOCKET_VIRTUAL;
//--------------------------------------------------------------------------
//
// basic_stream_socket
//
//--------------------------------------------------------------------------
// SyncReadStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncReadStream.html
//
template <typename MutableBufferSequence>
std::size_t read_some (MutableBufferSequence const& buffers,
error_code& ec)
{
return read_some (MutableBuffers (buffers), ec);
}
virtual std::size_t read_some (MutableBuffers const& buffers, error_code& ec)
virtual std::size_t read_some (mutable_buffers buffers, error_code& ec)
BEAST_SOCKET_VIRTUAL;
// SyncWriteStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/SyncWriteStream.html
//
template <typename ConstBufferSequence>
std::size_t write_some (ConstBufferSequence const& buffers, error_code &ec)
{
return write_some (ConstBuffers (buffers), ec);
}
virtual std::size_t write_some (ConstBuffers const& buffers, error_code& ec)
virtual std::size_t write_some (const_buffers buffers, error_code& ec)
BEAST_SOCKET_VIRTUAL;
// AsyncReadStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncReadStream.html
//
template <typename MutableBufferSequence, typename ReadHandler>
void async_read_some (MutableBufferSequence const& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
return async_read_some (MutableBuffers (buffers),
newReadHandler (BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)));
}
virtual void async_read_some (MutableBuffers const& buffers, SharedHandlerPtr handler)
virtual void async_read_some (mutable_buffers buffers,
transfer_handler handler)
BEAST_SOCKET_VIRTUAL;
// AsyncWriteStream
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/AsyncWriteStream.html
//
template <typename ConstBufferSequence, typename WriteHandler>
void async_write_some (ConstBufferSequence const& buffers,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
return async_write_some (ConstBuffers (buffers),
newWriteHandler (BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)));
}
virtual void async_write_some (ConstBuffers const& buffers, SharedHandlerPtr handler)
virtual void async_write_some (const_buffers buffers,
transfer_handler handler)
BEAST_SOCKET_VIRTUAL;
//--------------------------------------------------------------------------
//
// ssl::stream
//
//--------------------------------------------------------------------------
/** Retrieve the next layer object.
@@ -279,32 +305,32 @@ public:
exception is thrown if trying to acquire a reference.
*/
/** @{ */
template <typename Object>
template <class Object>
Object& next_layer ()
{
Object* object (this->next_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object const& next_layer () const
{
Object const* object (this->next_layer_ptr <Object> ());
if (object == nullptr)
Throw (std::bad_cast (), __FILE__, __LINE__);
throw std::bad_cast ();
return *object;
}
template <typename Object>
template <class Object>
Object* next_layer_ptr ()
{
return static_cast <Object*> (
this->next_layer_ptr (typeid (Object).name ()));
}
template <typename Object>
template <class Object>
Object const* next_layer_ptr () const
{
return static_cast <Object const*> (
@@ -330,107 +356,49 @@ public:
virtual bool needs_handshake ()
BEAST_SOCKET_VIRTUAL;
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__verify_mode.html
//
virtual void set_verify_mode (int verify_mode) = 0;
virtual void set_verify_mode (int verify_mode)
BEAST_SOCKET_VIRTUAL;
// ssl::stream::handshake (1 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload1.html
//
void handshake (handshake_type type)
{
error_code ec;
throw_error (handshake (type, ec), __FILE__, __LINE__);
handshake (type, ec);
throw_if (ec);
}
// ssl::stream::handshake (2 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload2.html
//
virtual error_code handshake (handshake_type type, error_code& ec)
BEAST_SOCKET_VIRTUAL;
// ssl::stream::async_handshake (1 of 2)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload1.html
//
template <typename HandshakeHandler>
void async_handshake (handshake_type type, BOOST_ASIO_MOVE_ARG(HandshakeHandler) handler)
{
return async_handshake (type,
newHandshakeHandler (BOOST_ASIO_MOVE_CAST(HandshakeHandler)(handler)));
}
virtual void async_handshake (handshake_type type, SharedHandlerPtr handler)
virtual void async_handshake (handshake_type type, error_handler handler)
BEAST_SOCKET_VIRTUAL;
//--------------------------------------------------------------------------
#if BEAST_ASIO_HAS_BUFFEREDHANDSHAKE
// ssl::stream::handshake (3 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload3.html
//
template <typename ConstBufferSequence>
void handshake (handshake_type type, ConstBufferSequence const& buffers)
{
error_code ec;
throw_error (handshake (type, buffers, ec), __FILE__, __LINE__);
}
// ssl::stream::handshake (4 of 4)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/handshake/overload4.html
//
template <typename ConstBufferSequence>
error_code handshake (handshake_type type,
ConstBufferSequence const& buffers, error_code& ec)
{
return handshake (type, ConstBuffers (buffers), ec);
}
virtual error_code handshake (handshake_type type,
ConstBuffers const& buffers, error_code& ec)
BEAST_SOCKET_VIRTUAL;
const_buffers buffers, error_code& ec)
BEAST_SOCKET_VIRTUAL;
// ssl::stream::async_handshake (2 of 2)
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_handshake/overload2.html
//
template <typename ConstBufferSequence, typename BufferedHandshakeHandler>
void async_handshake (handshake_type type, ConstBufferSequence const& buffers,
BOOST_ASIO_MOVE_ARG(BufferedHandshakeHandler) handler)
{
return async_handshake (type, ConstBuffers (buffers),
newBufferedHandshakeHandler (BOOST_ASIO_MOVE_CAST(BufferedHandshakeHandler)(handler)));
}
virtual void async_handshake (handshake_type type, ConstBuffers const& buffers,
SharedHandlerPtr handler)
BEAST_SOCKET_VIRTUAL;
#endif
virtual void async_handshake (handshake_type type,
const_buffers buffers, transfer_handler handler)
BEAST_SOCKET_VIRTUAL;
//--------------------------------------------------------------------------
// ssl::stream::shutdown
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/shutdown.html
//
void shutdown ()
{
error_code ec;
throw_error (shutdown (ec), __FILE__, __LINE__);
shutdown (ec);
throw_if (ec);
}
virtual error_code shutdown (error_code& ec)
BEAST_SOCKET_VIRTUAL;
// ssl::stream::async_shutdown
// http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/reference/ssl__stream/async_shutdown.html
//
template <typename ShutdownHandler>
void async_shutdown (BOOST_ASIO_MOVE_ARG(ShutdownHandler) handler)
{
return async_shutdown (
newShutdownHandler (BOOST_ASIO_MOVE_CAST(ShutdownHandler)(handler)));
}
virtual void async_shutdown (SharedHandlerPtr handler)
virtual void async_shutdown (error_handler handler)
BEAST_SOCKET_VIRTUAL;
};
}
}
#endif

View File

@@ -0,0 +1,163 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_BIND_HANDLER_H_INCLUDED
#define BEAST_ASIO_BIND_HANDLER_H_INCLUDED
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <functional>
#include "../cxx14/type_traits.h" // <type_traits>
#include "../cxx14/utility.h" // <utility>
namespace beast {
namespace asio {
namespace detail {
/** Nullary handler that calls Handler with bound arguments.
The rebound handler provides the same io_service execution
guarantees as the original handler.
*/
template <class DeducedHandler, class... Args>
class bound_handler
{
private:
typedef std::tuple <std::decay_t <Args>...> args_type;
std::decay_t <DeducedHandler> m_handler;
args_type m_args;
template <class Handler, class Tuple, std::size_t... S>
static void invoke (Handler& h, Tuple& args,
std::index_sequence <S...>)
{
h (std::get <S> (args)...);
}
public:
typedef void result_type;
bound_handler (DeducedHandler&& handler, Args&&... args)
: m_handler (std::forward <DeducedHandler> (handler))
, m_args (std::forward <Args> (args)...)
{
}
void
operator() ()
{
invoke (m_handler, m_args,
std::index_sequence_for <Args...> ());
}
void
operator() () const
{
invoke (m_handler, m_args,
std::index_sequence_for <Args...> ());
}
template <class Function>
friend
void
asio_handler_invoke (Function& f, bound_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_handler);
}
template <class Function>
friend
void
asio_handler_invoke (Function const& f, bound_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_handler);
}
friend
void*
asio_handler_allocate (std::size_t size, bound_handler* h)
{
return boost_asio_handler_alloc_helpers::
allocate (size, h->m_handler);
}
friend
void
asio_handler_deallocate (void* p, std::size_t size, bound_handler* h)
{
boost_asio_handler_alloc_helpers::
deallocate (p, size, h->m_handler);
}
friend
bool
asio_handler_is_continuation (bound_handler* h)
{
return boost_asio_handler_cont_helpers::
is_continuation (h->m_handler);
}
};
}
//------------------------------------------------------------------------------
/** Binds parameters to a handler to produce a nullary functor.
The returned handler provides the same io_service execution guarantees
as the original handler. This is designed to use as a replacement for
io_service::wrap, to ensure that the handler will not be invoked
immediately by the calling function.
*/
template <class DeducedHandler, class... Args>
detail::bound_handler <DeducedHandler, Args...>
bind_handler (DeducedHandler&& handler, Args&&... args)
{
return detail::bound_handler <DeducedHandler, Args...> (
std::forward <DeducedHandler> (handler),
std::forward <Args> (args)...);
}
}
}
//------------------------------------------------------------------------------
namespace std {
template <class Handler, class... Args>
void bind (beast::asio::detail::bound_handler <
Handler, Args...>, ...) = delete;
#if 0
template <class Handler, class... Args>
struct is_bind_expression <
beast::asio::detail::bound_handler <Handler, Args...>
> : std::true_type
{
};
#endif
}
#endif

View File

@@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_BUFFER_SEQUENCE_H_INCLUDED
#define BEAST_ASIO_BUFFER_SEQUENCE_H_INCLUDED
#include <boost/asio/buffer.hpp>
#include "../utility/noexcept.h"
#include <algorithm>
#include <iterator>
#include "../cxx14/type_traits.h" // <type_traits>
#include <vector>
namespace beast {
namespace asio {
template <class Buffer>
class buffer_sequence
{
private:
typedef std::vector <Buffer> sequence_type;
public:
typedef Buffer value_type;
typedef typename sequence_type::const_iterator const_iterator;
private:
sequence_type m_buffers;
template <class FwdIter>
void assign (FwdIter first, FwdIter last)
{
m_buffers.clear();
m_buffers.reserve (std::distance (first, last));
for (;first != last; ++first)
m_buffers.push_back (*first);
}
public:
buffer_sequence ()
{
}
template <
class BufferSequence,
class = std::enable_if_t <std::is_constructible <
Buffer, typename BufferSequence::value_type>::value>
>
buffer_sequence (BufferSequence const& s)
{
assign (std::begin (s), std::end (s));
}
template <
class FwdIter,
class = std::enable_if_t <std::is_constructible <
Buffer, typename std::iterator_traits <
FwdIter>::value_type>::value>
>
buffer_sequence (FwdIter first, FwdIter last)
{
assign (first, last);
}
template <class BufferSequence>
std::enable_if_t <std::is_constructible <
Buffer, typename BufferSequence::value_type>::value,
buffer_sequence&
>
operator= (BufferSequence const& s)
{
return assign (s);
}
const_iterator
begin () const noexcept
{
return m_buffers.begin ();
}
const_iterator
end () const noexcept
{
return m_buffers.end ();
}
#if 0
template <class ConstBufferSequence>
void
assign (ConstBufferSequence const& buffers)
{
auto const n (std::distance (
std::begin (buffers), std::end (buffers)));
for (int i = 0, auto iter (std::begin (buffers));
iter != std::end (buffers); ++iter, ++i)
m_buffers[i] = Buffer (boost::asio::buffer_cast <void*> (
*iter), boost::asio::buffer_size (*iter));
}
#endif
};
typedef buffer_sequence <boost::asio::const_buffer> const_buffers;
typedef buffer_sequence <boost::asio::mutable_buffer> mutable_buffers;
}
}
#endif

View File

@@ -0,0 +1,265 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_ENABLE_WAIT_FOR_ASYNC_H_INCLUDED
#define BEAST_ASIO_ENABLE_WAIT_FOR_ASYNC_H_INCLUDED
#include "wrap_handler.h"
#include "../utility/is_call_possible.h"
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include "../cxx14/type_traits.h" // <type_traits>
namespace beast {
namespace asio {
namespace detail {
template <class Owner, class Handler>
class ref_counted_wrapped_handler
{
private:
static_assert (std::is_same <std::decay_t <Owner>, Owner>::value,
"Owner cannot be a const or reference type");
Handler m_handler;
std::reference_wrapper <Owner> m_owner;
bool m_continuation;
public:
ref_counted_wrapped_handler (Owner& owner,
Handler&& handler, bool continuation)
: m_handler (std::move (handler))
, m_owner (owner)
, m_continuation (continuation ? true :
boost_asio_handler_cont_helpers::is_continuation (m_handler))
{
m_owner.get().increment();
}
ref_counted_wrapped_handler (Owner& owner,
Handler const& handler, bool continuation)
: m_handler (handler)
, m_owner (owner)
, m_continuation (continuation ? true :
boost_asio_handler_cont_helpers::is_continuation (m_handler))
{
m_owner.get().increment();
}
~ref_counted_wrapped_handler ()
{
m_owner.get().decrement();
}
ref_counted_wrapped_handler (ref_counted_wrapped_handler const& other)
: m_handler (other.m_handler)
, m_owner (other.m_owner)
, m_continuation (other.m_continuation)
{
m_owner.get().increment();
}
ref_counted_wrapped_handler (ref_counted_wrapped_handler&& other)
: m_handler (std::move (other.m_handler))
, m_owner (other.m_owner)
, m_continuation (other.m_continuation)
{
m_owner.get().increment();
}
ref_counted_wrapped_handler& operator= (
ref_counted_wrapped_handler const&) = delete;
template <class... Args>
void
operator() (Args&&... args)
{
m_handler (std::forward <Args> (args)...);
}
template <class... Args>
void
operator() (Args&&... args) const
{
m_handler (std::forward <Args> (args)...);
}
template <class Function>
friend
void
asio_handler_invoke (Function& f,
ref_counted_wrapped_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_handler);
}
template <class Function>
friend
void
asio_handler_invoke (Function const& f,
ref_counted_wrapped_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_handler);
}
friend
void*
asio_handler_allocate (std::size_t size,
ref_counted_wrapped_handler* h)
{
return boost_asio_handler_alloc_helpers::
allocate (size, h->m_handler);
}
friend
void
asio_handler_deallocate (void* p, std::size_t size,
ref_counted_wrapped_handler* h)
{
boost_asio_handler_alloc_helpers::
deallocate (p, size, h->m_handler);
}
friend
bool
asio_handler_is_continuation (ref_counted_wrapped_handler* h)
{
return h->m_continuation;
}
};
}
//------------------------------------------------------------------------------
/** Facilitates blocking until no completion handlers are remaining.
If Derived has this member function:
@code
void on_wait_for_async (void)
@endcode
Then it will be called every time the number of pending completion
handlers transitions to zero from a non-zero value. The call is made
while holding the internal mutex.
*/
template <class Derived>
class enable_wait_for_async
{
private:
BEAST_DEFINE_IS_CALL_POSSIBLE(
has_on_wait_for_async,on_wait_for_async);
void increment()
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
++m_count;
}
void notify (std::true_type)
{
static_cast <Derived*> (this)->on_wait_for_async();
}
void notify (std::false_type)
{
}
void decrement()
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
--m_count;
if (m_count == 0)
{
m_cond.notify_all();
notify (std::integral_constant <bool,
has_on_wait_for_async<Derived, void(void)>::value>());
}
}
template <class Owner, class Handler>
friend class detail::ref_counted_wrapped_handler;
std::mutex m_mutex;
std::condition_variable m_cond;
std::size_t m_count;
public:
/** Blocks if there are any pending completion handlers. */
void
wait_for_async()
{
std::unique_lock <decltype (m_mutex)> lock (m_mutex);
while (m_count != 0)
m_cond.wait (lock);
}
protected:
enable_wait_for_async()
: m_count (0)
{
}
~enable_wait_for_async()
{
assert (m_count == 0);
}
/** Wraps the specified handler so it can be counted. */
/** @{ */
template <class Handler>
detail::ref_counted_wrapped_handler <
enable_wait_for_async,
std::remove_reference_t <Handler>
>
wrap_with_counter (Handler&& handler, bool continuation = false)
{
return detail::ref_counted_wrapped_handler <enable_wait_for_async,
std::remove_reference_t <Handler>> (*this,
std::forward <Handler> (handler), continuation);
}
template <class Handler>
detail::ref_counted_wrapped_handler <
enable_wait_for_async,
std::remove_reference_t <Handler>
>
wrap_with_counter (continuation_t, Handler&& handler)
{
return detail::ref_counted_wrapped_handler <enable_wait_for_async,
std::remove_reference_t <Handler>> (*this,
std::forward <Handler> (handler), true);
}
/** @} */
};
}
}
#endif

View File

@@ -33,7 +33,7 @@ Endpoint from_asio (boost::asio::ip::address const& address)
}
// VFALCO TODO IPv6 support
bassertfalse;
assert(false);
return Endpoint();
}
@@ -52,7 +52,7 @@ boost::asio::ip::address to_asio_address (Endpoint const& endpoint)
}
// VFALCO TODO IPv6 support
bassertfalse;
assert(false);
return boost::asio::ip::address (
boost::asio::ip::address_v6 ());
}

View File

@@ -0,0 +1,426 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_MEMORY_BUFFER_H_INCLUDED
#define BEAST_ASIO_MEMORY_BUFFER_H_INCLUDED
#include "../utility/empty_base_optimization.h"
#include <boost/asio/buffer.hpp>
#include "../utility/noexcept.h"
#include <cstddef>
#include <memory>
#include <type_traits>
namespace beast {
namespace asio {
template <
class T,
class Alloc = std::allocator <T>
>
class memory_buffer
: private empty_base_optimization <Alloc>
{
private:
static_assert (std::is_same <char, T>::value ||
std::is_same <unsigned char, T>::value,
"memory_buffer only works with char and unsigned char");
typedef empty_base_optimization <Alloc> Base;
using AllocTraits = std::allocator_traits <Alloc>;
T* m_base;
std::size_t m_size;
public:
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T& reference;
typedef T const& const_reference;
typedef T* pointer;
typedef T const* const_pointer;
typedef Alloc allocator_type;
typedef T* iterator;
typedef T const* const_iterator;
typedef std::reverse_iterator <iterator> reverse_iterator;
typedef std::reverse_iterator <const_iterator> const_reverse_iterator;
memory_buffer ()
: m_base (nullptr)
, m_size (0)
{
}
memory_buffer (memory_buffer&& other)
: Base (std::move (other))
, m_base (other.m_base)
, m_size (other.m_size)
{
other.m_base = nullptr;
other.m_size = 0;
}
explicit memory_buffer (size_type n)
: m_base (AllocTraits::allocate (Base::member(), n))
, m_size (n)
{
}
explicit memory_buffer (Alloc const& alloc)
: Base (alloc)
, m_base (nullptr)
, m_size (0)
{
}
memory_buffer (size_type n, Alloc const& alloc)
: Base (alloc)
, m_base (AllocTraits::allocate (Base::member(), n))
, m_size (n)
{
}
~memory_buffer()
{
if (m_base != nullptr)
AllocTraits::deallocate (Base::member(), m_base, m_size);
}
memory_buffer& operator= (memory_buffer const&) = delete;
allocator_type
get_allocator() const
{
return Base::member;
}
//
// asio support
//
boost::asio::mutable_buffer
buffer()
{
return boost::asio::mutable_buffer (
data(), bytes());
}
boost::asio::const_buffer
buffer() const
{
return boost::asio::const_buffer (
data(), bytes());
}
boost::asio::mutable_buffers_1
buffers()
{
return boost::asio::mutable_buffers_1 (
data(), bytes());
}
boost::asio::const_buffers_1
buffers() const
{
return boost::asio::const_buffers_1 (
data(), bytes());
}
operator boost::asio::mutable_buffer()
{
return buffer();
}
operator boost::asio::const_buffer() const
{
return buffer();
}
operator boost::asio::mutable_buffers_1()
{
return buffers();
}
operator boost::asio::const_buffers_1() const
{
return buffers();
}
//
// Element access
//
reference
at (size_type pos)
{
if (! (pos < size()))
throw std::out_of_range ("bad array index");
return m_base [pos];
}
const_reference
at (size_type pos) const
{
if (! (pos < size()))
throw std::out_of_range ("bad array index");
return m_base [pos];
}
reference
operator[] (size_type pos) noexcept
{
return m_base [pos];
}
const_reference
operator[] (size_type pos) const noexcept
{
return m_base [pos];
}
reference
back() noexcept
{
return m_base [m_size - 1];
}
const_reference
back() const noexcept
{
return m_base [m_size - 1];
}
reference
front() noexcept
{
return *m_base;
}
const_reference
front() const noexcept
{
return *m_base;
}
pointer
data() noexcept
{
return m_base;
}
const_pointer
data() const noexcept
{
return m_base;
}
//
// Iterators
//
iterator
begin() noexcept
{
return m_base;
}
const_iterator
begin() const noexcept
{
return m_base;
}
const_iterator
cbegin() const noexcept
{
return m_base;
}
iterator
end() noexcept
{
return m_base + m_size;
}
const_iterator
end() const noexcept
{
return m_base + m_size;
}
const_iterator
cend() const noexcept
{
return m_base + m_size;
}
reverse_iterator
rbegin() noexcept
{
return reverse_iterator (end());
}
const_reverse_iterator
rbegin() const noexcept
{
return const_reverse_iterator (cend());
}
const_reverse_iterator
crbegin() const noexcept
{
return const_reverse_iterator (cend());
}
reverse_iterator
rend() noexcept
{
return reverse_iterator (begin());
}
const_reverse_iterator
rend() const noexcept
{
return const_reverse_iterator (cbegin());
}
const_reverse_iterator
crend() const noexcept
{
return const_reverse_iterator (cbegin());
}
//
// Capacity
//
bool
empty() const noexcept
{
return m_size == 0;
}
size_type
size() const noexcept
{
return m_size;
}
size_type
max_size() const noexcept
{
return size();
}
size_type
capacity() const noexcept
{
return size();
}
size_type bytes() const
{
return m_size * sizeof(T);
}
//
// Modifiers
//
template <class U, class A>
friend
void
swap (memory_buffer <U, A>& lhs,
memory_buffer <U, A>& rhs) noexcept;
};
//------------------------------------------------------------------------------
template <class T, class Alloc>
void
swap (memory_buffer <T, Alloc>& lhs,
memory_buffer <T, Alloc>& rhs) noexcept
{
std::swap (lhs.m_base, rhs.m_base);
std::swap (lhs.m_size, rhs.m_size);
}
template <class T, class A1, class A2>
inline
bool
operator== (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return std::equal (lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend());
}
template <class T, class A1, class A2>
inline
bool
operator!= (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return ! (lhs == rhs);
}
template <class T, class A1, class A2>
inline
bool
operator< (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return std::lexicographical_compare (
lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend());
}
template <class T, class A1, class A2>
inline
bool
operator>= (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return ! (lhs < rhs);
}
template <class T, class A1, class A2>
inline
bool
operator> (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return rhs < lhs;
}
template <class T, class A1, class A2>
inline
bool
operator<= (memory_buffer <T, A1> const& lhs,
memory_buffer <T, A2> const& rhs)
{
return ! (rhs < lhs);
}
}
}
#endif

View File

@@ -17,24 +17,25 @@
*/
//==============================================================================
#ifndef BEAST_TYPE_TRAITS_INTEGRALCONSTANT_H_INCLUDED
#define BEAST_TYPE_TRAITS_INTEGRALCONSTANT_H_INCLUDED
#ifndef BEAST_ASIO_PLACEHOLDERS_H_INCLUDED
#define BEAST_ASIO_PLACEHOLDERS_H_INCLUDED
#include <functional>
namespace beast {
namespace asio {
// ideas from boost
template <class T, T val>
struct IntegralConstant
{
typedef IntegralConstant <T, val> type;
typedef T value_type;
static const T value = val;
};
typedef IntegralConstant <bool, true> TrueType;
typedef IntegralConstant <bool, false> FalseType;
namespace placeholders {
// asio placeholders that work with std::bind
namespace {
static auto const error (std::placeholders::_1);
static auto const bytes_transferred (std::placeholders::_2);
static auto const iterator (std::placeholders::_2);
static auto const signal_number (std::placeholders::_2);
}
}
}
}
#endif

View File

@@ -0,0 +1,475 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_SHARED_HANDLER_H_INCLUDED
#define BEAST_ASIO_SHARED_HANDLER_H_INCLUDED
#include "../Config.h"
#include "../utility/is_call_possible.h"
#include <boost/utility/base_from_member.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include "../utility/noexcept.h"
#include <functional>
#include <memory>
#include "../cxx14/type_traits.h" // <type_traits>
#ifndef BEAST_ASIO_NO_ALLOCATE_SHARED
#define BEAST_ASIO_NO_ALLOCATE_SHARED 0
#endif
#ifndef BEAST_ASIO_NO_HANDLER_RESULT_OF
#define BEAST_ASIO_NO_HANDLER_RESULT_OF 1
#endif
namespace beast {
namespace asio {
class shared_handler_wrapper_base
{
public:
virtual ~shared_handler_wrapper_base()
{
}
virtual void invoke (std::function <void (void)> f) = 0;
virtual void* allocate (std::size_t size) = 0;
virtual void deallocate (void* p, std::size_t size) = 0;
virtual bool is_continuation () = 0;
};
//------------------------------------------------------------------------------
template <class Signature>
class shared_handler_wrapper_func
: public shared_handler_wrapper_base
{
private:
std::function <Signature> m_func;
public:
template <class Handler>
explicit shared_handler_wrapper_func (Handler&& handler)
: m_func (std::ref (std::forward <Handler> (handler)))
{
}
template <class... Args>
#if BEAST_ASIO_NO_HANDLER_RESULT_OF
void
#else
std::result_of_t <std::function <Signature> (Args...)>
#endif
operator() (Args&&... args) const
{
return m_func (std::forward <Args> (args)...);
}
};
//------------------------------------------------------------------------------
namespace detail {
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4512) // assignment operator could not be generated
#endif
template <class Signature, class Handler>
class shared_handler_wrapper
: private boost::base_from_member <Handler>
, public shared_handler_wrapper_func <Signature>
{
private:
typedef boost::base_from_member <Handler> Base;
BEAST_DEFINE_IS_CALL_POSSIBLE(has_is_continuation, is_continuation);
public:
shared_handler_wrapper (Handler&& handler)
: boost::base_from_member <Handler> (std::move (handler))
, shared_handler_wrapper_func <Signature> (Base::member)
{
}
shared_handler_wrapper (Handler const& handler)
: boost::base_from_member <Handler> (handler)
, shared_handler_wrapper_func <Signature> (Base::member)
{
}
private:
void
invoke (std::function <void (void)> f) override
{
return boost_asio_handler_invoke_helpers::
invoke (f, Base::member);
}
void*
allocate (std::size_t size) override
{
return boost_asio_handler_alloc_helpers::
allocate (size, Base::member);
}
void
deallocate (void* p, std::size_t size) override
{
boost_asio_handler_alloc_helpers::
deallocate (p, size, Base::member);
}
bool
is_continuation () override
{
return is_continuation (std::integral_constant <bool,
has_is_continuation <Handler, bool(void)>::value>());
}
bool
is_continuation (std::true_type)
{
return Base::member.is_continuation();
}
bool
is_continuation (std::false_type)
{
return boost_asio_handler_cont_helpers::
is_continuation (Base::member);
}
};
#ifdef _MSC_VER
#pragma warning (pop)
#endif
template <class T>
struct is_shared_handler : public std::false_type
{
};
//------------------------------------------------------------------------------
template <class T, class Handler>
class handler_allocator
{
private:
// We want a partial template specialization as a friend
// but that isn't allowed so we friend all versions. This
// should produce a compile error if Handler is not constructible
// from H.
//
template <class U, class H>
friend class handler_allocator;
Handler m_handler;
public:
typedef T value_type;
typedef T* pointer;
template <class U>
struct rebind
{
public:
typedef handler_allocator <U, Handler> other;
};
handler_allocator() = delete;
handler_allocator (Handler const& handler)
: m_handler (handler)
{
}
template <class U>
handler_allocator (
handler_allocator <U, Handler> const& other)
: m_handler (other.m_handler)
{
}
handler_allocator&
operator= (handler_allocator const&) = delete;
pointer
allocate (std::ptrdiff_t n)
{
auto const size (n * sizeof (T));
return static_cast <pointer> (
boost_asio_handler_alloc_helpers::allocate (
size, m_handler));
}
void
deallocate (pointer p, std::ptrdiff_t n)
{
auto const size (n * sizeof (T));
boost_asio_handler_alloc_helpers::deallocate (
p, size, m_handler);
}
// Work-around for MSVC not using allocator_traits
// in the implementation of shared_ptr
//
#ifdef _MSC_VER
void
destroy (T* t)
{
t->~T();
}
#endif
friend
bool
operator== (handler_allocator const& lhs, handler_allocator const& rhs)
{
return true;
}
friend
bool
operator!= (handler_allocator const& lhs, handler_allocator const& rhs)
{
return ! (lhs == rhs);
}
};
}
//------------------------------------------------------------------------------
/** Handler shared reference that provides io_service execution guarantees. */
template <class Signature>
class shared_handler
{
private:
template <class T>
friend class shared_handler_allocator;
typedef shared_handler_wrapper_func <
Signature> wrapper_type;
typedef std::shared_ptr <wrapper_type> ptr_type;
ptr_type m_ptr;
public:
shared_handler()
{
}
template <
class DeducedHandler,
class = std::enable_if_t <
! detail::is_shared_handler <
std::decay_t <DeducedHandler>>::value &&
std::is_constructible <std::function <Signature>,
std::decay_t <DeducedHandler>>::value
>
>
shared_handler (DeducedHandler&& handler)
{
typedef std::remove_reference_t <DeducedHandler> Handler;
#if BEAST_ASIO_NO_ALLOCATE_SHARED
m_ptr = std::make_shared <detail::shared_handler_wrapper <
Signature, Handler>> (std::forward <DeducedHandler> (handler));
#else
m_ptr = std::allocate_shared <detail::shared_handler_wrapper <
Signature, Handler>> (detail::handler_allocator <char, Handler> (
handler), std::forward <DeducedHandler> (handler));
#endif
}
shared_handler (shared_handler&& other)
: m_ptr (std::move (other.m_ptr))
{
}
shared_handler (shared_handler const& other)
: m_ptr (other.m_ptr)
{
}
shared_handler&
operator= (std::nullptr_t)
{
m_ptr = nullptr;
return *this;
}
shared_handler&
operator= (shared_handler const& rhs)
{
m_ptr = rhs.m_ptr;
return *this;
}
shared_handler&
operator= (shared_handler&& rhs)
{
m_ptr = std::move (rhs.m_ptr);
return *this;
}
explicit
operator bool() const noexcept
{
return m_ptr.operator bool();
}
void
reset()
{
m_ptr.reset();
}
template <class... Args>
#if BEAST_ASIO_NO_HANDLER_RESULT_OF
void
#else
std::result_of_t <std::function <Signature> (Args...)>
#endif
operator() (Args&&... args) const
{
return (*m_ptr)(std::forward <Args> (args)...);
}
template <class Function>
friend
void
asio_handler_invoke (Function&& f, shared_handler* h)
{
return h->m_ptr->invoke (f);
}
friend
void*
asio_handler_allocate (
std::size_t size, shared_handler* h)
{
return h->m_ptr->allocate (size);
}
friend
void
asio_handler_deallocate (
void* p, std::size_t size, shared_handler* h)
{
return h->m_ptr->deallocate (p, size);
}
friend
bool
asio_handler_is_continuation (
shared_handler* h)
{
return h->m_ptr->is_continuation ();
}
};
//------------------------------------------------------------------------------
namespace detail {
template <
class Signature
>
struct is_shared_handler <
shared_handler <Signature>
> : public std::true_type
{
};
}
//------------------------------------------------------------------------------
template <class T>
class shared_handler_allocator
{
private:
template <class U>
friend class shared_handler_allocator;
std::shared_ptr <shared_handler_wrapper_base> m_ptr;
public:
typedef T value_type;
typedef T* pointer;
shared_handler_allocator() = delete;
template <class Signature>
shared_handler_allocator (
shared_handler <Signature> const& handler)
: m_ptr (handler.m_ptr)
{
}
template <class U>
shared_handler_allocator (
shared_handler_allocator <U> const& other)
: m_ptr (other.m_ptr)
{
}
pointer
allocate (std::ptrdiff_t n)
{
auto const size (n * sizeof (T));
return static_cast <pointer> (
m_ptr->allocate (size));
}
void
deallocate (pointer p, std::ptrdiff_t n)
{
auto const size (n * sizeof (T));
m_ptr->deallocate (p, size);
}
friend
bool
operator== (shared_handler_allocator const& lhs,
shared_handler_allocator const& rhs)
{
return lhs.m_ptr == rhs.m_ptr;
}
friend
bool
operator!= (shared_handler_allocator const& lhs,
shared_handler_allocator const& rhs)
{
return ! (lhs == rhs);
}
};
}
}
#endif

View File

@@ -17,30 +17,39 @@
*/
//==============================================================================
#include "../basic_seconds_clock.h"
// LIBS: boost_system
#include "../../Config.h"
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../../BeastConfig.h"
#endif
#include "../../unit_test/suite.h"
#include "../bind_handler.h"
#include <functional>
namespace beast {
namespace asio {
class basic_seconds_clock_Tests : public UnitTest
class bind_handler_test : public unit_test::suite
{
public:
void runTest ()
static void foo (int)
{
beginTestCase ("now");
basic_seconds_clock <std::chrono::steady_clock>::now ();
pass ();
}
basic_seconds_clock_Tests() : UnitTest("basic_seconds_clock", "beast")
void run()
{
auto f (bind_handler (
std::bind (&foo, std::placeholders::_1),
42));
f();
pass();
}
};
static basic_seconds_clock_Tests basic_seconds_clock_tests;
BEAST_DEFINE_TESTSUITE(bind_handler,asio,beast);
}
}

View File

@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../../BeastConfig.h"
#endif
#include "../../unit_test/suite.h"
#include "../bind_handler.h"
#include "../enable_wait_for_async.h"
#include <boost/asio/io_service.hpp>
namespace beast {
class enable_wait_for_async_test : public unit_test::suite
{
public:
typedef boost::system::error_code error_code;
void test()
{
struct handler
{
void operator()(error_code)
{
}
};
struct owner : asio::enable_wait_for_async <owner>
{
bool notified;
owner()
: notified (false)
{
}
void operator()()
{
{
boost::asio::io_service ios;
ios.post (asio::bind_handler (handler(),
error_code()));
ios.run();
ios.reset();
wait_for_async();
}
{
boost::asio::io_service ios;
ios.post (wrap_with_counter (asio::bind_handler (
handler(), error_code())));
ios.run();
wait_for_async();
}
{
boost::asio::io_service ios;
handler h;
ios.post (wrap_with_counter (std::bind (
&handler::operator(), &h,
error_code())));
ios.run();
wait_for_async();
}
}
void on_wait_for_async()
{
notified = true;
}
};
owner o;
o();
expect (o.notified);
}
void run()
{
test();
}
};
BEAST_DEFINE_TESTSUITE(enable_wait_for_async,asio,beast);
}

View File

@@ -0,0 +1,235 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../../BeastConfig.h"
#endif
#include "../../unit_test/suite.h"
#include "../shared_handler.h"
// Disables is_constructible tests for std::function
// Visual Studio std::function fails the is_constructible tests
#ifndef BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE
# ifdef _MSC_VER
# define BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE 1
# else
# define BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE 0
# endif
#endif
namespace beast {
class shared_handler_test : public unit_test::suite
{
public:
struct test_results
{
bool call;
bool invoke;
bool alloc;
bool dealloc;
bool cont;
test_results ()
: call (false)
, invoke (false)
, alloc (false)
, dealloc (false)
, cont (false)
{
}
};
struct test_handler
{
std::reference_wrapper <test_results> results;
explicit test_handler (test_results& results_)
: results (results_)
{
}
void operator() ()
{
results.get().call = true;
}
template <class Function>
friend void asio_handler_invoke (
Function& f, test_handler* h)
{
h->results.get().invoke = true;
f();
}
template <class Function>
friend void asio_handler_invoke (
Function const& f, test_handler* h)
{
h->results.get().invoke = true;
f();
}
friend void* asio_handler_allocate (
std::size_t size, test_handler* h)
{
h->results.get().alloc = true;
return boost::asio::asio_handler_allocate (size);
}
friend void asio_handler_deallocate (
void* p, std::size_t size, test_handler* h)
{
h->results.get().dealloc = true;
boost::asio::asio_handler_deallocate (p, size);
}
friend bool asio_handler_is_continuation (
test_handler* h)
{
h->results.get().cont = true;
return true;
}
};
struct test_invokable
{
bool call;
test_invokable ()
: call (false)
{
}
void operator() ()
{
call = true;
}
};
template <class Handler>
bool async_op (Handler&& handler)
{
void* const p (boost_asio_handler_alloc_helpers::allocate (32, handler));
handler();
boost_asio_handler_alloc_helpers::deallocate (p, 32, handler);
return boost_asio_handler_cont_helpers::is_continuation (handler);
}
void virtual_async_op (asio::shared_handler <void(void)> handler)
{
async_op (handler);
}
void run()
{
#if ! BEAST_NO_STD_FUNCTION_CONSTRUCTIBLE
static_assert (! std::is_constructible <
std::function <void(void)>, int&&>::value,
"Cannot construct std::function from int&&");
static_assert (! std::is_constructible <
std::function <void(void)>, int>::value,
"Cannot construct std::function from int");
static_assert (! std::is_constructible <
asio::shared_handler <void(void)>, int>::value,
"Cannot construct shared_handler from int");
#endif
static_assert (std::is_constructible <
asio::shared_handler <void(int)>,
asio::shared_handler <void(int)>>::value,
"Should construct <void(int)> from <void(int)>");
static_assert (! std::is_constructible <
asio::shared_handler <void(int)>,
asio::shared_handler <void(void)>>::value,
"Can't construct <void(int)> from <void(void)>");
// Hooks called when using the raw handler
{
test_results r;
test_handler h (r);
async_op (h);
expect (r.call);
expect (r.alloc);
expect (r.dealloc);
expect (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), h);
expect (r.invoke);
expect (f.call);
}
// Use of std::function shows the hooks not getting called
{
test_results r;
std::function <void(void)> fh ((test_handler) (r));
async_op (fh);
expect (r.call);
unexpected (r.alloc);
unexpected (r.dealloc);
unexpected (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), fh);
unexpected (r.invoke);
expect (f.call);
}
// Make sure shared_handler calls the hooks
{
test_results r;
asio::shared_handler <void(void)> sh ((test_handler)(r));
async_op (sh);
expect (r.call);
expect (r.alloc);
expect (r.dealloc);
expect (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), sh);
expect (r.invoke);
expect (f.call);
}
// Make sure shared_handler via implicit conversion calls hooks
{
test_results r;
test_handler h (r);
virtual_async_op ((test_handler) (r));
expect (r.call);
expect (r.alloc);
expect (r.dealloc);
expect (r.cont);
}
}
};
BEAST_DEFINE_TESTSUITE(shared_handler,asio,beast);
}

View File

@@ -0,0 +1,280 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../../BeastConfig.h"
#endif
#include "../../unit_test/suite.h"
#include "../wrap_handler.h"
#include <boost/version.hpp>
#include <boost/bind.hpp>
#include <functional>
#include <memory>
namespace beast {
namespace asio {
//------------------------------------------------------------------------------
// Displays the order of destruction of parameters in the bind wrapper
//
class boost_bind_test : public unit_test::suite
{
public:
struct Result
{
std::string text;
void push_back (std::string const& s)
{
if (! text.empty())
text += ", ";
text += s;
}
};
struct Payload
{
std::reference_wrapper <Result> m_result;
std::string m_name;
explicit Payload (Result& result, std::string const& name)
: m_result (result)
, m_name (name)
{
}
~Payload ()
{
m_result.get().push_back (m_name);
}
};
struct Arg
{
std::shared_ptr <Payload> m_payload;
Arg (Result& result, std::string const& name)
: m_payload (std::make_shared <Payload> (result, name))
{
}
};
static void foo (Arg const&, Arg const&, Arg const&)
{
}
void run()
{
{
Result r;
{
boost::bind (&foo,
Arg (r, "one"),
Arg (r, "two"),
Arg (r, "three"));
}
log <<
std::string ("boost::bind (") + r.text + ")";
}
{
Result r;
{
std::bind (&foo,
Arg (r, "one"),
Arg (r, "two"),
Arg (r, "three"));
}
log <<
std::string ("std::bind (") + r.text + ")";
}
pass();
}
};
BEAST_DEFINE_TESTSUITE(boost_bind,asio,beast);
//------------------------------------------------------------------------------
class wrap_handler_test : public unit_test::suite
{
public:
struct test_results
{
bool call;
bool invoke;
bool alloc;
bool dealloc;
bool cont;
test_results ()
: call (false)
, invoke (false)
, alloc (false)
, dealloc (false)
, cont (false)
{
}
};
struct test_handler
{
std::reference_wrapper <test_results> results;
explicit test_handler (test_results& results_)
: results (results_)
{
}
void operator() ()
{
results.get().call = true;
}
template <class Function>
friend void asio_handler_invoke (
Function& f, test_handler* h)
{
h->results.get().invoke = true;
f();
}
template <class Function>
friend void asio_handler_invoke (
Function const& f, test_handler* h)
{
h->results.get().invoke = true;
f();
}
friend void* asio_handler_allocate (
std::size_t, test_handler* h)
{
h->results.get().alloc = true;
return nullptr;
}
friend void asio_handler_deallocate (
void*, std::size_t, test_handler* h)
{
h->results.get().dealloc = true;
}
friend bool asio_handler_is_continuation (
test_handler* h)
{
h->results.get().cont = true;
return true;
}
};
struct test_invokable
{
bool call;
test_invokable ()
: call (false)
{
}
void operator() ()
{
call = true;
}
};
template <class Handler>
bool async_op (Handler&& handler)
{
void* const p (boost_asio_handler_alloc_helpers::allocate (32, handler));
(handler)();
boost_asio_handler_alloc_helpers::deallocate (p, 32, handler);
return boost_asio_handler_cont_helpers::is_continuation (handler);
}
void run()
{
// Hooks called when using the raw handler
{
test_results r;
test_handler h (r);
async_op (h);
expect (r.call);
expect (r.alloc);
expect (r.dealloc);
expect (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), h);
expect (r.invoke);
expect (f.call);
}
// Use of boost::bind shows the hooks not getting called
{
test_results r;
test_handler h (r);
auto b (std::bind (&test_handler::operator(), &h));
async_op (b);
expect (r.call);
unexpected (r.alloc);
unexpected (r.dealloc);
unexpected (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), b);
unexpected (r.invoke);
expect (f.call);
}
// Make sure the wrapped handler calls the hooks
{
test_results r;
test_handler h (r);
auto w (wrap_handler (
std::bind (&test_handler::operator(), test_handler(r)), h));
async_op (w);
expect (r.call);
expect (r.alloc);
expect (r.dealloc);
expect (r.cont);
test_invokable f;
boost_asio_handler_invoke_helpers::invoke (std::ref (f), w);
expect (r.invoke);
expect (f.call);
}
}
};
BEAST_DEFINE_TESTSUITE(wrap_handler,asio,beast);
}
}

View File

@@ -0,0 +1,176 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_ASIO_WRAP_HANDLER_H_INCLUDED
#define BEAST_ASIO_WRAP_HANDLER_H_INCLUDED
#include <boost/asio/detail/handler_alloc_helpers.hpp>
#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include "../cxx14/type_traits.h" // <type_traits>
#include <utility>
namespace beast {
namespace asio {
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4512) // assignment operator could not be generated
#endif
namespace detail {
/** A handler which wraps another handler using a specfic context.
The handler is invoked with the same io_service execution guarantees
as the provided context.
@note A copy of Context is made.
*/
template <class Handler, class Context>
class wrapped_handler
{
private:
Handler m_handler;
Context m_context;
bool m_continuation;
// If this goes off, consider carefully what the intent is.
static_assert (! std::is_reference <Handler>::value,
"Handler should not be a reference type");
public:
wrapped_handler (bool continuation, Handler&& handler, Context context)
: m_handler (std::move (handler))
, m_context (context)
, m_continuation (continuation ? true :
boost_asio_handler_cont_helpers::is_continuation (context))
{
}
wrapped_handler (bool continuation, Handler const& handler, Context context)
: m_handler (handler)
, m_context (context)
, m_continuation (continuation ? true :
boost_asio_handler_cont_helpers::is_continuation (context))
{
}
template <class... Args>
void
operator() (Args&&... args)
{
m_handler (std::forward <Args> (args)...);
}
template <class... Args>
void
operator() (Args&&... args) const
{
m_handler (std::forward <Args> (args)...);
}
template <class Function>
friend
void
asio_handler_invoke (Function& f, wrapped_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_context);
}
template <class Function>
friend
void
asio_handler_invoke (Function const& f, wrapped_handler* h)
{
boost_asio_handler_invoke_helpers::
invoke (f, h->m_context);
}
friend
void*
asio_handler_allocate (std::size_t size, wrapped_handler* h)
{
return boost_asio_handler_alloc_helpers::
allocate (size, h->m_context);
}
friend
void
asio_handler_deallocate (void* p, std::size_t size, wrapped_handler* h)
{
boost_asio_handler_alloc_helpers::
deallocate (p, size, h->m_context);
}
friend
bool
asio_handler_is_continuation (wrapped_handler* h)
{
return h->m_continuation;
}
};
}
//------------------------------------------------------------------------------
// Tag for dispatching wrap_handler with is_continuation == true
enum continuation_t
{
continuation
};
/** Returns a wrapped handler so it executes within another context.
The handler is invoked with the same io_service execution guarantees
as the provided context. The handler will be copied if necessary.
@note A copy of Context is made.
*/
/** @{ */
template <class DeducedHandler, class Context>
detail::wrapped_handler <
std::remove_reference_t <DeducedHandler>,
Context
>
wrap_handler (DeducedHandler&& handler, Context const& context,
bool continuation = false)
{
typedef std::remove_reference_t <DeducedHandler> Handler;
return detail::wrapped_handler <Handler, Context> (continuation,
std::forward <DeducedHandler> (handler), context);
}
template <class DeducedHandler, class Context>
detail::wrapped_handler <
std::remove_reference_t <DeducedHandler>,
Context
>
wrap_handler (continuation_t, DeducedHandler&& handler,
Context const& context)
{
typedef std::remove_reference_t <DeducedHandler> Handler;
return detail::wrapped_handler <Handler, Context> (true,
std::forward <DeducedHandler> (handler), context);
}
/** @} */
}
}
#endif

View File

@@ -17,7 +17,9 @@
*/
//==============================================================================
#include "BeastConfig.h"
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../BeastConfig.h"
#endif
#include "ErrorCode.h"

View File

@@ -0,0 +1,46 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_BOOST_GET_POINTER_H_INCLUDED
#define BEAST_BOOST_GET_POINTER_H_INCLUDED
#include <boost/get_pointer.hpp>
// Boost 1.55 incorrectly defines BOOST_NO_CXX11_SMART_PTR
// when building with clang 3.4 and earlier. This workaround
// gives beast its own overloads.
#ifdef BOOST_NO_CXX11_SMART_PTR
#include <memory>
namespace beast {
template <class T>
T* get_pointer (std::unique_ptr<T> const& p)
{
return p.get();
}
template <class T>
T* get_pointer (std::shared_ptr<T> const& p)
{
return p.get();
}
}
#endif
#endif

View File

@@ -1,159 +0,0 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_CHRONO_CPUMETER_H_INCLUDED
#define BEAST_CHRONO_CPUMETER_H_INCLUDED
#include "RelativeTime.h"
#include "ScopedTimeInterval.h"
#include "../threads/SharedData.h"
#include "../Atomic.h"
namespace beast {
/** Measurements of CPU utilization. */
class CPUMeter
{
private:
struct MeasureIdle
{
explicit MeasureIdle (CPUMeter& meter)
: m_meter (&meter)
{ }
void operator() (RelativeTime const& interval) const
{ m_meter->addIdleTime (interval); }
CPUMeter* m_meter;
};
struct MeasureActive
{
explicit MeasureActive (CPUMeter& meter)
: m_meter (&meter)
{ }
void operator() (RelativeTime const& interval) const
{ m_meter->addActiveTime (interval); }
CPUMeter* m_meter;
};
enum
{
// The amount of time an aggregate must accrue before a swap
secondsPerAggregate = 3
// The number of aggregates in the rolling history buffer
,numberOfAggregates = 20
};
// Aggregated sample data
struct Aggregate
{
RelativeTime idle;
RelativeTime active;
// Returns the total number of seconds in the aggregate
double seconds () const
{ return idle.inSeconds() + active.inSeconds(); }
// Reset the accumulated times
void clear ()
{ idle = RelativeTime (0); active = RelativeTime (0); }
Aggregate& operator+= (Aggregate const& other)
{ idle += other.idle; active += other.active; return *this; }
Aggregate& operator-= (Aggregate const& other)
{ idle -= other.idle; active -= other.active; return *this; }
};
struct State
{
State () : index (0)
{
}
// Returns a reference to the current aggregate
Aggregate& front ()
{
return history [index];
}
// Checks the current aggregate to see if we should advance
void update()
{
if (front().seconds() >= secondsPerAggregate)
advance();
}
// Advance the index in the rolling history
void advance ()
{
usage += history [index];
index = (index+1) % numberOfAggregates;
usage -= history [index];
history [index].clear ();
}
// Index of the current aggregate we are accumulating
int index;
// Delta summed usage over the entire history buffer
Aggregate usage;
// The rolling history buffer
Aggregate history [numberOfAggregates];
};
typedef SharedData <State> SharedState;
SharedState m_state;
void addIdleTime (RelativeTime const& interval)
{
SharedState::Access state (m_state);
state->front().idle += interval;
state->update();
}
void addActiveTime (RelativeTime const& interval)
{
SharedState::Access state (m_state);
state->front().active += interval;
state->update();
}
public:
/** The type of container that measures idle time. */
typedef ScopedTimeInterval <MeasureIdle> ScopedIdleTime;
typedef ScopedTimeInterval <MeasureActive> ScopedActiveTime;
/** Returns the fraction of time that the CPU is being used. */
double getUtilization () const
{
SharedState::ConstAccess state (m_state);
double const seconds (state->usage.seconds());
if (seconds > 0)
return (state->usage.active.inSeconds() / seconds);
return 0;
}
};
}
#endif

View File

@@ -17,14 +17,14 @@
*/
//==============================================================================
#include "BeastConfig.h"
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../BeastConfig.h"
#endif
#include "../Config.h"
#include "../../modules/beast_core/beast_core.h" // for UnitTest
#include "impl/abstract_clock.cpp"
#include "impl/chrono_io.cpp"
#include "impl/basic_seconds_clock.cpp"
#include "impl/CPUMeter.cpp"
#include "impl/RelativeTime.cpp"
#include "tests/abstract_clock.test.cpp"
#include "tests/basic_seconds_clock.test.cpp"

View File

@@ -27,6 +27,7 @@
#include "../Config.h"
#include "../strings/String.h"
#include "../utility/noexcept.h"
#include <string>
#include <sstream>
@@ -40,7 +41,7 @@ namespace beast {
If you need an absolute time, (i.e. a date + time), see the Time class.
*/
class BEAST_API RelativeTime
class RelativeTime
{
public:
//==============================================================================
@@ -87,7 +88,7 @@ public:
/** Creates a new RelativeTime object representing a number of milliseconds.
@see seconds, minutes, hours, days, weeks
*/
static RelativeTime milliseconds (int64 milliseconds) noexcept;
static RelativeTime milliseconds (std::int64_t milliseconds) noexcept;
/** Creates a new RelativeTime object representing a number of seconds.
@see milliseconds, minutes, hours, days, weeks
@@ -118,7 +119,7 @@ public:
/** Returns the number of milliseconds this time represents.
@see milliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks
*/
int64 inMilliseconds() const noexcept;
std::int64_t inMilliseconds() const noexcept;
/** Returns the number of seconds this time represents.
@see inMilliseconds, inMinutes, inHours, inDays, inWeeks

View File

@@ -21,8 +21,7 @@
#define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
#include <chrono>
#include "chrono_io.h"
#include <string>
namespace beast {
@@ -74,9 +73,10 @@ public:
/** Returns the current time. */
virtual time_point now () const = 0;
#if 0
/** Convert the specified time point to a string. */
/** @{ */
virtual std::string to_string (time_point const& tp) const = 0;
//virtual std::string to_string (time_point const& tp) const = 0;
template <class Duration2>
std::string to_string (
@@ -86,6 +86,7 @@ public:
std::chrono::time_point_cast <Duration> (tp));
}
/** @} */
#endif
/** Returning elapsed ticks since the epoch. */
rep elapsed () const
@@ -122,6 +123,7 @@ struct abstract_clock_wrapper
: public basic_abstract_clock_wrapper <TrivialClock, Duration>
{
// generic conversion displays the duration
/*
std::string to_string (typename basic_abstract_clock_wrapper <
TrivialClock, Duration>::time_point const& tp) const
{
@@ -129,6 +131,7 @@ struct abstract_clock_wrapper
ss << tp.time_since_epoch();
return ss.str ();
}
*/
};
/*

View File

@@ -17,33 +17,20 @@
*/
//==============================================================================
#ifndef BEAST_THREADS_LOCKGUARD_H_INCLUDED
#define BEAST_THREADS_LOCKGUARD_H_INCLUDED
#ifndef BEAST_CHRONO_ABSTRACT_CLOCK_IO_H_INCLUDED
#define BEAST_CHRONO_ABSTRACT_CLOCK_IO_H_INCLUDED
#include "../Uncopyable.h"
#include "chrono_io.h"
namespace beast {
template <typename Mutex>
class LockGuard : public Uncopyable
template <class CharT, class Traits, class Duration, class Resolution>
std::basic_ostream <CharT, Traits>&
operator<< (std::basic_ostream <CharT, Traits>& os,
std::chrono::time_point <abstract_clock <Resolution>, Duration> const& tp)
{
public:
typedef Mutex MutexType;
explicit LockGuard (Mutex const& mutex)
: m_mutex (mutex)
{
m_mutex.lock();
}
~LockGuard ()
{
m_mutex.unlock();
}
private:
Mutex const& m_mutex;
};
return os << tp.time_since_epoch() << " since epoch";
}
}

View File

@@ -22,6 +22,7 @@
#include <algorithm>
#include <chrono>
#include <vector>
#ifndef BEAST_BASIC_SECONDS_CLOCK_BOOST_WORKAROUND
# ifdef _MSC_VER

View File

@@ -29,6 +29,7 @@
#include "../Config.h"
#include "../utility/noexcept.h"
#include <ctime>
#include <locale>

View File

@@ -54,7 +54,7 @@ RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept
return RelativeTime (milliseconds * 0.001);
}
RelativeTime RelativeTime::milliseconds (const int64 milliseconds) noexcept
RelativeTime RelativeTime::milliseconds (const std::int64_t milliseconds) noexcept
{
return RelativeTime (milliseconds * 0.001);
}
@@ -86,9 +86,9 @@ RelativeTime RelativeTime::weeks (const RelativeTime::value_type numberOfWeeks)
//==============================================================================
int64 RelativeTime::inMilliseconds() const noexcept
std::int64_t RelativeTime::inMilliseconds() const noexcept
{
return (int64) (numSeconds * 1000.0);
return (std::int64_t) (numSeconds * 1000.0);
}
RelativeTime::value_type RelativeTime::inMinutes() const noexcept
@@ -301,7 +301,7 @@ static double monotonicCurrentTimeInSeconds()
{
numerator = timebase.numer;
// VFALCO NOTE I don't understand this code
//denominator = timebase.denom * (uint64) 1000000 * 1000.0;
//denominator = timebase.denom * (std::uint64_t) 1000000 * 1000.0;
denominator = timebase.denom * 1000000000.0;
}

View File

@@ -53,12 +53,14 @@ public:
return m_now;
}
#if 0
std::string to_string (time_point const& tp) const
{
std::stringstream ss;
ss << tp.time_since_epoch() << " from start";
return ss.str ();
}
#endif
/** Set the current time of the manual clock.
Precondition:

View File

@@ -17,17 +17,21 @@
*/
//==============================================================================
// MODULES: ../impl/chrono_io.cpp
#include "../abstract_clock.h"
#include "../abstract_clock_io.h"
#include "../manual_clock.h"
#include <thread>
#include "../../unit_test/suite.h"
#include <string>
#include <sstream>
#include <string>
#include <thread>
namespace beast {
class abstract_clock_tests : public UnitTest
class abstract_clock_test : public unit_test::suite
{
public:
void test (abstract_clock <std::chrono::seconds>& c)
@@ -40,10 +44,10 @@ public:
std::stringstream ss;
ss <<
"t1= " << c.to_string (t1) <<
", t2= " << c.to_string (t2) <<
"t1= " << t1.time_since_epoch() <<
", t2= " << t2.time_since_epoch() <<
", elapsed= " << (t2 - t1);
logMessage (ss.str());
log << ss.str();
}
}
@@ -54,45 +58,38 @@ public:
std::stringstream ss;
ss << "now() = " << c.to_string (c.now ()) << std::endl;
ss << "now() = " << c.now () << std::endl;
c.set (clock_type::time_point (std::chrono::seconds (1)));
ss << "now() = " << c.to_string (c.now ()) << std::endl;
ss << "now() = " << c.now () << std::endl;
c.set (clock_type::time_point (std::chrono::seconds (2)));
ss << "now() = " << c.to_string (c.now ()) << std::endl;
ss << "now() = " << c.now () << std::endl;
logMessage (ss.str());
log << ss.str();
}
void runTest ()
void run ()
{
beginTestCase ("Syntax");
logMessage ("steady_clock");
log << "steady_clock";
test (get_abstract_clock <std::chrono::steady_clock,
std::chrono::seconds> ());
logMessage ("system_clock");
log << "system_clock";
test (get_abstract_clock <std::chrono::system_clock,
std::chrono::seconds> ());
logMessage ("high_resolution_clock");
log << "high_resolution_clock";
test (get_abstract_clock <std::chrono::high_resolution_clock,
std::chrono::seconds> ());
logMessage ("manual_clock");
log << "manual_clock";
test_manual ();
pass ();
}
abstract_clock_tests ()
: UnitTest ("abstract_clock", "beast", runManual)
{
}
};
static abstract_clock_tests abstract_clock_tests_;
BEAST_DEFINE_TESTSUITE(abstract_clock,chrono,beast);
}

View File

@@ -17,21 +17,24 @@
*/
//==============================================================================
namespace beast {
#include "../../unit_test/suite.h"
class BassertUnitTests : public UnitTest
#include "../basic_seconds_clock.h"
namespace beast {
class basic_seconds_clock_test : public unit_test::suite
{
public:
void runTest ()
void
run()
{
beginTestCase ("bassert");
bassert (false);
basic_seconds_clock <
std::chrono::steady_clock>::now ();
pass ();
}
BassertUnitTests () : UnitTest ("bassert", "beast", runManual) { }
};
//------------------------------------------------------------------------------
BEAST_DEFINE_TESTSUITE(basic_seconds_clock,chrono,beast);
static BassertUnitTests bassertUnitTests;
}

View File

@@ -24,13 +24,8 @@
#ifndef BEAST_CONFIG_COMPILERCONFIG_H_INCLUDED
#define BEAST_CONFIG_COMPILERCONFIG_H_INCLUDED
// This file has to work when included in a C source file.
#ifndef BEAST_CONFIG_PLATFORMCONFIG_H_INCLUDED
#error "PlatformConfig.h must come first!"
#endif
#include <assert.h>
#include "PlatformConfig.h"
// This file defines miscellaneous macros for debugging, assertions, etc.
@@ -42,13 +37,20 @@
/** This macro defines the C calling convention used as the standard for Beast calls.
*/
#if BEAST_MSVC
# define BEAST_CALLTYPE __stdcall
# define BEAST_CDECL __cdecl
#else
# define BEAST_CALLTYPE
# define BEAST_CDECL
#endif
/** This macro fixes C++'s constexpr for VS2012, which doesn't understand it.
*/
#if BEAST_MSVC
# define BEAST_CONSTEXPR const
#else
# define BEAST_CONSTEXPR constexpr
#endif
// Debugging and assertion macros
#if BEAST_LOG_ASSERTIONS || BEAST_DEBUG
@@ -148,16 +150,6 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
//------------------------------------------------------------------------------
/** This macro can be added to class definitions to disable the use of new/delete to
allocate the object on the heap, forcing it to only be used as a stack or member variable.
*/
#define BEAST_PREVENT_HEAP_ALLOCATION \
private: \
static void* operator new (size_t); \
static void operator delete (void*);
//------------------------------------------------------------------------------
#if ! DOXYGEN
#define BEAST_JOIN_MACRO_HELPER(a, b) a ## b
#define BEAST_STRINGIFY_MACRO_HELPER(a) #a
@@ -175,19 +167,6 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
//------------------------------------------------------------------------------
#if BEAST_DEBUG || DOXYGEN
/** A platform-independent way of forcing an inline function.
Use the syntax: @code
forcedinline void myfunction (int x)
@endcode
*/
# define forcedinline inline
#elif BEAST_MSVC
# define forcedinline __forceinline
#else
# define forcedinline inline __attribute__((always_inline))
#endif
#if BEAST_MSVC || DOXYGEN
/** This can be placed before a stack or member variable declaration to tell
the compiler to align it to the specified number of bytes.
@@ -278,35 +257,10 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
# define BEAST_MOVE_CAST(type) type
#endif
//------------------------------------------------------------------------------
// Declare some fake versions of nullptr and noexcept, for older compilers:
#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_NOEXCEPT)
# ifdef noexcept
# undef noexcept
# endif
# define noexcept throw()
# if defined (_MSC_VER) && _MSC_VER > 1600
# define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining)
# endif
#endif
#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_NULLPTR)
#ifdef nullptr
#undef nullptr
#endif
#define nullptr (0)
#endif
#if ! (DOXYGEN || BEAST_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL)
#undef override
#define override
#endif
#ifdef __cplusplus
namespace beast {
bool beast_isRunningUnderDebugger();
void logAssertion (char const* file, int line) noexcept;
void logAssertion (char const* file, int line);
}
#endif

View File

@@ -20,25 +20,6 @@
#ifndef BEAST_CONFIG_CONFIGCHECK_H_INCLUDED
#define BEAST_CONFIG_CONFIGCHECK_H_INCLUDED
// This file makes sure that BeastConfig.h was included.
// It also sets defaults for all config options.
/* If you fail to make sure that all your compile units are building Beast with
the same set of option flags, then there's a risk that different compile
units will treat the classes as having different memory layouts, leading to
very nasty memory corruption errors when they all get linked together.
That's why it's best to always include the BeastConfig.h file before any
beast headers.
*/
#ifndef BEAST_BEASTCONFIG_H_INCLUDED
# ifdef _MSC_VER
# pragma message ("Have you included your BeastConfig.h file before including the Beast headers?")
# else
# warning "Have you included your BeastConfig.h file before including the Beast headers?"
# endif
# error "BeastConfig.h must be included before any Beast headers!"
#endif
//
// Apply sensible defaults for the configuration settings
//

View File

@@ -24,13 +24,10 @@
#if defined (fatal_error) || \
defined (fatal_condition) || \
defined (fatal_assert) || \
defined (meets_condition) || \
defined (meets_precondition) || \
defined (meets_postcondition) || \
defined (meets_invariant) || \
defined (check_precondition) || \
defined (check_postcondition) || \
defined (check_invariant)
#error "Programming by contract macros cannot be overriden!"
#endif
@@ -52,13 +49,6 @@
(((!!(condition)) || (beast_reportFatalError ( \
category " '" BEAST_STRINGIFY(condition) "' failed.", __FILE__, __LINE__), 0)))
/** Replacement for assert which generates a fatal error if the condition is false.
The condition is always evaluated regardless of compilation settings.
Meets this declaration syntax:
@code inline void fatal_assert (bool condition); @endcode
*/
#define fatal_assert(condition) fatal_condition(condition,"Assertion")
/** Reports a fatal error message type if the condition is false
The condition is always evaluated regardless of settings.
Meets this declaration syntax:
@@ -87,12 +77,8 @@
*/
/** @{ */
#if ! BEAST_DISABLE_CONTRACT_CHECKS
# define check_precondition(condition) meets_precondition(condition)
# define check_postcondition(condition) meets_postcondition(condition)
# define check_invariant(condition) meets_invariant(condition)
#else
# define check_precondition(condition) ((void)0)
# define check_postcondition(condition) ((void)0)
# define check_invariant(condition) ((void)0)
#endif
/** @} */

View File

@@ -101,10 +101,6 @@
#define BEAST_DEBUG 1
#endif
#if ! (defined (DEBUG) || defined (_DEBUG) || defined (NDEBUG) || defined (_NDEBUG))
#warning "Neither NDEBUG or DEBUG has been defined - you should set one of these to make it clear whether this is a release build,"
#endif
#ifdef __LITTLE_ENDIAN__
#define BEAST_LITTLE_ENDIAN 1
#else
@@ -213,4 +209,3 @@
#define BEAST_FILEANDLINE_ __FILE__ "(" BEAST_PP_STR1_(__LINE__) "): warning:"
#endif

View File

@@ -74,40 +74,4 @@
#undef max
#undef min
//------------------------------------------------------------------------------
// DLL building settings on Windows
//
// VFALCO TODO Deprecate this
//
#if BEAST_MSVC
#ifdef BEAST_DLL_BUILD
#define BEAST_API __declspec (dllexport)
#pragma warning (disable: 4251)
#elif defined (BEAST_DLL)
#define BEAST_API __declspec (dllimport)
#pragma warning (disable: 4251)
#endif
#ifdef __INTEL_COMPILER
#pragma warning (disable: 1125) // (virtual override warning)
#endif
#elif defined (BEAST_DLL) || defined (BEAST_DLL_BUILD)
#define BEAST_API __attribute__ ((visibility("default")))
#endif
//------------------------------------------------------------------------------
#ifndef BEAST_API
#define BEAST_API /**< This macro is added to all beast public class declarations. */
#endif
#if BEAST_MSVC && BEAST_DLL_BUILD
#define BEAST_PUBLIC_IN_DLL_BUILD(decl) public: decl; private:
#else
#define BEAST_PUBLIC_IN_DLL_BUILD(decl) decl;
#endif
/** This macro is added to all beast public function declarations. */
#define BEAST_PUBLIC_FUNCTION BEAST_API BEAST_CALLTYPE
#endif

View File

@@ -18,3 +18,5 @@
//==============================================================================
// Microsoft Visual C++ compiler configuration
#include "../../utility/noexcept.h"

View File

@@ -17,6 +17,13 @@
*/
//==============================================================================
#include "BeastConfig.h"
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../BeastConfig.h"
#endif
#include "impl/aged_associative_container.cpp"
#include "impl/spookyv2.cpp"
#include "tests/aged_associative_container.test.cpp"
#include "tests/buffer_view.test.cpp"
#include "tests/hardened_hash.test.cpp"
#include "tests/hash_append.test.cpp"

View File

@@ -0,0 +1,520 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_CONTAINER_BUFFER_VIEW_H_INCLUDED
#define BEAST_CONTAINER_BUFFER_VIEW_H_INCLUDED
#include "../Config.h"
#include <array>
#include "../cxx14/algorithm.h" // <algorithm>
#include <cstddef>
#include <iterator>
#include <memory>
#include <string>
#include <vector>
#include "../cxx14/type_traits.h" // <type_traits>
namespace beast {
namespace detail {
template <class T, class U,
bool = std::is_const <std::remove_reference_t <T>>::value>
struct apply_const
{
typedef U type;
};
template <class T, class U>
struct apply_const <T, U, true>
{
typedef const U type;
};
// is_contiguous is true if C is a contiguous container
template <class C>
struct is_contiguous
: public std::false_type
{
};
template <class C>
struct is_contiguous <C const>
: public is_contiguous <C>
{
};
template <class T, class Alloc>
struct is_contiguous <std::vector <T, Alloc>>
: public std::true_type
{
};
template <class CharT, class Traits, class Alloc>
struct is_contiguous <std::basic_string<
CharT, Traits, Alloc>>
: public std::true_type
{
};
template <class T, std::size_t N>
struct is_contiguous <std::array<T, N>>
: public std::true_type
{
};
// True if T is const or U is not const
template <class T, class U>
struct buffer_view_const_compatible : std::integral_constant <bool,
std::is_const<T>::value || ! std::is_const<U>::value
>
{
};
// True if T and U are the same or differ only in const, or
// if T and U are equally sized integral types.
template <class T, class U>
struct buffer_view_ptr_compatible : std::integral_constant <bool,
(std::is_same <std::remove_const <T>, std::remove_const <U>>::value) ||
(std::is_integral <T>::value && std::is_integral <U>::value &&
sizeof (U) == sizeof (T))
>
{
};
// Determine if buffer_view <T, ..> is constructible from U*
template <class T, class U>
struct buffer_view_convertible : std::integral_constant <bool,
buffer_view_const_compatible <T, U>::value &&
buffer_view_ptr_compatible <T, U>::value
>
{
};
// True if C is a container that can be used to construct a buffer_view<T>
template <class T, class C>
struct buffer_view_container_compatible : std::integral_constant <bool,
is_contiguous <C>::value && buffer_view_convertible <T,
typename apply_const <C, typename C::value_type>::type>::value
>
{
};
} // detail
struct buffer_view_default_tag
{
};
//------------------------------------------------------------------------------
/** A view into a range of contiguous container elements.
The size of the view is determined at the time of construction.
This tries to emulate the interface of std::vector as closely as possible,
with the constraint that the size of the container cannot be changed.
@tparam T The underlying element type. If T is const, member functions
which can modify elements are removed from the interface.
@tparam Tag A type used to prevent two views with the same T from being
comparable or assignable.
*/
template <
class T,
class Tag = buffer_view_default_tag
>
class buffer_view
{
private:
T* m_base;
std::size_t m_size;
static_assert (std::is_same <T, std::remove_reference_t <T>>::value,
"T may not be a reference type");
static_assert (! std::is_same <T, void>::value,
"T may not be void");
static_assert (std::is_same <std::add_const_t <T>,
std::remove_reference_t <T> const>::value,
"Expected std::add_const to produce T const");
template <class Iter>
void
assign (Iter first, Iter last) noexcept
{
typedef typename std::iterator_traits <Iter>::value_type U;
static_assert (detail::buffer_view_const_compatible <T, U>::value,
"Cannot convert from 'U const' to 'T', "
"conversion loses const qualifiers");
static_assert (detail::buffer_view_ptr_compatible <T, U>::value,
"Cannot convert from 'U*' to 'T*, "
"types are incompatible");
if (first == last)
{
m_base = nullptr;
m_size = 0;
}
else
{
#if 0
// fails on gcc
m_base = reinterpret_cast <T*> (
std::addressof (*first));
#else
m_base = reinterpret_cast <T*> (&*first);
#endif
m_size = std::distance (first, last);
}
}
public:
typedef T value_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef T& reference;
typedef T const& const_reference;
typedef T* pointer;
typedef T const* const_pointer;
typedef T* iterator;
typedef T const* const_iterator;
typedef std::reverse_iterator <iterator> reverse_iterator;
typedef std::reverse_iterator <const_iterator> const_reverse_iterator;
// default construct
buffer_view () noexcept
: m_base (nullptr)
, m_size (0)
{
}
// copy construct
template <class U,
class = std::enable_if_t <
detail::buffer_view_convertible <T, U>::value>
>
buffer_view (buffer_view <U, Tag> v) noexcept
{
assign (v.begin(), v.end());
}
// construct from container
template <class C,
class = std::enable_if_t <
detail::buffer_view_container_compatible <T, C>::value
>
>
buffer_view (C& c) noexcept
{
assign (c.begin(), c.end());
}
// construct from pointer range
template <class U,
class = std::enable_if_t <
detail::buffer_view_convertible <T, U>::value>
>
buffer_view (U* first, U* last) noexcept
{
assign (first, last);
}
// construct from base and size
template <class U,
class = std::enable_if_t <
detail::buffer_view_convertible <T, U>::value>
>
buffer_view (U* u, std::size_t n) noexcept
: m_base (u)
, m_size (n)
{
}
// assign from container
template <class C,
class = std::enable_if_t <
detail::buffer_view_container_compatible <T, C>::value
>
>
buffer_view&
operator= (C& c) noexcept
{
assign (c.begin(), c.end());
return *this;
}
//
// Element access
//
reference
at (size_type pos)
{
if (! (pos < size()))
throw std::out_of_range ("bad array index");
return m_base [pos];
}
const_reference
at (size_type pos) const
{
if (! (pos < size()))
throw std::out_of_range ("bad array index");
return m_base [pos];
}
reference
operator[] (size_type pos) noexcept
{
return m_base [pos];
}
const_reference
operator[] (size_type pos) const noexcept
{
return m_base [pos];
}
reference
back() noexcept
{
return m_base [m_size - 1];
}
const_reference
back() const noexcept
{
return m_base [m_size - 1];
}
reference
front() noexcept
{
return *m_base;
}
const_reference
front() const noexcept
{
return *m_base;
}
pointer
data() noexcept
{
return m_base;
}
const_pointer
data() const noexcept
{
return m_base;
}
//
// Iterators
//
iterator
begin() noexcept
{
return m_base;
}
const_iterator
begin() const noexcept
{
return m_base;
}
const_iterator
cbegin() const noexcept
{
return m_base;
}
iterator
end() noexcept
{
return m_base + m_size;
}
const_iterator
end() const noexcept
{
return m_base + m_size;
}
const_iterator
cend() const noexcept
{
return m_base + m_size;
}
reverse_iterator
rbegin() noexcept
{
return reverse_iterator (end());
}
const_reverse_iterator
rbegin() const noexcept
{
return const_reverse_iterator (cend());
}
const_reverse_iterator
crbegin() const noexcept
{
return const_reverse_iterator (cend());
}
reverse_iterator
rend() noexcept
{
return reverse_iterator (begin());
}
const_reverse_iterator
rend() const noexcept
{
return const_reverse_iterator (cbegin());
}
const_reverse_iterator
crend() const noexcept
{
return const_reverse_iterator (cbegin());
}
//
// Capacity
//
bool
empty() const noexcept
{
return m_size == 0;
}
size_type
size() const noexcept
{
return m_size;
}
size_type
max_size() const noexcept
{
return size();
}
size_type
capacity() const noexcept
{
return size();
}
//
// Modifiers
//
template <class U, class K>
friend void swap (buffer_view <U, K>& lhs,
buffer_view <U, K>& rhs) noexcept;
};
//------------------------------------------------------------------------------
template <class T, class Tag>
inline
bool
operator== (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return std::equal (
lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend());
}
template <class T, class Tag>
inline
bool
operator!= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return ! (lhs == rhs);
}
template <class T, class Tag>
inline
bool
operator< (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return std::lexicographical_compare (
lhs.cbegin(), lhs.cend(), rhs.cbegin(), rhs.cend());
}
template <class T, class Tag>
inline
bool
operator>= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return ! (lhs < rhs);
}
template <class T, class Tag>
inline
bool
operator> (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return rhs < lhs;
}
template <class T, class Tag>
inline
bool
operator<= (buffer_view <T, Tag> lhs, buffer_view <T, Tag> rhs)
{
return ! (rhs < lhs);
}
template <class T, class Tag>
inline
void
swap (buffer_view <T, Tag>& lhs, buffer_view <T, Tag>& rhs) noexcept
{
std::swap (lhs.m_base, rhs.m_base);
std::swap (lhs.m_size, rhs.m_size);
}
//------------------------------------------------------------------------------
template <
class T,
class Tag = buffer_view_default_tag
>
using const_buffer_view = buffer_view <
std::add_const_t <T>, Tag>;
}
#endif

View File

@@ -0,0 +1,99 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_CONTAINER_CONST_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_CONST_CONTAINER_H_INCLUDED
namespace beast {
/** Adapter to constrain a container interface.
The interface allows for limited read only operations. Derived classes
provide additional behavior.
*/
template <class Container>
class const_container
{
private:
typedef Container cont_type;
cont_type m_cont;
protected:
cont_type& cont()
{
return m_cont;
}
cont_type const& cont() const
{
return m_cont;
}
public:
typedef typename cont_type::value_type value_type;
typedef typename cont_type::size_type size_type;
typedef typename cont_type::difference_type difference_type;
typedef typename cont_type::const_iterator iterator;
typedef typename cont_type::const_iterator const_iterator;
/** Returns `true` if the container is empty. */
bool
empty() const
{
return m_cont.empty();
}
/** Returns the number of items in the container. */
size_type
size() const
{
return m_cont.size();
}
/** Returns forward iterators for traversal. */
/** @{ */
const_iterator
begin() const
{
return m_cont.cbegin();
}
const_iterator
cbegin() const
{
return m_cont.cbegin();
}
const_iterator
end() const
{
return m_cont.cend();
}
const_iterator
cend() const
{
return m_cont.cend();
}
/** @} */
};
} // beast
#endif

View File

@@ -23,9 +23,6 @@
#include "aged_container_iterator.h"
#include "aged_associative_container.h"
#include "../../cxx14/algorithm.h"
#include "../../cxx14/type_traits.h"
#include "../aged_container.h"
#include "../../chrono/abstract_clock.h"
@@ -34,10 +31,12 @@
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/set.hpp>
#include "../../cxx14/algorithm.h" // <algorithm>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <memory>
#include "../../cxx14/type_traits.h" // <type_traits>
#include <utility>
namespace beast {

View File

@@ -31,12 +31,12 @@
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/unordered_set.hpp>
#include "../../cxx14/algorithm.h"
#include "../../cxx14/type_traits.h"
#include "../../cxx14/algorithm.h" // <algorithm>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <memory>
#include "../../cxx14/type_traits.h" // <type_traits>
#include <utility>
/*

View File

@@ -0,0 +1,171 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#ifndef BEAST_CONTAINER_HARDENED_HASH_H_INCLUDED
#define BEAST_CONTAINER_HARDENED_HASH_H_INCLUDED
#include "hash_append.h"
#include "../utility/noexcept.h"
#include <cstdint>
#include <functional>
#include <mutex>
#include <random>
#include "../cxx14/type_traits.h" // <type_traits>
#include <unordered_map>
#include <unordered_set>
#include "../cxx14/utility.h" // <utility>
// When set to 1, makes the seed per-process instead
// of per default-constructed instance of hardened_hash
//
#ifndef BEAST_NO_HARDENED_HASH_INSTANCE_SEED
# ifdef __GLIBCXX__
# define BEAST_NO_HARDENED_HASH_INSTANCE_SEED 1
# else
# define BEAST_NO_HARDENED_HASH_INSTANCE_SEED 0
# endif
#endif
namespace beast {
namespace detail {
template <class Result>
class hardened_hash_base
{
public:
typedef Result result_type;
private:
static
result_type
next_seed() noexcept
{
static std::mutex mutex;
static std::random_device rng;
static std::mt19937_64 gen (rng());
std::lock_guard <std::mutex> lock (mutex);
std::uniform_int_distribution <result_type> dist;
result_type value;
for(;;)
{
value = dist (gen);
// VFALCO Do we care if 0 is picked?
if (value != 0)
break;
}
return value;
}
#if BEAST_NO_HARDENED_HASH_INSTANCE_SEED
protected:
hardened_hash_base() noexcept = default;
hardened_hash_base(result_type) noexcept
{
}
result_type
seed() const noexcept
{
static result_type const value (next_seed());
return value;
}
#else
protected:
hardened_hash_base() noexcept
: m_seed (next_seed())
{
}
hardened_hash_base(result_type seed) noexcept
: m_seed (seed)
{
}
result_type
seed() const noexcept
{
return m_seed;
}
private:
// VFALCO Should seed be per process or per hash function?
result_type m_seed;
#endif
};
//------------------------------------------------------------------------------
} // detail
//------------------------------------------------------------------------------
/** A std compatible hash adapter that resists adversarial inputs.
For this to work, T must implement in its own namespace:
@code
template <class Hasher>
void
hash_append (Hasher& h, T const& t) noexcept
{
// hash_append each base and member that should
// participate in forming the hash
using beast::hash_append;
hash_append (h, static_cast<T::base1 const&>(t));
hash_append (h, static_cast<T::base2 const&>(t));
// ...
hash_append (h, t.member1);
hash_append (h, t.member2);
// ...
}
@endcode
*/
template <class T, class Hasher = detail::spooky_wrapper>
class hardened_hash
: public detail::hardened_hash_base <std::size_t>
{
typedef detail::hardened_hash_base <std::size_t> base;
public:
typedef T argument_type;
using detail::hardened_hash_base <std::size_t>::result_type;
public:
hardened_hash() = default;
explicit hardened_hash(result_type seed)
: base (seed)
{
}
result_type
operator() (argument_type const& key) const noexcept
{
Hasher h {base::seed()};
hash_append (h, key);
return static_cast<result_type> (h);
}
};
} // beast
#endif

View File

@@ -0,0 +1,717 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2014, Howard Hinnant <howard.hinnant@gmail.com>,
Vinnie Falco <vinnie.falco@gmail.com
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.
*/
//==============================================================================
#ifndef BEAST_CONTAINER_HASH_APPEND_H_INCLUDED
#define BEAST_CONTAINER_HASH_APPEND_H_INCLUDED
#include "../utility/meta.h"
#include "impl/spookyv2.h"
#if BEAST_USE_BOOST_FEATURES
#include <boost/shared_ptr.hpp>
#endif
#include "../utility/noexcept.h"
#include <array>
#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <tuple>
#include "../cxx14/type_traits.h" // <type_traits>
#include "../cxx14/utility.h" // <utility>
#include <vector>
// Set to 1 to disable variadic hash_append for tuple. When set, overloads
// will be manually provided for tuples up to 10-arity. This also causes
// is_contiguously_hashable<> to always return false for tuples.
//
#ifndef BEAST_NO_TUPLE_VARIADICS
# ifdef _MSC_VER
# define BEAST_NO_TUPLE_VARIADICS 1
# ifndef BEAST_VARIADIC_MAX
# ifdef _VARIADIC_MAX
# define BEAST_VARIADIC_MAX _VARIADIC_MAX
# else
# define BEAST_VARIADIC_MAX 10
# endif
# endif
# else
# define BEAST_NO_TUPLE_VARIADICS 0
# endif
#endif
// Set to 1 if std::pair fails the trait test on a platform.
#ifndef BEAST_NO_IS_CONTIGUOUS_HASHABLE_PAIR
#define BEAST_NO_IS_CONTIGUOUS_HASHABLE_PAIR 0
#endif
// Set to 1 if std::tuple fails the trait test on a platform.
#ifndef BEAST_NO_IS_CONTIGUOUS_HASHABLE_TUPLE
# ifdef _MSC_VER
# define BEAST_NO_IS_CONTIGUOUS_HASHABLE_TUPLE 1
# else
# define BEAST_NO_IS_CONTIGUOUS_HASHABLE_TUPLE 0
# endif
#endif
namespace beast {
/** Metafunction returning `true` if the type can be hashed in one call.
For `is_contiguously_hashable<T>::value` to be true, then for every
combination of possible values of `T` held in `x` and `y`,
if `x == y`, then it must be true that `memcmp(&x, &y, sizeof(T))`
return 0; i.e. that `x` and `y` are represented by the same bit pattern.
For example: A two's complement `int` should be contiguously hashable.
Every bit pattern produces a unique value that does not compare equal to
any other bit pattern's value. A IEEE floating point should not be
contiguously hashable because -0. and 0. have different bit patterns,
though they compare equal.
*/
/** @{ */
// scalars
template <class T>
struct is_contiguously_hashable
: public std::integral_constant <bool,
std::is_integral<T>::value ||
std::is_enum<T>::value ||
std::is_pointer<T>::value>
{
};
// If this fails, something is wrong with the trait
static_assert (is_contiguously_hashable<int>::value, "");
// pair
template <class T, class U>
struct is_contiguously_hashable <std::pair<T, U>>
: public std::integral_constant <bool,
is_contiguously_hashable<T>::value &&
is_contiguously_hashable<U>::value &&
sizeof(T) + sizeof(U) == sizeof(std::pair<T, U>)>
{
};
#if ! BEAST_NO_IS_CONTIGUOUS_HASHABLE_PAIR
static_assert (is_contiguously_hashable <std::pair <
unsigned long long, long long>>::value, "");
#endif
#if ! BEAST_NO_TUPLE_VARIADICS
// std::tuple
template <class ...T>
struct is_contiguously_hashable <std::tuple<T...>>
: public std::integral_constant <bool,
static_and <is_contiguously_hashable <T>::value...>::value &&
static_sum <sizeof(T)...>::value == sizeof(std::tuple<T...>)>
{
};
#endif
// std::array
template <class T, std::size_t N>
struct is_contiguously_hashable <std::array<T, N>>
: public std::integral_constant <bool,
is_contiguously_hashable<T>::value &&
sizeof(T)*N == sizeof(std::array<T, N>)>
{
};
static_assert (is_contiguously_hashable <std::array<char, 3>>::value, "");
#if ! BEAST_NO_IS_CONTIGUOUS_HASHABLE_TUPLE
static_assert (is_contiguously_hashable <
std::tuple <char, char, short>>::value, "");
#endif
/** @} */
//------------------------------------------------------------------------------
/** Logically concatenate input data to a `Hasher`.
Hasher requirements:
`X` is the type `Hasher`
`h` is a value of type `x`
`p` is a value convertible to `void const*`
`n` is a value of type `std::size_t`, greater than zero
Expression:
`h.append (p, n);`
Throws:
Never
Effect:
Adds the input data to the hasher state.
Expression:
`static_cast<std::size_t>(j)`
Throws:
Never
Effect:
Returns the reslting hash of all the input data.
*/
/** @{ */
// scalars
template <class Hasher, class T>
inline
typename std::enable_if
<
is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, T const& t) noexcept
{
h.append (&t, sizeof(t));
}
template <class Hasher, class T>
inline
typename std::enable_if
<
std::is_floating_point<T>::value
>::type
hash_append (Hasher& h, T t) noexcept
{
// hash both signed zeroes identically
if (t == 0)
t = 0;
h.append (&t, sizeof(t));
}
// arrays
template <class Hasher, class T, std::size_t N>
inline
typename std::enable_if
<
!is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, T (&a)[N]) noexcept
{
for (auto const& t : a)
hash_append (h, t);
}
template <class Hasher, class T, std::size_t N>
inline
typename std::enable_if
<
is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, T (&a)[N]) noexcept
{
h.append (a, N*sizeof(T));
}
// nullptr_t
template <class Hasher>
inline
void
hash_append (Hasher& h, std::nullptr_t p) noexcept
{
h.append (&p, sizeof(p));
}
// strings
template <class Hasher, class CharT, class Traits, class Alloc>
inline
void
hash_append (Hasher& h,
std::basic_string <CharT, Traits, Alloc> const& s) noexcept
{
h.append (s.data (), (s.size()+1)*sizeof(CharT));
}
//------------------------------------------------------------------------------
// Forward declare hash_append for all containers. This is required so that
// argument dependent lookup works recursively (i.e. containers of containers).
template <class Hasher, class T, class U>
typename std::enable_if
<
!is_contiguously_hashable<std::pair<T, U>>::value
>::type
hash_append (Hasher& h, std::pair<T, U> const& p) noexcept;
template <class Hasher, class T, class Alloc>
typename std::enable_if
<
!is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, std::vector<T, Alloc> const& v) noexcept;
template <class Hasher, class T, class Alloc>
typename std::enable_if
<
is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, std::vector<T, Alloc> const& v) noexcept;
template <class Hasher, class T, std::size_t N>
typename std::enable_if
<
!is_contiguously_hashable<std::array<T, N>>::value
>::type
hash_append (Hasher& h, std::array<T, N> const& a) noexcept;
// std::tuple
template <class Hasher>
inline
void
hash_append (Hasher& h, std::tuple<> const& t) noexcept;
#if BEAST_NO_TUPLE_VARIADICS
#if BEAST_VARIADIC_MAX >= 1
template <class Hasher, class T1>
inline
void
hash_append (Hasher& h, std::tuple <T1> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 2
template <class Hasher, class T1, class T2>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 3
template <class Hasher, class T1, class T2, class T3>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2, T3> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 4
template <class Hasher, class T1, class T2, class T3, class T4>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2, T3, T4> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 5
template <class Hasher, class T1, class T2, class T3, class T4, class T5>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2, T3, T4, T5> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 6
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 7
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 8
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 9
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8, class T9>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8, T9> const& t) noexcept;
#endif
#if BEAST_VARIADIC_MAX >= 10
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8, class T9, class T10>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> const& t) noexcept;
#endif
#endif // BEAST_NO_TUPLE_VARIADICS
//------------------------------------------------------------------------------
namespace detail {
template <class Hasher, class T>
inline
int
hash_one (Hasher& h, T const& t) noexcept
{
hash_append (h, t);
return 0;
}
} // detail
//------------------------------------------------------------------------------
// std::tuple
template <class Hasher>
inline
void
hash_append (Hasher& h, std::tuple<> const& t) noexcept
{
hash_append (h, nullptr);
}
#if BEAST_NO_TUPLE_VARIADICS
#if BEAST_VARIADIC_MAX >= 1
template <class Hasher, class T1>
inline
void
hash_append (Hasher& h, std::tuple <T1> const& t) noexcept
{
hash_append (h, std::get<0>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 2
template <class Hasher, class T1, class T2>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 3
template <class Hasher, class T1, class T2, class T3>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2, T3> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 4
template <class Hasher, class T1, class T2, class T3, class T4>
inline
void
hash_append (Hasher& h, std::tuple <T1, T2, T3, T4> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 5
template <class Hasher, class T1, class T2, class T3, class T4, class T5>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 6
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
hash_append (h, std::get<5>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 7
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
hash_append (h, std::get<5>(t));
hash_append (h, std::get<6>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 8
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
hash_append (h, std::get<5>(t));
hash_append (h, std::get<6>(t));
hash_append (h, std::get<7>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 9
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8, class T9>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8, T9> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
hash_append (h, std::get<5>(t));
hash_append (h, std::get<6>(t));
hash_append (h, std::get<7>(t));
hash_append (h, std::get<8>(t));
}
#endif
#if BEAST_VARIADIC_MAX >= 10
template <class Hasher, class T1, class T2, class T3, class T4, class T5,
class T6, class T7, class T8, class T9, class T10>
inline
void
hash_append (Hasher& h, std::tuple <
T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> const& t) noexcept
{
hash_append (h, std::get<0>(t));
hash_append (h, std::get<1>(t));
hash_append (h, std::get<2>(t));
hash_append (h, std::get<3>(t));
hash_append (h, std::get<4>(t));
hash_append (h, std::get<5>(t));
hash_append (h, std::get<6>(t));
hash_append (h, std::get<7>(t));
hash_append (h, std::get<8>(t));
hash_append (h, std::get<9>(t));
}
#endif
#else // BEAST_NO_TUPLE_VARIADICS
namespace detail {
template <class Hasher, class ...T, std::size_t ...I>
inline
void
tuple_hash (Hasher& h, std::tuple<T...> const& t,
std::index_sequence<I...>) noexcept
{
struct for_each_item {
for_each_item (...) { }
};
for_each_item (hash_one(h, std::get<I>(t))...);
}
} // detail
template <class Hasher, class ...T>
inline
typename std::enable_if
<
!is_contiguously_hashable<std::tuple<T...>>::value
>::type
hash_append (Hasher& h, std::tuple<T...> const& t) noexcept
{
detail::tuple_hash(h, t, std::index_sequence_for<T...>{});
}
#endif // BEAST_NO_TUPLE_VARIADICS
// pair
template <class Hasher, class T, class U>
inline
typename std::enable_if
<
!is_contiguously_hashable<std::pair<T, U>>::value
>::type
hash_append (Hasher& h, std::pair<T, U> const& p) noexcept
{
hash_append (h, p.first);
hash_append (h, p.second);
}
// vector
template <class Hasher, class T, class Alloc>
inline
typename std::enable_if
<
!is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, std::vector<T, Alloc> const& v) noexcept
{
for (auto const& t : v)
hash_append (h, t);
}
template <class Hasher, class T, class Alloc>
inline
typename std::enable_if
<
is_contiguously_hashable<T>::value
>::type
hash_append (Hasher& h, std::vector<T, Alloc> const& v) noexcept
{
h.append (v.data(), v.size()*sizeof(T));
}
// shared_ptr
template <class Hasher, class T>
inline
void
hash_append (Hasher& h, std::shared_ptr<T> const& p) noexcept
{
hash_append(h, p.get());
}
#if BEAST_USE_BOOST_FEATURES
template <class Hasher, class T>
inline
void
hash_append (Hasher& h, boost::shared_ptr<T> const& p) noexcept
{
hash_append(h, p.get());
}
#endif
// variadic hash_append
template <class Hasher, class T0, class T1, class ...T>
inline
void
hash_append (Hasher& h, T0 const& t0, T1 const& t1, T const& ...t) noexcept
{
hash_append (h, t0);
hash_append (h, t1, t...);
}
namespace detail
{
class spooky_wrapper
{
SpookyHash state_;
public:
using result_type = std::size_t;
spooky_wrapper (std::size_t seed1 = 1, std::size_t seed2 = 2) noexcept
{
state_.Init (seed1, seed2);
}
void
append (void const* key, std::size_t len) noexcept
{
state_.Update (key, len);
}
explicit
operator std::size_t() noexcept
{
std::uint64_t h1, h2;
state_.Final (&h1, &h2);
return static_cast <std::size_t> (h1);
}
};
} // detail
template <class Hasher = detail::spooky_wrapper>
struct uhash
{
using result_type = typename Hasher::result_type;
template <class T>
result_type
operator()(T const& t) const noexcept
{
Hasher h;
hash_append (h, t);
return static_cast<result_type>(h);
}
};
struct call_hash_value
{
template <class T>
std::size_t
operator()(T const& t) const noexcept
{
return hash_value(t);
}
};
} // beast
#endif

View File

@@ -0,0 +1,361 @@
// Spooky Hash
// A 128-bit noncryptographic hash, for checksums and table lookup
// By Bob Jenkins. Public domain.
// Oct 31 2010: published framework, disclaimer ShortHash isn't right
// Nov 7 2010: disabled ShortHash
// Oct 31 2011: replace End, ShortMix, ShortEnd, enable ShortHash again
// April 10 2012: buffer overflow on platforms without unaligned reads
// July 12 2012: was passing out variables in final to in/out in short
// July 30 2012: I reintroduced the buffer overflow
// August 5 2012: SpookyV2: d = should be d += in short hash, and remove extra mix from long hash
#include <memory.h>
#include "spookyv2.h"
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable: 4127) // conditional expression is constant
#pragma warning (disable: 4244) // conversion from 'size_t' to 'uint8', possible loss of data
#endif
#define ALLOW_UNALIGNED_READS 1
//
// short hash ... it could be used on any message,
// but it's used by Spooky just for short messages.
//
void SpookyHash::Short(
const void *message,
size_t length,
uint64 *hash1,
uint64 *hash2)
{
uint64 buf[2*sc_numVars];
union
{
const uint8 *p8;
uint32 *p32;
uint64 *p64;
size_t i;
} u;
u.p8 = (const uint8 *)message;
if (!ALLOW_UNALIGNED_READS && (u.i & 0x7))
{
memcpy(buf, message, length);
u.p64 = buf;
}
size_t remainder = length%32;
uint64 a=*hash1;
uint64 b=*hash2;
uint64 c=sc_const;
uint64 d=sc_const;
if (length > 15)
{
const uint64 *end = u.p64 + (length/32)*4;
// handle all complete sets of 32 bytes
for (; u.p64 < end; u.p64 += 4)
{
c += u.p64[0];
d += u.p64[1];
ShortMix(a,b,c,d);
a += u.p64[2];
b += u.p64[3];
}
//Handle the case of 16+ remaining bytes.
if (remainder >= 16)
{
c += u.p64[0];
d += u.p64[1];
ShortMix(a,b,c,d);
u.p64 += 2;
remainder -= 16;
}
}
// Handle the last 0..15 bytes, and its length
d += ((uint64)length) << 56;
switch (remainder)
{
case 15:
d += ((uint64)u.p8[14]) << 48;
case 14:
d += ((uint64)u.p8[13]) << 40;
case 13:
d += ((uint64)u.p8[12]) << 32;
case 12:
d += u.p32[2];
c += u.p64[0];
break;
case 11:
d += ((uint64)u.p8[10]) << 16;
case 10:
d += ((uint64)u.p8[9]) << 8;
case 9:
d += (uint64)u.p8[8];
case 8:
c += u.p64[0];
break;
case 7:
c += ((uint64)u.p8[6]) << 48;
case 6:
c += ((uint64)u.p8[5]) << 40;
case 5:
c += ((uint64)u.p8[4]) << 32;
case 4:
c += u.p32[0];
break;
case 3:
c += ((uint64)u.p8[2]) << 16;
case 2:
c += ((uint64)u.p8[1]) << 8;
case 1:
c += (uint64)u.p8[0];
break;
case 0:
c += sc_const;
d += sc_const;
}
ShortEnd(a,b,c,d);
*hash1 = a;
*hash2 = b;
}
// do the whole hash in one call
void SpookyHash::Hash128(
const void *message,
size_t length,
uint64 *hash1,
uint64 *hash2)
{
if (length < sc_bufSize)
{
Short(message, length, hash1, hash2);
return;
}
uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
uint64 buf[sc_numVars];
uint64 *end;
union
{
const uint8 *p8;
uint64 *p64;
size_t i;
} u;
size_t remainder;
h0=h3=h6=h9 = *hash1;
h1=h4=h7=h10 = *hash2;
h2=h5=h8=h11 = sc_const;
u.p8 = (const uint8 *)message;
end = u.p64 + (length/sc_blockSize)*sc_numVars;
// handle all whole sc_blockSize blocks of bytes
if (ALLOW_UNALIGNED_READS || ((u.i & 0x7) == 0))
{
while (u.p64 < end)
{
Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
u.p64 += sc_numVars;
}
}
else
{
while (u.p64 < end)
{
memcpy(buf, u.p64, sc_blockSize);
Mix(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
u.p64 += sc_numVars;
}
}
// handle the last partial block of sc_blockSize bytes
remainder = (length - ((const uint8 *)end-(const uint8 *)message));
memcpy(buf, end, remainder);
memset(((uint8 *)buf)+remainder, 0, sc_blockSize-remainder);
((uint8 *)buf)[sc_blockSize-1] =
static_cast<uint8>(remainder);
// do some final mixing
End(buf, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
*hash1 = h0;
*hash2 = h1;
}
// init spooky state
void SpookyHash::Init(uint64 seed1, uint64 seed2)
{
m_length = 0;
m_remainder = 0;
m_state[0] = seed1;
m_state[1] = seed2;
}
// add a message fragment to the state
void SpookyHash::Update(const void *message, size_t length)
{
uint64 h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11;
size_t newLength = length + m_remainder;
uint8 remainder;
union
{
const uint8 *p8;
uint64 *p64;
size_t i;
} u;
const uint64 *end;
// Is this message fragment too short? If it is, stuff it away.
if (newLength < sc_bufSize)
{
memcpy(&((uint8 *)m_data)[m_remainder], message, length);
m_length = length + m_length;
m_remainder = (uint8)newLength;
return;
}
// init the variables
if (m_length < sc_bufSize)
{
h0=h3=h6=h9 = m_state[0];
h1=h4=h7=h10 = m_state[1];
h2=h5=h8=h11 = sc_const;
}
else
{
h0 = m_state[0];
h1 = m_state[1];
h2 = m_state[2];
h3 = m_state[3];
h4 = m_state[4];
h5 = m_state[5];
h6 = m_state[6];
h7 = m_state[7];
h8 = m_state[8];
h9 = m_state[9];
h10 = m_state[10];
h11 = m_state[11];
}
m_length = length + m_length;
// if we've got anything stuffed away, use it now
if (m_remainder)
{
uint8 prefix = sc_bufSize-m_remainder;
memcpy(&(((uint8 *)m_data)[m_remainder]), message, prefix);
u.p64 = m_data;
Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
Mix(&u.p64[sc_numVars], h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
u.p8 = ((const uint8 *)message) + prefix;
length -= prefix;
}
else
{
u.p8 = (const uint8 *)message;
}
// handle all whole blocks of sc_blockSize bytes
end = u.p64 + (length/sc_blockSize)*sc_numVars;
remainder = (uint8)(length-((const uint8 *)end-u.p8));
if (ALLOW_UNALIGNED_READS || (u.i & 0x7) == 0)
{
while (u.p64 < end)
{
Mix(u.p64, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
u.p64 += sc_numVars;
}
}
else
{
while (u.p64 < end)
{
memcpy(m_data, u.p8, sc_blockSize);
Mix(m_data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
u.p64 += sc_numVars;
}
}
// stuff away the last few bytes
m_remainder = remainder;
memcpy(m_data, end, remainder);
// stuff away the variables
m_state[0] = h0;
m_state[1] = h1;
m_state[2] = h2;
m_state[3] = h3;
m_state[4] = h4;
m_state[5] = h5;
m_state[6] = h6;
m_state[7] = h7;
m_state[8] = h8;
m_state[9] = h9;
m_state[10] = h10;
m_state[11] = h11;
}
// report the hash for the concatenation of all message fragments so far
void SpookyHash::Final(uint64 *hash1, uint64 *hash2)
{
// init the variables
if (m_length < sc_bufSize)
{
*hash1 = m_state[0];
*hash2 = m_state[1];
Short( m_data, m_length, hash1, hash2);
return;
}
const uint64 *data = (const uint64 *)m_data;
uint8 remainder = m_remainder;
uint64 h0 = m_state[0];
uint64 h1 = m_state[1];
uint64 h2 = m_state[2];
uint64 h3 = m_state[3];
uint64 h4 = m_state[4];
uint64 h5 = m_state[5];
uint64 h6 = m_state[6];
uint64 h7 = m_state[7];
uint64 h8 = m_state[8];
uint64 h9 = m_state[9];
uint64 h10 = m_state[10];
uint64 h11 = m_state[11];
if (remainder >= sc_blockSize)
{
// m_data can contain two blocks; handle any whole first block
Mix(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
data += sc_numVars;
remainder -= sc_blockSize;
}
// mix in the last partial block, and the length mod sc_blockSize
memset(&((uint8 *)data)[remainder], 0, (sc_blockSize-remainder));
((uint8 *)data)[sc_blockSize-1] = remainder;
// do some final mixing
End(data, h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
*hash1 = h0;
*hash2 = h1;
}
#ifdef _MSC_VER
#pragma warning (pop)
#endif

View File

@@ -0,0 +1,301 @@
//
// SpookyHash: a 128-bit noncryptographic hash function
// By Bob Jenkins, public domain
// Oct 31 2010: alpha, framework + SpookyHash::Mix appears right
// Oct 31 2011: alpha again, Mix only good to 2^^69 but rest appears right
// Dec 31 2011: beta, improved Mix, tested it for 2-bit deltas
// Feb 2 2012: production, same bits as beta
// Feb 5 2012: adjusted definitions of uint* to be more portable
// Mar 30 2012: 3 bytes/cycle, not 4. Alpha was 4 but wasn't thorough enough.
// August 5 2012: SpookyV2 (different results)
//
// Up to 3 bytes/cycle for long messages. Reasonably fast for short messages.
// All 1 or 2 bit deltas achieve avalanche within 1% bias per output bit.
//
// This was developed for and tested on 64-bit x86-compatible processors.
// It assumes the processor is little-endian. There is a macro
// controlling whether unaligned reads are allowed (by default they are).
// This should be an equally good hash on big-endian machines, but it will
// compute different results on them than on little-endian machines.
//
// Google's CityHash has similar specs to SpookyHash, and CityHash is faster
// on new Intel boxes. MD4 and MD5 also have similar specs, but they are orders
// of magnitude slower. CRCs are two or more times slower, but unlike
// SpookyHash, they have nice math for combining the CRCs of pieces to form
// the CRCs of wholes. There are also cryptographic hashes, but those are even
// slower than MD5.
//
#ifndef BEAST_SPOOKYV2_H_INCLUDED
#define BEAST_SPOOKYV2_H_INCLUDED
#include <stddef.h>
#ifdef _MSC_VER
# define INLINE __forceinline
typedef unsigned __int64 uint64;
typedef unsigned __int32 uint32;
typedef unsigned __int16 uint16;
typedef unsigned __int8 uint8;
#else
# include <stdint.h>
# define INLINE inline
typedef uint64_t uint64;
typedef uint32_t uint32;
typedef uint16_t uint16;
typedef uint8_t uint8;
#endif
class SpookyHash
{
public:
//
// SpookyHash: hash a single message in one call, produce 128-bit output
//
static void Hash128(
const void *message, // message to hash
size_t length, // length of message in bytes
uint64 *hash1, // in/out: in seed 1, out hash value 1
uint64 *hash2); // in/out: in seed 2, out hash value 2
//
// Hash64: hash a single message in one call, return 64-bit output
//
static uint64 Hash64(
const void *message, // message to hash
size_t length, // length of message in bytes
uint64 seed) // seed
{
uint64 hash1 = seed;
Hash128(message, length, &hash1, &seed);
return hash1;
}
//
// Hash32: hash a single message in one call, produce 32-bit output
//
static uint32 Hash32(
const void *message, // message to hash
size_t length, // length of message in bytes
uint32 seed) // seed
{
uint64 hash1 = seed, hash2 = seed;
Hash128(message, length, &hash1, &hash2);
return (uint32)hash1;
}
//
// Init: initialize the context of a SpookyHash
//
void Init(
uint64 seed1, // any 64-bit value will do, including 0
uint64 seed2); // different seeds produce independent hashes
//
// Update: add a piece of a message to a SpookyHash state
//
void Update(
const void *message, // message fragment
size_t length); // length of message fragment in bytes
//
// Final: compute the hash for the current SpookyHash state
//
// This does not modify the state; you can keep updating it afterward
//
// The result is the same as if SpookyHash() had been called with
// all the pieces concatenated into one message.
//
void Final(
uint64 *hash1, // out only: first 64 bits of hash value.
uint64 *hash2); // out only: second 64 bits of hash value.
//
// left rotate a 64-bit value by k bytes
//
static INLINE uint64 Rot64(uint64 x, int k)
{
return (x << k) | (x >> (64 - k));
}
//
// This is used if the input is 96 bytes long or longer.
//
// The internal state is fully overwritten every 96 bytes.
// Every input bit appears to cause at least 128 bits of entropy
// before 96 other bytes are combined, when run forward or backward
// For every input bit,
// Two inputs differing in just that input bit
// Where "differ" means xor or subtraction
// And the base value is random
// When run forward or backwards one Mix
// I tried 3 pairs of each; they all differed by at least 212 bits.
//
static INLINE void Mix(
const uint64 *data,
uint64 &s0, uint64 &s1, uint64 &s2, uint64 &s3,
uint64 &s4, uint64 &s5, uint64 &s6, uint64 &s7,
uint64 &s8, uint64 &s9, uint64 &s10,uint64 &s11)
{
s0 += data[0]; s2 ^= s10; s11 ^= s0; s0 = Rot64(s0,11); s11 += s1;
s1 += data[1]; s3 ^= s11; s0 ^= s1; s1 = Rot64(s1,32); s0 += s2;
s2 += data[2]; s4 ^= s0; s1 ^= s2; s2 = Rot64(s2,43); s1 += s3;
s3 += data[3]; s5 ^= s1; s2 ^= s3; s3 = Rot64(s3,31); s2 += s4;
s4 += data[4]; s6 ^= s2; s3 ^= s4; s4 = Rot64(s4,17); s3 += s5;
s5 += data[5]; s7 ^= s3; s4 ^= s5; s5 = Rot64(s5,28); s4 += s6;
s6 += data[6]; s8 ^= s4; s5 ^= s6; s6 = Rot64(s6,39); s5 += s7;
s7 += data[7]; s9 ^= s5; s6 ^= s7; s7 = Rot64(s7,57); s6 += s8;
s8 += data[8]; s10 ^= s6; s7 ^= s8; s8 = Rot64(s8,55); s7 += s9;
s9 += data[9]; s11 ^= s7; s8 ^= s9; s9 = Rot64(s9,54); s8 += s10;
s10 += data[10]; s0 ^= s8; s9 ^= s10; s10 = Rot64(s10,22); s9 += s11;
s11 += data[11]; s1 ^= s9; s10 ^= s11; s11 = Rot64(s11,46); s10 += s0;
}
//
// Mix all 12 inputs together so that h0, h1 are a hash of them all.
//
// For two inputs differing in just the input bits
// Where "differ" means xor or subtraction
// And the base value is random, or a counting value starting at that bit
// The final result will have each bit of h0, h1 flip
// For every input bit,
// with probability 50 +- .3%
// For every pair of input bits,
// with probability 50 +- 3%
//
// This does not rely on the last Mix() call having already mixed some.
// Two iterations was almost good enough for a 64-bit result, but a
// 128-bit result is reported, so End() does three iterations.
//
static INLINE void EndPartial(
uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7,
uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
{
h11+= h1; h2 ^= h11; h1 = Rot64(h1,44);
h0 += h2; h3 ^= h0; h2 = Rot64(h2,15);
h1 += h3; h4 ^= h1; h3 = Rot64(h3,34);
h2 += h4; h5 ^= h2; h4 = Rot64(h4,21);
h3 += h5; h6 ^= h3; h5 = Rot64(h5,38);
h4 += h6; h7 ^= h4; h6 = Rot64(h6,33);
h5 += h7; h8 ^= h5; h7 = Rot64(h7,10);
h6 += h8; h9 ^= h6; h8 = Rot64(h8,13);
h7 += h9; h10^= h7; h9 = Rot64(h9,38);
h8 += h10; h11^= h8; h10= Rot64(h10,53);
h9 += h11; h0 ^= h9; h11= Rot64(h11,42);
h10+= h0; h1 ^= h10; h0 = Rot64(h0,54);
}
static INLINE void End(
const uint64 *data,
uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3,
uint64 &h4, uint64 &h5, uint64 &h6, uint64 &h7,
uint64 &h8, uint64 &h9, uint64 &h10,uint64 &h11)
{
h0 += data[0]; h1 += data[1]; h2 += data[2]; h3 += data[3];
h4 += data[4]; h5 += data[5]; h6 += data[6]; h7 += data[7];
h8 += data[8]; h9 += data[9]; h10 += data[10]; h11 += data[11];
EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
EndPartial(h0,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11);
}
//
// The goal is for each bit of the input to expand into 128 bits of
// apparent entropy before it is fully overwritten.
// n trials both set and cleared at least m bits of h0 h1 h2 h3
// n: 2 m: 29
// n: 3 m: 46
// n: 4 m: 57
// n: 5 m: 107
// n: 6 m: 146
// n: 7 m: 152
// when run forwards or backwards
// for all 1-bit and 2-bit diffs
// with diffs defined by either xor or subtraction
// with a base of all zeros plus a counter, or plus another bit, or random
//
static INLINE void ShortMix(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
{
h2 = Rot64(h2,50); h2 += h3; h0 ^= h2;
h3 = Rot64(h3,52); h3 += h0; h1 ^= h3;
h0 = Rot64(h0,30); h0 += h1; h2 ^= h0;
h1 = Rot64(h1,41); h1 += h2; h3 ^= h1;
h2 = Rot64(h2,54); h2 += h3; h0 ^= h2;
h3 = Rot64(h3,48); h3 += h0; h1 ^= h3;
h0 = Rot64(h0,38); h0 += h1; h2 ^= h0;
h1 = Rot64(h1,37); h1 += h2; h3 ^= h1;
h2 = Rot64(h2,62); h2 += h3; h0 ^= h2;
h3 = Rot64(h3,34); h3 += h0; h1 ^= h3;
h0 = Rot64(h0,5); h0 += h1; h2 ^= h0;
h1 = Rot64(h1,36); h1 += h2; h3 ^= h1;
}
//
// Mix all 4 inputs together so that h0, h1 are a hash of them all.
//
// For two inputs differing in just the input bits
// Where "differ" means xor or subtraction
// And the base value is random, or a counting value starting at that bit
// The final result will have each bit of h0, h1 flip
// For every input bit,
// with probability 50 +- .3% (it is probably better than that)
// For every pair of input bits,
// with probability 50 +- .75% (the worst case is approximately that)
//
static INLINE void ShortEnd(uint64 &h0, uint64 &h1, uint64 &h2, uint64 &h3)
{
h3 ^= h2; h2 = Rot64(h2,15); h3 += h2;
h0 ^= h3; h3 = Rot64(h3,52); h0 += h3;
h1 ^= h0; h0 = Rot64(h0,26); h1 += h0;
h2 ^= h1; h1 = Rot64(h1,51); h2 += h1;
h3 ^= h2; h2 = Rot64(h2,28); h3 += h2;
h0 ^= h3; h3 = Rot64(h3,9); h0 += h3;
h1 ^= h0; h0 = Rot64(h0,47); h1 += h0;
h2 ^= h1; h1 = Rot64(h1,54); h2 += h1;
h3 ^= h2; h2 = Rot64(h2,32); h3 += h2;
h0 ^= h3; h3 = Rot64(h3,25); h0 += h3;
h1 ^= h0; h0 = Rot64(h0,63); h1 += h0;
}
private:
//
// Short is used for messages under 192 bytes in length
// Short has a low startup cost, the normal mode is good for long
// keys, the cost crossover is at about 192 bytes. The two modes were
// held to the same quality bar.
//
static void Short(
const void *message, // message (array of bytes, not necessarily aligned)
size_t length, // length of message (in bytes)
uint64 *hash1, // in/out: in the seed, out the hash value
uint64 *hash2); // in/out: in the seed, out the hash value
// number of uint64's in internal state
static const size_t sc_numVars = 12;
// size of the internal state
static const size_t sc_blockSize = sc_numVars*8;
// size of buffer of unhashed data, in bytes
static const size_t sc_bufSize = 2*sc_blockSize;
//
// sc_const: a constant which:
// * is not zero
// * is odd
// * is a not-very-regular mix of 1's and 0's
// * does not need any other special mathematical properties
//
static const uint64 sc_const = 0xdeadbeefdeadbeefUL;
uint64 m_data[2*sc_numVars]; // unhashed data, for partial messages
uint64 m_state[sc_numVars]; // internal state of the hash
size_t m_length; // total length of the input so far
uint8 m_remainder; // length of unhashed data stashed in m_data
};
#endif // BEAST_SPOOKYV2_H_INCLUDED

View File

@@ -17,8 +17,9 @@
*/
//==============================================================================
#include "../../../modules/beast_core/beast_core.h" // for UnitTest
#include "../../chrono/manual_clock.h"
#include "../../unit_test/suite.h"
#include "../aged_set.h"
#include "../aged_map.h"
#include "../aged_multiset.h"
@@ -28,6 +29,9 @@
#include "../aged_unordered_multiset.h"
#include "../aged_unordered_multimap.h"
#include <vector>
#include <list>
#ifndef BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR
# ifdef _MSC_VER
# define BEAST_AGED_UNORDERED_NO_ALLOC_DEFAULTCTOR 0
@@ -46,7 +50,7 @@
namespace beast {
class aged_associative_container_TestsBase : public UnitTest
class aged_associative_container_test_base : public unit_test::suite
{
public:
template <class T>
@@ -392,56 +396,6 @@ public:
//--------------------------------------------------------------------------
// Compile time checks
//
void checkAliases ()
{
typedef std::string Key;
typedef int T;
static_assert (std::is_same <
aged_set <Key>,
detail::aged_ordered_container <false, false, Key, void>>::value,
"bad alias: aged_set");
static_assert (std::is_same <
aged_multiset <Key>,
detail::aged_ordered_container <true, false, Key, void>>::value,
"bad alias: aged_multiset");
static_assert (std::is_same <
aged_map <Key, T>,
detail::aged_ordered_container <false, true, Key, T>>::value,
"bad alias: aged_map");
static_assert (std::is_same <
aged_multimap <Key, T>,
detail::aged_ordered_container <true, true, Key, T>>::value,
"bad alias: aged_multimap");
static_assert (std::is_same <
aged_unordered_set <Key>,
detail::aged_unordered_container <false, false, Key, void>>::value,
"bad alias: aged_unordered_set");
static_assert (std::is_same <
aged_unordered_multiset <Key>,
detail::aged_unordered_container <true, false, Key, void>>::value,
"bad alias: aged_unordered_multiset");
static_assert (std::is_same <
aged_unordered_map <Key, T>,
detail::aged_unordered_container <false, true, Key, T>>::value,
"bad alias: aged_unordered_map");
static_assert (std::is_same <
aged_unordered_multimap <Key, T>,
detail::aged_unordered_container <true, true, Key, T>>::value,
"bad alias: aged_unordered_multimap");
}
//--------------------------------------------------------------------------
template <
class Container,
class Values
@@ -603,11 +557,6 @@ public:
template <bool IsUnordered>
void testMaybeUnordered();
aged_associative_container_TestsBase () : UnitTest (
"aged_associative_container", "beast")
{
}
};
//------------------------------------------------------------------------------
@@ -620,7 +569,7 @@ template <
>
typename std::enable_if <
Container::is_map::value && ! Container::is_multi::value>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkMapContents (Container& c, Values const& v)
{
if (v.empty())
@@ -651,7 +600,7 @@ template <
>
typename std::enable_if <
std::remove_reference <C>::type::is_unordered::value>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkUnorderedContentsRefRef (C&& c, Values const& v)
{
typedef typename std::remove_reference <C>::type Cont;
@@ -685,7 +634,7 @@ checkUnorderedContentsRefRef (C&& c, Values const& v)
template <class C, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkContentsRefRef (C&& c, Values const& v)
{
typedef typename std::remove_reference <C>::type Cont;
@@ -715,7 +664,7 @@ checkContentsRefRef (C&& c, Values const& v)
template <class Cont, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkContents (Cont& c, Values const& v)
{
checkContentsRefRef (c, v);
@@ -725,7 +674,7 @@ checkContents (Cont& c, Values const& v)
template <class Cont>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkContents (Cont& c)
{
typedef TestTraits <
@@ -746,7 +695,7 @@ checkContents (Cont& c)
// ordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <! IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructEmpty ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -760,7 +709,8 @@ testConstructEmpty ()
typedef typename Traits::MyAlloc MyAlloc;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " empty");
//testcase (Traits::name() + " empty");
testcase ("empty");
{
typename Traits::template Cont <Comp, Alloc> c (
@@ -790,7 +740,7 @@ testConstructEmpty ()
// unordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructEmpty ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -806,8 +756,8 @@ testConstructEmpty ()
typedef typename Traits::MyAlloc MyAlloc;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " empty");
//testcase (Traits::name() + " empty");
testcase ("empty");
{
typename Traits::template Cont <Hash, Equal, Alloc> c (
clock);
@@ -860,7 +810,7 @@ testConstructEmpty ()
// ordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <! IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructRange ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -875,7 +825,8 @@ testConstructRange ()
typename Traits::Clock clock;
auto const v (Traits::values());
beginTestCase (Traits::name() + " range");
//testcase (Traits::name() + " range");
testcase ("range");
{
typename Traits::template Cont <Comp, Alloc> c (
@@ -922,7 +873,7 @@ testConstructRange ()
// unordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructRange ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -939,7 +890,8 @@ testConstructRange ()
typename Traits::Clock clock;
auto const v (Traits::values());
beginTestCase (Traits::name() + " range");
//testcase (Traits::name() + " range");
testcase ("range");
{
typename Traits::template Cont <Hash, Equal, Alloc> c (
@@ -1001,7 +953,7 @@ testConstructRange ()
// ordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <! IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructInitList ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1015,7 +967,8 @@ testConstructInitList ()
typedef typename Traits::MyAlloc MyAlloc;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " init-list");
//testcase (Traits::name() + " init-list");
testcase ("init-list");
// VFALCO TODO
@@ -1025,7 +978,7 @@ testConstructInitList ()
// unordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testConstructInitList ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1041,7 +994,9 @@ testConstructInitList ()
typedef typename Traits::MyAlloc MyAlloc;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " init-list");
//testcase (Traits::name() + " init-list");
testcase ("init-list");
// VFALCO TODO
pass();
}
@@ -1054,7 +1009,7 @@ testConstructInitList ()
template <bool IsUnordered, bool IsMulti, bool IsMap>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testCopyMove ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1063,7 +1018,8 @@ testCopyMove ()
typename Traits::Clock clock;
auto const v (Traits::values());
beginTestCase (Traits::name() + " copy/move");
//testcase (Traits::name() + " copy/move");
testcase ("copy/move");
// copy
@@ -1136,7 +1092,7 @@ testCopyMove ()
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkInsertCopy (Container& c, Values const& v)
{
for (auto const& e : v)
@@ -1146,7 +1102,7 @@ checkInsertCopy (Container& c, Values const& v)
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkInsertMove (Container& c, Values const& v)
{
Values v2 (v);
@@ -1157,7 +1113,7 @@ checkInsertMove (Container& c, Values const& v)
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkInsertHintCopy (Container& c, Values const& v)
{
for (auto const& e : v)
@@ -1167,7 +1123,7 @@ checkInsertHintCopy (Container& c, Values const& v)
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkInsertHintMove (Container& c, Values const& v)
{
Values v2 (v);
@@ -1178,7 +1134,7 @@ checkInsertHintMove (Container& c, Values const& v)
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkEmplace (Container& c, Values const& v)
{
for (auto const& e : v)
@@ -1188,7 +1144,7 @@ checkEmplace (Container& c, Values const& v)
template <class Container, class Values>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
checkEmplaceHint (Container& c, Values const& v)
{
for (auto const& e : v)
@@ -1198,7 +1154,7 @@ checkEmplaceHint (Container& c, Values const& v)
template <bool IsUnordered, bool IsMulti, bool IsMap>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testModifiers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1206,7 +1162,8 @@ testModifiers()
auto const v (Traits::values());
auto const l (make_list (v));
beginTestCase (Traits::name() + " modify");
//testcase (Traits::name() + " modify");
testcase ("modify");
{
typename Traits::template Cont <> c (clock);
@@ -1257,7 +1214,7 @@ testModifiers()
template <bool IsUnordered, bool IsMulti, bool IsMap>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testChronological ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1265,7 +1222,8 @@ testChronological ()
typename Traits::Clock clock;
auto const v (Traits::values());
beginTestCase (Traits::name() + " chronological");
//testcase (Traits::name() + " chronological");
testcase ("chronological");
typename Traits::template Cont <> c (
v.begin(), v.end(), clock);
@@ -1297,14 +1255,15 @@ testChronological ()
// map, unordered_map
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <IsMap && ! IsMulti>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testArrayCreate()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typename Traits::Clock clock;
auto v (Traits::values());
beginTestCase (Traits::name() + " array create");
//testcase (Traits::name() + " array create");
testcase ("array create");
{
// Copy construct key
@@ -1332,7 +1291,7 @@ testArrayCreate()
// ordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <! IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testCompare ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1340,7 +1299,8 @@ testCompare ()
typename Traits::Clock clock;
auto const v (Traits::values());
beginTestCase (Traits::name() + " array create");
//testcase (Traits::name() + " array create");
testcase ("array create");
typename Traits::template Cont <> c1 (
v.begin(), v.end(), clock);
@@ -1366,13 +1326,14 @@ testCompare ()
// ordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <! IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testObservers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " observers");
//testcase (Traits::name() + " observers");
testcase ("observers");
typename Traits::template Cont <> c (clock);
c.key_comp();
@@ -1384,13 +1345,14 @@ testObservers()
// unordered
template <bool IsUnordered, bool IsMulti, bool IsMap>
typename std::enable_if <IsUnordered>::type
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testObservers()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
typename Traits::Clock clock;
beginTestCase (Traits::name() + " observers");
//testcase (Traits::name() + " observers");
testcase ("observers");
typename Traits::template Cont <> c (clock);
c.hash_function();
@@ -1407,7 +1369,7 @@ testObservers()
template <bool IsUnordered, bool IsMulti, bool IsMap>
void
aged_associative_container_TestsBase::
aged_associative_container_test_base::
testMaybeUnorderedMultiMap ()
{
typedef TestTraits <IsUnordered, IsMulti, IsMap> Traits;
@@ -1423,38 +1385,133 @@ testMaybeUnorderedMultiMap ()
testObservers <IsUnordered, IsMulti, IsMap> ();
}
template <bool IsUnordered, bool IsMulti>
void
aged_associative_container_TestsBase::
testMaybeUnorderedMulti()
{
testMaybeUnorderedMultiMap <IsUnordered, IsMulti, false> ();
testMaybeUnorderedMultiMap <IsUnordered, IsMulti, true> ();
}
template <bool IsUnordered>
void
aged_associative_container_TestsBase::
testMaybeUnordered()
{
testMaybeUnorderedMulti <IsUnordered, false> ();
testMaybeUnorderedMulti <IsUnordered, true> ();
}
//------------------------------------------------------------------------------
class aged_associative_container_Tests :
public aged_associative_container_TestsBase
class aged_set_test : public aged_associative_container_test_base
{
public:
void runTest ()
// Compile time checks
typedef std::string Key;
typedef int T;
static_assert (std::is_same <
aged_set <Key>,
detail::aged_ordered_container <false, false, Key, void>>::value,
"bad alias: aged_set");
static_assert (std::is_same <
aged_multiset <Key>,
detail::aged_ordered_container <true, false, Key, void>>::value,
"bad alias: aged_multiset");
static_assert (std::is_same <
aged_map <Key, T>,
detail::aged_ordered_container <false, true, Key, T>>::value,
"bad alias: aged_map");
static_assert (std::is_same <
aged_multimap <Key, T>,
detail::aged_ordered_container <true, true, Key, T>>::value,
"bad alias: aged_multimap");
static_assert (std::is_same <
aged_unordered_set <Key>,
detail::aged_unordered_container <false, false, Key, void>>::value,
"bad alias: aged_unordered_set");
static_assert (std::is_same <
aged_unordered_multiset <Key>,
detail::aged_unordered_container <true, false, Key, void>>::value,
"bad alias: aged_unordered_multiset");
static_assert (std::is_same <
aged_unordered_map <Key, T>,
detail::aged_unordered_container <false, true, Key, T>>::value,
"bad alias: aged_unordered_map");
static_assert (std::is_same <
aged_unordered_multimap <Key, T>,
detail::aged_unordered_container <true, true, Key, T>>::value,
"bad alias: aged_unordered_multimap");
void run ()
{
checkAliases ();
testMaybeUnordered <false> ();
testMaybeUnordered <true> ();
testMaybeUnorderedMultiMap <false, false, false>();
}
};
static aged_associative_container_Tests aged_associative_container_tests;
class aged_map_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <false, false, true>();
}
};
class aged_multiset_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <false, true, false>();
}
};
class aged_multimap_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <false, true, true>();
}
};
class aged_unordered_set_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <true, false, false>();
}
};
class aged_unordered_map_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <true, false, true>();
}
};
class aged_unordered_multiset_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <true, true, false>();
}
};
class aged_unordered_multimap_test : public aged_associative_container_test_base
{
public:
void run ()
{
testMaybeUnorderedMultiMap <true, true, true>();
}
};
BEAST_DEFINE_TESTSUITE(aged_set,container,beast);
BEAST_DEFINE_TESTSUITE(aged_map,container,beast);
BEAST_DEFINE_TESTSUITE(aged_multiset,container,beast);
BEAST_DEFINE_TESTSUITE(aged_multimap,container,beast);
BEAST_DEFINE_TESTSUITE(aged_unordered_set,container,beast);
BEAST_DEFINE_TESTSUITE(aged_unordered_map,container,beast);
BEAST_DEFINE_TESTSUITE(aged_unordered_multiset,container,beast);
BEAST_DEFINE_TESTSUITE(aged_unordered_multimap,container,beast);
}

View File

@@ -0,0 +1,320 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
#include "../../unit_test/suite.h"
#include "../buffer_view.h"
#include "../../cxx14/algorithm.h" // <algorithm>
namespace beast {
class buffer_view_test : public unit_test::suite
{
public:
// Returns `true` if the iterator distance matches the size
template <class FwdIt, class Size>
static bool eq_dist (FwdIt first, FwdIt last, Size size)
{
auto const dist (std::distance (first, last));
static_assert (std::is_signed <decltype (dist)>::value,
"dist must be signed");
if (dist < 0)
return false;
return static_cast <Size> (dist) == size;
}
// Check the contents of a buffer_view against the container
template <class C, class T>
void check (C const& c, buffer_view <T> v)
{
expect (! v.empty() || c.empty());
expect (v.size() == c.size());
expect (v.max_size() == v.size());
expect (v.capacity() == v.size());
expect (eq_dist (v.begin(), v.end(), v.size()));
expect (eq_dist (v.cbegin(), v.cend(), v.size()));
expect (eq_dist (v.rbegin(), v.rend(), v.size()));
expect (eq_dist (v.crbegin(), v.crend(), v.size()));
expect (std::equal (
c.cbegin(), c.cend(), v.cbegin(), v.cend()));
expect (std::equal (
c.crbegin(), c.crend(), v.crbegin(), v.crend()));
if (v.size() == c.size())
{
if (! v.empty())
{
expect (v.front() == c.front());
expect (v.back() == c.back());
}
for (std::size_t i (0); i < v.size(); ++i)
expect (v[i] == c[i]);
}
}
//--------------------------------------------------------------------------
// Call at() with an invalid index
template <class V>
void checkBadIndex (V& v,
std::enable_if_t <
std::is_const <typename V::value_type>::value>* = 0)
{
try
{
v.at(0);
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
}
// Call at() with an invalid index
template <class V>
void checkBadIndex (V& v,
std::enable_if_t <
! std::is_const <typename V::value_type>::value>* = 0)
{
try
{
v.at(0);
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
try
{
v.at(0) = 1;
fail();
}
catch (std::out_of_range e)
{
pass();
}
catch (...)
{
fail();
}
}
// Checks invariants for an empty buffer_view
template <class V>
void checkEmpty (V& v)
{
expect (v.empty());
expect (v.size() == 0);
expect (v.max_size() == v.size());
expect (v.capacity() == v.size());
expect (v.begin() == v.end());
expect (v.cbegin() == v.cend());
expect (v.begin() == v.cend());
expect (v.rbegin() == v.rend());
expect (v.crbegin() == v.rend());
checkBadIndex (v);
}
// Test empty containers
void testEmpty()
{
testcase ("empty");
buffer_view <char> v1;
checkEmpty (v1);
buffer_view <char> v2;
swap (v1, v2);
checkEmpty (v1);
checkEmpty (v2);
buffer_view <char const> v3 (v2);
checkEmpty (v3);
}
//--------------------------------------------------------------------------
// Construct const views from a container
template <class C>
void testConstructConst (C const& c)
{
typedef buffer_view <std::add_const_t <
typename C::value_type>> V;
{
// construct from container
V v (c);
check (c, v);
// construct from buffer_view
V v2 (v);
check (c, v2);
}
if (! c.empty())
{
{
// construct from const pointer range
V v (&c.front(), &c.back()+1);
check (c, v);
// construct from pointer and size
V v2 (&c.front(), c.size());
check (v, v2);
}
{
// construct from non const pointer range
C cp (c);
V v (&cp.front(), &cp.back()+1);
check (cp, v);
// construct from pointer and size
V v2 (&cp.front(), cp.size());
check (v, v2);
// construct from data and size
V v3 (v2.data(), v2.size());
check (c, v3);
}
}
}
// Construct view from a container
template <class C>
void testConstruct (C const& c)
{
static_assert (! std::is_const <typename C::value_type>::value,
"Container value_type cannot be const");
testConstructConst (c);
typedef buffer_view <typename C::value_type> V;
C cp (c);
V v (cp);
check (cp, v);
std::reverse (v.begin(), v.end());
check (cp, v);
expect (std::equal (v.rbegin(), v.rend(),
c.begin(), c.end()));
}
void testConstruct()
{
testcase ("std::vector <char>");
testConstruct (
std::vector <char> ({'h', 'e', 'l', 'l', 'o'}));
testcase ("std::string <char>");
testConstruct (
std::basic_string <char> ("hello"));
}
//--------------------------------------------------------------------------
void testCoerce()
{
testcase ("coerce");
std::string const s ("hello");
const_buffer_view <unsigned char> v (s);
pass();
}
//--------------------------------------------------------------------------
void testAssign()
{
testcase ("testAssign");
std::vector <int> v1({1, 2, 3});
buffer_view<int> r1(v1);
std::vector <int> v2({4, 5, 6, 7});
buffer_view<int> r2(v2);
r1 = r2;
expect (std::equal (r1.begin(), r1.end(), v2.begin(), v2.end()));
}
//--------------------------------------------------------------------------
static_assert (std::is_constructible <buffer_view <int>,
std::vector <int>&>::value, "");
static_assert (!std::is_constructible <buffer_view <int>,
std::vector <int> const&>::value, "");
static_assert (std::is_constructible <buffer_view <int const>,
std::vector <int>&>::value, "");
static_assert (std::is_constructible <buffer_view <int const>,
std::vector <int> const&>::value, "");
static_assert (std::is_nothrow_default_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_destructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_copy_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_copy_assignable <
buffer_view<int>>::value, "");
static_assert (std::is_nothrow_move_constructible <
buffer_view <int>>::value, "");
static_assert (std::is_nothrow_move_assignable <
buffer_view <int>>::value, "");
void run()
{
testEmpty();
testConstruct();
testCoerce();
testAssign();
}
};
BEAST_DEFINE_TESTSUITE(buffer_view,container,beast);
}

View File

@@ -0,0 +1,313 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
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.
*/
//==============================================================================
// MODULES: ../../crypto/impl/Sha256.cpp ../../container/impl/spookyv2.cpp
#if BEAST_INCLUDE_BEASTCONFIG
#include "../../../BeastConfig.h"
#endif
#include "../hardened_hash.h"
#include "../../unit_test/suite.h"
#include "../../crypto/Sha256.h"
#include <boost/functional/hash.hpp>
#include <array>
#include <cstdint>
#include <iomanip>
#include <functional>
#include <unordered_map>
#include <unordered_set>
namespace beast {
namespace detail {
template <class T>
class test_user_type_member
{
private:
T t;
public:
explicit test_user_type_member (T const& t_ = T())
: t (t_)
{
}
template <class Hasher>
friend void hash_append (Hasher& h, test_user_type_member const& a) noexcept
{
using beast::hash_append;
hash_append (h, a.t);
}
};
template <class T>
class test_user_type_free
{
private:
T t;
public:
explicit test_user_type_free (T const& t_ = T())
: t (t_)
{
}
template <class Hasher>
friend void hash_append (Hasher& h, test_user_type_free const& a) noexcept
{
using beast::hash_append;
hash_append (h, a.t);
}
};
} // detail
} // beast
//------------------------------------------------------------------------------
namespace beast {
namespace detail {
template <class T>
using test_hardened_unordered_set =
std::unordered_set <T, hardened_hash <T>>;
template <class T>
using test_hardened_unordered_map =
std::unordered_map <T, int, hardened_hash <T>>;
template <class T>
using test_hardened_unordered_multiset =
std::unordered_multiset <T, hardened_hash <T>>;
template <class T>
using test_hardened_unordered_multimap =
std::unordered_multimap <T, int, hardened_hash <T>>;
} // beast
template <std::size_t Bits, class UInt = std::uint64_t>
class unsigned_integer
{
private:
static_assert (std::is_integral<UInt>::value &&
std::is_unsigned <UInt>::value,
"UInt must be an unsigned integral type");
static_assert (Bits%(8*sizeof(UInt))==0,
"Bits must be a multiple of 8*sizeof(UInt)");
static_assert (Bits >= (8*sizeof(UInt)),
"Bits must be at least 8*sizeof(UInt)");
static std::size_t const size = Bits/(8*sizeof(UInt));
std::array <UInt, size> m_vec;
public:
typedef UInt value_type;
static std::size_t const bits = Bits;
static std::size_t const bytes = bits / 8;
template <class Int>
static
unsigned_integer
from_number (Int v)
{
unsigned_integer result;
for (std::size_t i (1); i < size; ++i)
result.m_vec [i] = 0;
result.m_vec[0] = v;
return result;
}
void*
data() noexcept
{
return &m_vec[0];
}
void const*
data() const noexcept
{
return &m_vec[0];
}
template <class Hasher>
friend void hash_append(Hasher& h, unsigned_integer const& a) noexcept
{
using beast::hash_append;
hash_append (h, a.m_vec);
}
friend
std::ostream&
operator<< (std::ostream& s, unsigned_integer const& v)
{
for (std::size_t i (0); i < size; ++i)
s <<
std::hex <<
std::setfill ('0') <<
std::setw (2*sizeof(UInt)) <<
v.m_vec[i]
;
return s;
}
};
typedef unsigned_integer <256, std::size_t> sha256_t;
static_assert (sha256_t::bits == 256,
"sha256_t must have 256 bits");
} // beast
//------------------------------------------------------------------------------
namespace beast {
class hardened_hash_test
: public unit_test::suite
{
public:
template <class T>
void
check ()
{
T t{};
hardened_hash <T>() (t);
pass();
}
template <template <class T> class U>
void
check_user_type()
{
check <U <bool>> ();
check <U <char>> ();
check <U <signed char>> ();
check <U <unsigned char>> ();
// These cause trouble for boost
//check <U <char16_t>> ();
//check <U <char32_t>> ();
check <U <wchar_t>> ();
check <U <short>> ();
check <U <unsigned short>> ();
check <U <int>> ();
check <U <unsigned int>> ();
check <U <long>> ();
check <U <long long>> ();
check <U <unsigned long>> ();
check <U <unsigned long long>> ();
check <U <float>> ();
check <U <double>> ();
check <U <long double>> ();
}
template <template <class T> class C >
void
check_container()
{
{
C <detail::test_user_type_member <std::string>> c;
}
pass();
{
C <detail::test_user_type_free <std::string>> c;
}
pass();
}
void
test_user_types()
{
testcase ("user types");
check_user_type <detail::test_user_type_member> ();
check_user_type <detail::test_user_type_free> ();
}
void
test_containers()
{
testcase ("containers");
check_container <detail::test_hardened_unordered_set>();
check_container <detail::test_hardened_unordered_map>();
check_container <detail::test_hardened_unordered_multiset>();
check_container <detail::test_hardened_unordered_multimap>();
}
void
run ()
{
test_user_types();
test_containers();
}
};
class hardened_hash_sha256_test
: public unit_test::suite
{
public:
void
testSHA256()
{
testcase ("sha256");
log <<
"sizeof(std::size_t) == " << sizeof(std::size_t);
hardened_hash <sha256_t> h;
for (int i = 0; i < 100; ++i)
{
sha256_t v (sha256_t::from_number (i));
Sha256::digest_type d;
Sha256::hash (v.data(), sha256_t::bytes, d);
sha256_t d_;
memcpy (d_.data(), d.data(), sha256_t::bytes);
std::size_t result (h (d_));
log <<
"i=" << std::setw(2) << i << " " <<
"sha256=0x" << d_ << " " <<
"hash=0x" <<
std::setfill ('0') <<
std::setw (2*sizeof(std::size_t)) << result
;
pass();
}
}
void
run ()
{
testSHA256();
}
};
BEAST_DEFINE_TESTSUITE(hardened_hash,utility,beast);
BEAST_DEFINE_TESTSUITE_MANUAL(hardened_hash_sha256,utility,beast);
} // beast

Some files were not shown because too many files have changed in this diff Show More