Compare commits

...

352 Commits

Author SHA1 Message Date
JoelKatz
d22b25c030 Set version to 0.21.0 2014-01-23 13:38:38 -08:00
JoelKatz
d475994e02 Pairwise no ripple:
* Cannot set noRipple flag with negative balance.
* Paths with consecutive no ripple links are invalid
* Adjust pathfinding value of no ripple out paths
* Check for no ripple when adding links in pathfinding
* Remove old noRipple logic
* Update trust line delete logic
2014-01-23 13:38:33 -08:00
JoelKatz
f0bb3dfdfb Never allow a retry as a final result 2014-01-23 13:38:28 -08:00
JoelKatz
e7f0b8eca6 Add DeliveredAmount to transaction metadata 2014-01-23 13:38:25 -08:00
JoelKatz
0bab6a9fec Add directory and order book iterators
This should fix the crossed order book bug.
* Change OfferCreate::takeOffers to use new iterators
* Change NetworkOps::getBookPage to use new iterators
* If we find an offer in the book but not the ledger, deindex it
2014-01-23 13:38:11 -08:00
David Schwartz
9486fc416c Support AccountTxnID and LastLedgerSequence. 2014-01-23 13:37:46 -08:00
JoelKatz
fb63aa737a Revert d2953f602e 2014-01-23 13:36:31 -08:00
JoelKatz
58a6ca1d3d Remove extraneous logging 2014-01-23 13:24:51 -08:00
JoelKatz
505f029edb Clean up 'destination_currencies' in new pathfinding reply 2014-01-23 13:24:43 -08:00
JoelKatz
815659b898 Replace a lock with an atomic in new pathfinding 2014-01-23 13:24:33 -08:00
JoelKatz
07d16f280c Clean up the checkAccept path to use the ledger sequence 2014-01-23 13:24:28 -08:00
JoelKatz
f88ddc947c Handle non-object in 'json' RPC method 2014-01-23 13:24:22 -08:00
Vinnie Falco
65ffdff40c Insight support for ResourceManager 2014-01-21 10:28:36 -05:00
Vinnie Falco
c95dccfec6 Move PathRequests to separate files 2014-01-21 10:28:36 -05:00
Vinnie Falco
fe83f471f5 Use duration in insight::Event, add chrono_util 2014-01-21 10:28:35 -05:00
sublimator
d2953f602e Error reporting tests 2014-01-21 10:28:35 -05:00
Vinnie Falco
9d07ddeae1 Improved human readable JSON-RPC error messages 2014-01-21 10:28:34 -05:00
Vinnie Falco
ef7810bc95 Add ScopedPointer::reset 2014-01-21 10:28:34 -05:00
David Schwartz
486539b3d3 Make offerDelete and fill Items more robust. 2014-01-21 10:28:34 -05:00
David Schwartz
990fb20a2a OrderBookDB::addOrderBook cleanup 2014-01-21 10:28:33 -05:00
Vinnie Falco
9b61a83721 Refactor, tidy up:
* Fix for msvc std::function return types
* Convert macros to constants
* Add Journal to PeerSet and use in InboundLedger
* Break lines and add annotations
* Remove some warnings
2014-01-21 10:28:33 -05:00
JoelKatz
f753519976 Ledger fetch improvements. Fetch policy improvements. 2014-01-17 16:06:15 -08:00
David Schwartz
663e38dcdd Locking and dispatching performance improvements:
* Avoid taking the master lock in most peer operations
* Dispatch recvGetLedger to JobQueue
* Dispatch consensus ledger fetches.
* Release master lock earlier in RPCHandler
2014-01-17 16:05:48 -08:00
Vinnie Falco
7570b6489d Fix and tidy up NodeStore
* Use std::unique_ptr
* Move globals to Manager singleton (fixes RocksDB exit crash)
2014-01-17 15:21:51 -05:00
Vinnie Falco
c341d1a71e Tidy up for C++11, and fixes:
* Remove shared_ptr legacy support
* Add make_unique support for pre-C++14 environments
* Fix comparison bug in sqdb
* Use std::shared_ptr in a few places
2014-01-17 12:19:04 -05:00
Vinnie Falco
fa10e90c9d Use abstract_clock 2014-01-17 12:19:04 -05:00
Vinnie Falco
68501763dd Refactor KeyCache 2014-01-17 12:19:04 -05:00
Vinnie Falco
cac1d555be Add std::make_unique 2014-01-17 12:19:03 -05:00
NATTSiM
25ff77c2fd Fix Clang compile and link errors 2014-01-16 17:18:05 -05:00
Vinnie Falco
2870c7f457 Workaround for MSVC std::function bug 2014-01-15 19:10:08 -08:00
JoelKatz
ab8d7a86ae Dispatch peerHas to JobQueue 2014-01-14 11:24:41 -08:00
JoelKatz
809359e81e Correctly handle empty account tree in ledger fetch 2014-01-14 11:24:32 -08:00
JoelKatz
6e4cd5bc9c Don't send nodes twice in getNodeFat 2014-01-14 11:24:01 -08:00
NATTSiM
de018bd582 Improved PropertyStream find and print routines 2014-01-13 21:51:31 -08:00
Vinnie Falco
544642a6ea Fix io_latency_probe hang on exit 2014-01-13 18:24:22 -08:00
JoelKatz
06737bb36f SHAMapSync bugfix. Cannot avoid push in getMissingNodes 2014-01-13 09:50:54 -08:00
JoelKatz
7efbfa2d20 Limit legacy pathfinding requests 2014-01-10 23:09:26 -08:00
Vinnie Falco
4d5df92cbc Add io_latency_probe 2014-01-10 22:54:00 -08:00
David Schwartz
1fcb2872b9 Reduce log priorities. 2014-01-10 22:54:00 -08:00
David Schwartz
00c87ca2dd Add LES::dirIsEmpty function to check if a directory is empty 2014-01-10 22:53:59 -08:00
JoelKatz
d474d68566 Order book subscribe cleanups. 2014-01-10 22:53:59 -08:00
David Schwartz
93e03804d0 SHAMapSync cleanups and performance improvements 2014-01-10 22:53:58 -08:00
JoelKatz
4591658160 PathRequests object to own all path requests. 2014-01-10 22:53:57 -08:00
JoelKatz
a2109b4bda Remove files inadvertently added 2014-01-10 22:53:57 -08:00
Vinnie Falco
deafea9c88 [REMOVE] Allow gcc 4.7 and later 2014-01-10 22:53:57 -08:00
Nicholas Dudfield
93f1a05f5c Update build for gcc 4.8.x:
* Use gcc 4.8.x, boost 1.54
* Honor CC,CXX,PATH environment variables
* Prevent compilation with unsupported toolchains
* Print g++ version during Travis build
* Run built-in unit tests after Travis build
2014-01-10 16:24:17 -08:00
Vinnie Falco
95a573b755 Set version to 0.20.1 2014-01-08 17:08:27 -08:00
Nik Bougalis
2a4623814c Don't log StatsD messages to the console by default 2014-01-08 16:57:47 -08:00
Vinnie Falco
1017adf743 Set version to 0.20.0 2014-01-08 16:15:12 -08:00
Vinnie Falco
34fb12344c Fix JobQueue 2014-01-08 14:55:10 -08:00
Vinnie Falco
ce3358bdf8 Improve diagnostics for ResourceManager 2014-01-08 11:18:46 -08:00
Vinnie Falco
1159dadfdb Fix missing jtACCEPT job limit 2014-01-08 11:18:45 -08:00
Vinnie Falco
62516ef07f Refactor TaggedCache 2014-01-07 21:14:14 -08:00
Vinnie Falco
eecd305efd Add std::hash <std::pair> specialization 2014-01-07 21:14:13 -08:00
Vinnie Falco
a83fa6b2b2 Fix warning in chrono_io 2014-01-07 21:14:07 -08:00
Vinnie Falco
b2feafa94c Use abstract_clock and improved tests, in ResourceManager
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 17:23:26 -08:00
Vinnie Falco
2d234e500d Add abstract_clock, manual_clock, chrono_io
Conflicts:
	src/beast/Builds/VisualStudio2012/beast.vcxproj.filters
2014-01-07 17:17:26 -08:00
Vinnie Falco
fee0e7b20e Fix bind in call to addJob 2014-01-07 17:08:01 -08:00
JoelKatz
a0f6429652 Add LedgerHolder class, use in LedgerMaster 2014-01-07 15:57:51 -08:00
JoelKatz
8f8b2ae4a3 Handle offers in quality directory but not in ledger 2014-01-07 15:57:50 -08:00
JoelKatz
9abdd16721 Release the master lock earlier in a few cases 2014-01-07 15:57:50 -08:00
JoelKatz
1e5963aeeb Move some operations from the I/O queue to the Job queue 2014-01-07 15:57:50 -08:00
JoelKatz
e25a83bb39 Some tiny bugfixes:
* Don't let ledger idle interval get too short
* Fix CBigNum::setuint256
* Fix SqliteStatement::isError
* Remove dead code, fix incorrect comments
* Check for NULL earlier in CKey constructors
* Prevent expire times from underflowing in TaggedCache
2014-01-07 15:57:49 -08:00
David Schwartz
e3a67b13ff Reset liquidity before retrying rippleCalc 2014-01-07 15:57:48 -08:00
JoelKatz
750cbb8399 Improvements because items in SHAMaps are immutable:
* SHAMapItem::getData is not needed
* SHAMapTreeNode::getItem is not needed
* SHAMapTreeNode::getData is not needed
* No need to copy them when constructing transactions
* No need to copy them when computing map deltas
* No need to copy them in deepCompare
* No need to copy them in SHAMapTreeNode's copy constructor
2014-01-07 15:57:48 -08:00
JoelKatz
045beb5f36 Concurrent SHAMap code
Use shared lock for SHAMap itself and concurrent map for nodes
2014-01-07 15:57:47 -08:00
JoelKatz
cd8234acba Pathfinding bugfix. Missing lock. 2014-01-07 15:57:46 -08:00
JoelKatz
de85a7c2bd Pathfinding improvements:
* Make each path request track whether it needs updating.
* Improve new request handling, reverse order for processing requests.
* Break to handle new requests immediately.
* Make mPathFindThread an integer rather than a bool. Allow two threads.
* For old pathfinding, if the ledger is unspecified, use the PathRequest's RippleLineCache.
* Log new pathfinding request latencies.
* Suspend processing requests if server is backed up.
2014-01-07 15:57:46 -08:00
Vinnie Falco
087301933a General refactoring, using C++11
* Remove broken RecycledObjectPool

* Fix beast::ServiceQueue using List instead of LockFreeStack

* Add class semaphore, fixes broken Semaphore

* Move crytpo module files to new beast directory

* Use c++11 replacements for boost and beast types:
  - std::atomic instead of beast::Atomic
  - std::function instead of boost::function, beast::function
  - std::unique_ptr instead of beast::ScopedPointer
  - std::shared_ptr instead of boost::shared_ptr

* Remove modules:
  - beast_db
  - beast_crypto
  - beast_extras

* Remove unnecessary classes:
  - AbstractFifo
  - AddConst
  - AtomicCounter
  - AtomicFlag
  - AtomicPointer
  - AtomicState
  - CopyConst
  - Expression
  - ForwardList
  - IfCond
  - Interval
  - IntrusiveArray
  - KeyvaDB
  - PointerToOther
  - PointerTraits
  - RemoveConst
  - RemoveConstVolatile
  - RemoveReference
  - RemoveVolatile
  - SharedObjectArray
  - SingleThreadedSharedObject
  - SophiaDB factory
  - SortedSet
  - WeakReference
  - beast::unique_ptr
2014-01-07 15:57:45 -08:00
JoelKatz
52333b8bd4 Fix a compiler warning in Ledger::visitStateItems 2014-01-07 15:48:50 -08:00
JoelKatz
3768b3c3ca Fix a pathfinding bug 2014-01-07 15:48:50 -08:00
JoelKatz
09b39e107d Fix subscribing to "real time" transactions. 2014-01-07 15:48:49 -08:00
Vinnie Falco
4b1155bf32 Improved diagnostic for RocksDB error codes
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 15:46:38 -08:00
Vinnie Falco
3c7fc31c95 Add ripple_common module
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2014-01-07 15:15:44 -08:00
Nicholas Dudfield
da3881a486 Make websocket-test the first test, and give custom timeouts of 1000ms 2014-01-05 13:40:47 +07:00
Nicholas Dudfield
ff12d9adaa Run server-test and websocket-test first. Show stderr upon abnormal rippled exit 2014-01-05 13:09:42 +07:00
Vinnie Falco
528cf56f80 Reduce StatsDCollector log verbosity 2014-01-02 19:32:27 -08:00
Vinnie Falco
0ebe3f1f35 Disable NameResolver temporarily 2014-01-02 16:12:55 -08:00
Vinnie Falco
328680b6cd Fix Resolver contract check 2014-01-02 16:10:49 -08:00
Vinnie Falco
f9dca105a6 Improved async stop for Resolver
Conflicts:
	src/ripple_app/peers/NameResolver.cpp
2014-01-02 15:38:03 -08:00
Vinnie Falco
3664db61e7 Fix static storage duration issue with some Journal logs 2014-01-02 15:21:33 -08:00
Vinnie Falco
49677aa799 Fix RippleBookType and unit tests 2013-12-29 11:33:50 -08:00
NATTSiM
27b771e2ba Fix clang compile 2013-12-27 17:46:51 -08:00
Vinnie Falco
6527cdfa97 Add RippleAsset types
Conflicts:
	Builds/VisualStudio2012/RippleD.vcxproj.filters
2013-12-27 17:21:11 -08:00
JoelKatz
b2dbe8ef83 Ledger acquire fixes/cleanups/logging
* Inbound ledger and SHAMapAddNode cleanup
    * Log acquire stats
    * Fix progress logic
    * Remove ledgers we no longer need to acquire
    * Stash stale state data in our fetch pack, it can still be useful
    * Stash in fetch pack if acquire terminated while job was pending
    * Account for duplicate/invalid nodes in a few cases previously missed
    * Dispatch each InboundLedger once (not per data)
    * Trigger only the "best" peer
    * Don't call tryAdvance on failed acquires
2013-12-27 16:48:03 -08:00
NATTSiM
9bdb0774ad Make InboundLedgers, LedgerConsensus abstract 2013-12-27 16:48:03 -08:00
Vinnie Falco
8c2ec2cfbe Add AbstractObject, cyclic_iterator, Journal improvements 2013-12-27 16:47:43 -08:00
Wolfgang Spraul
00f959ab7e removed boost_random 2013-12-26 14:31:22 -08:00
Vinnie Falco
f9c4070ad3 Add FetchPack unit test 2013-12-22 12:57:44 -08:00
Vinnie Falco
074325a7ea Inject SHAMap missing node handler dependency 2013-12-22 12:38:07 -08:00
JoelKatz
2f521a6a91 Build fetch packs correctly. 2013-12-22 12:38:07 -08:00
sublimator
07959b3cc9 Allow to full network limit in Amount::isLegalNet 2013-12-20 15:44:03 -08:00
The Doctor
21faf8eaeb Improvements to initscript and default configuration.
* Added absolute paths to the [node_db] and [debug_logfile] stanzas in the config file.

* Changed some tabs into spaces for consistency.

* Added directory tree sanity checking to initscript.

Signed-off-by: The Doctor <drwho@virtadpt.net>
2013-12-20 15:38:30 -08:00
Nik Bougalis
3e2b5dcc3d Hostname resolution support for Peers 2013-12-19 14:50:03 -08:00
Nik Bougalis
88a8433d31 Add reference counting to AsyncObject 2013-12-19 14:39:26 -08:00
Vinnie Falco
81d418007a Add CollectorManager for Beast.Insight support 2013-12-16 18:08:11 -08:00
Vinnie Falco
f88fcf55a3 Add Beast.Insight stats collection module 2013-12-16 12:22:25 -08:00
Vinnie Falco
561c8dea08 Add stl module for c++11 compatibility classes 2013-12-16 11:35:21 -08:00
David Schwartz
de92ac9e0b Websocket improvements:
* Log on_close/on_fail/on_open calls.
* Ping out connections.
* Improve ping logic.
* On websocket ping out, close abnormally.
* Avoid deadlock when shutting down websocket endpoint
2013-12-16 09:40:15 -08:00
JoelKatz
deead04a6a getFetchPack fixes, spread fetch pack requests. 2013-12-15 07:20:24 -08:00
JoelKatz
d4771a9b36 Fix missing call to setPubLedger on gap in published ledger stream. 2013-12-13 11:14:34 -08:00
JoelKatz
27b8415d0c During old pathfinding, unlock earlier. 2013-12-12 21:17:25 -08:00
David Schwartz
e1e81e5d97 Call pendSaveValidated without holding the ledger master lock 2013-12-12 21:17:20 -08:00
Vinnie Falco
3705680d68 Disable RocksDB for older compilers 2013-12-10 11:23:06 -08:00
Vinnie Falco
a01f546ae3 Use ScopedPointer instead of deprecated auto_ptr 2013-12-10 14:14:15 -05:00
Bryce Lynch
eabc905bac Add Debian-style initscript
* Add validators and validation_quorum from the v0.16 release notes.
* We keep having to tell people to do this during integration, let's just make it the default.
* Add comment about the log file location that states that it has to be absolute rather than relative after an integration troubleshoot earlier today.

Signed-off-by: Bryce Lynch <bryce@ripple.com>
2013-12-09 16:21:22 -08:00
JoelKatz
37588b6808 Avoid an extraneous test. 2013-12-09 00:52:40 -08:00
JoelKatz
071db75f04 Add a 1 MB payload limit to incoming websocket requests 2013-12-09 00:52:40 -08:00
David Schwartz
1e00940a90 Move some ledger cleaner helper functions into the ledger master. 2013-12-08 23:53:57 -08:00
JoelKatz
b984566480 Suppress a warning. 2013-12-08 23:53:47 -08:00
JoelKatz
51aef120a1 Pathfinding performance improvements:
* Use a single RippleLineCache, even for 'fast' requests
* Use a ledger copy to avoid stalling other code
2013-12-08 23:52:54 -08:00
JoelKatz
636d722e8d Memory-conserving changes to SHAMapTreeNode and visitLeavesInternal. 2013-12-08 23:52:54 -08:00
Vinnie Falco
e6da61120a Make AbstractObject unit test manual 2013-12-06 09:57:03 -08:00
JoelKatz
b901e0dcf3 Fix load stats in get_info 2013-12-05 22:04:42 -08:00
Vinnie Falco
177b3c93c4 Move DecayingSample to algorithm 2013-12-05 18:35:37 -08:00
JoelKatz
9996e4a57e The new recommended fee schedule is:
* Transaction fee: 10 drops
* Base reserve: 20 XRP
* Incremental reserve: 5 XRP
2013-12-04 19:07:58 -08:00
JoelKatz
4751b6a65c Fix for issue 211, fixes to NetworkOPs getTxsAccountB 2013-12-04 17:09:22 -08:00
David Schwartz
b3c79f5c2f Change visitLeaves to visit a snapshot so the ledger stays unlocked 2013-12-04 11:10:27 -08:00
David Schwartz
0e53105ab5 Remove dead code and fix a race condition in the node back end.
Race was between a store and a fetch, as follows:
1) Fetch: Search for the node, it is not found.
2) Store: Add the node to the database, remove the node from the negative cache.
3) Fetch: Add the node to the negative cache.
This would leave a node in the DB, cache, and negative cache.
2013-12-04 11:10:22 -08:00
Vinnie Falco
0f2a657196 Add double conversion for PropertyStream map items 2013-11-30 17:56:25 -08:00
Vinnie Falco
89aa2c7a6a Refactor some Journal::Sink members 2013-11-30 17:32:50 -08:00
Vinnie Falco
4c843b6c66 IPAddress fixes and algorithm comparison functors 2013-11-30 09:21:46 -08:00
Vinnie Falco
130c7c5c58 Refactor and fix some object arithmetic comparisons 2013-11-30 06:28:29 -08:00
Vinnie Falco
76c364ec2d Add const now() 2013-11-30 01:42:38 -08:00
Vinnie Falco
a549c94a15 Fix missing assert in UnitTest runner 2013-11-30 01:42:37 -08:00
Vinnie Falco
6de8a6907f Add AbstractObject 2013-11-30 01:42:37 -08:00
Vinnie Falco
fc31562052 Tidy doc comments 2013-11-29 23:44:36 -08:00
Vinnie Falco
cdaa65c07a Remove LightningDB database and backend 2013-11-27 15:14:21 -08:00
Vinnie Falco
8a278cf9d6 Remove sophia database and backend 2013-11-27 15:09:26 -08:00
Vinnie Falco
97cecc18ce Set version to 0.19.2 2013-11-27 13:10:19 -08:00
JoelKatz
536db23e14 Fix foundResume check in account_tx 2013-11-27 12:25:45 -08:00
Vinnie Falco
39d801fb9f Merge branch 'release' into develop 2013-11-27 10:00:34 -08:00
Vinnie Falco
6d707b21b2 Set version to 0.19.1 2013-11-27 09:54:41 -08:00
JoelKatz
2316fe5bbe A better way to return an empty set if the token isn't an object. 2013-11-27 09:11:42 -08:00
JoelKatz
16ec9d2bdb Return an empty set if token is not an object 2013-11-27 08:54:49 -08:00
JoelKatz
2ce4ce4309 Begin deprecating the old account_tx interface. 2013-11-26 22:01:10 -08:00
JoelKatz
858c3a5362 Force NDEBUG in sqlite, RocksDB, and HyperLevelDB by default 2013-11-26 21:59:35 -08:00
JoelKatz
c124ad0dcd Add BEAST_SQLITE_FORCE_NDEBUG option 2013-11-26 21:56:17 -08:00
JoelKatz
ed64c8bb29 Add LedgerCleaner:
* Manually invoked to clean ledgers
* Get status with: 'print app.ledgercleaner.*'
* Invoke or control with 'ledger_cleaner' command
2013-11-26 21:50:35 -08:00
Vinnie Falco
2678360715 Set version to 0.19.0 2013-11-22 23:39:12 -08:00
JoelKatz
54e504dd5a Make --import work 2013-11-22 23:39:07 -08:00
JoelKatz
b632a6b2cf If the RocksDB base file size is changed, change the write cache and L0 size to match 2013-11-22 23:39:02 -08:00
Vinnie Falco
b9e2ac38fa Set version to 0.19.0 2013-11-22 23:36:50 -08:00
JoelKatz
4d1c2a5798 Make --import work 2013-11-22 18:01:13 -08:00
JoelKatz
c69d8a13b3 If the RocksDB base file size is changed, change the write cache and L0 size to match 2013-11-22 16:13:12 -08:00
Vinnie Falco
7c358cda17 Set version to 0.18.0 2013-11-22 15:57:59 -08:00
Vinnie Falco
1954a0eb2e Set version to 0.18.0 2013-11-22 15:57:41 -08:00
Vinnie Falco
5500701661 Fix Workers thread name 2013-11-22 15:51:20 -08:00
Vinnie Falco
21918922f4 Set background thread name 2013-11-22 15:51:20 -08:00
Vinnie Falco
fad52c5917 Comment out write to stdout 2013-11-22 15:51:20 -08:00
Vinnie Falco
306811d2a7 Add RocksDB NodeStore backend 2013-11-22 15:51:19 -08:00
Vinnie Falco
8b72f2ad79 Add rocksdb module 2013-11-21 18:31:15 -08:00
Vinnie Falco
1a1cb696f7 Make include paths relative 2013-11-21 16:59:54 -08:00
Vinnie Falco
582c17b06b Merge commit 'b156a49cff152fd52992a4823aaeafbaf70e564e' as 'src/ripple/rocksdb/rocksdb' 2013-11-21 16:24:10 -08:00
Vinnie Falco
b156a49cff Squashed 'src/ripple/rocksdb/rocksdb/' content from commit 56589ab
git-subtree-dir: src/ripple/rocksdb/rocksdb
git-subtree-split: 56589ab81f
2013-11-21 16:24:10 -08:00
Vinnie Falco
3943cfea06 Fix LevelDB Windows port 2013-11-21 15:00:57 -08:00
David Grogan
97346c6618 Upgrade LevelDB from 1.12 to 1.14:
* Fix issues 77, 87, 182, 190, 200, and 201

* Fix bug described in https://groups.google.com/d/msg/leveldb/yL6h1mAOc20/vLU64RylIdMJ

* Fix a bug where options.max_open_files was not getting clamped properly.

* Fix link to bigtable paper in docs.

* New sstables will have the file extension .ldb. .sst files will continue to be recognized.
2013-11-21 12:59:46 -08:00
JoelKatz
474b824902 Don't throw away an initial error when detecting the handshake. 2013-11-20 17:01:21 -08:00
David Schwartz
02b5572ccc Changes to support the ledger cleaner
* Rework ledger save return values to indicate errors to callers
* Add an extra function to support the ledger cleaner.
2013-11-20 12:22:45 -08:00
Vinnie Falco
4577ad60c7 Fix ResourceManager log output 2013-11-20 11:31:19 -08:00
JoelKatz
e683c380e5 Fix a defect in RangeSet. 2013-11-20 11:31:14 -08:00
Vinnie Falco
b660d82516 Make TxFormats a Meyers singleton 2013-11-20 10:16:46 -08:00
Nicholas Dudfield
c0dda06499 Parse STArray correctly in STObject::parseJson 2013-11-20 08:54:59 -08:00
Vinnie Falco
65abd6307d Update hyperleveldb module 2013-11-19 11:33:09 -08:00
Vinnie Falco
6e713dc3b8 Merge commit '596a35accad6e838e05180e79c1ea626eaf93a34' into develop 2013-11-19 11:32:55 -08:00
Vinnie Falco
596a35acca Squashed 'src/hyperleveldb/' changes from ac2ae30..25511b7
25511b7 Merge branch 'master' of github.com:rescrv/HyperLevelDB into hyperdb
ed01020 Make "source" universal
3784d92 Ignore the static file
507319b Don't package with snappy
3e2cc8b Tolerate -fno-rtti
4dcdd6e Drop revision down to 1.0.dev
2542163 Drop all but the latest kept for garbage reasons
9c270b7 Update .gitignore
5331878 Add upack script
adc2a7a Explicitly add -lpthread for Ubuntu
7b57bbd Strip NULL chars passed to LiveBackup
e3b87e7 Add write-buffer-size option to benchmark
2f11087 Followup to snappy support with -DSNAPPY
af503da Improve efficiency of ReplayIterator; fix a bug
33c1f0c Add snappy support
ce1cacf Fix a race in ReplayIterator
5c4679b Fix a bug in the replay_iterator
ca332bd Fix sort algorithm used for compaction boundaries.
d9ec544 make checK
b83a9cd Fix a deadlock in the ReplayIterator dtor
273547b Fix a double-delete in ReplayIterator
3377c7a Add "all" to set of special timestamps
387f43a Timestamp comparison and validation.
f9a6eb1 make distcheck
9a4d0b7 Add a ReplayIterator.
1d53869 Conditionally enable read-driven compaction.
f6fa561 16% end-to-end performance improvement from the skiplist
28ffd32 Merge remote-tracking branch 'upstream/master'
a58de73 Revert "Remove read-driven compactions."
e19fc0c Fix upstream issue 200
748539c LevelDB 1.13
78b7812 Add install instructions to README
e47a48e Make benchmark dir variable
820a096 Update distributed files.
486ca7f Live backup of LevelDB instances
6579884 Put a reference counter on log_/logfile_
3075253 Update internal benchmark.
2a6b0bd Make the Version a parameter of PickCompaction
5bd76dc Release leveldb 1.12

git-subtree-dir: src/hyperleveldb
git-subtree-split: 25511b7a9101b0bafb57349d2194ba80ccbf7bc3
2013-11-19 11:32:55 -08:00
Vinnie Falco
4ad84a339f Make LedgerMaster abstract 2013-11-18 15:04:17 -08:00
JoelKatz
833435f8c2 The 'ledger' RPC command should be considered high burden if 'full' is set. 2013-11-17 20:11:40 -08:00
JoelKatz
4e4942e357 Fix break logic in STObject::parseJson for arrays. 2013-11-16 18:57:08 -08:00
JoelKatz
1fc8f0a33b Missing break in STObject::parseJson for arrays. 2013-11-16 18:56:01 -08:00
Vinnie Falco
1f433dea97 Add ripple_app TODO 2013-11-15 18:39:07 -08:00
Vinnie Falco
d8707cad2c Refactor logging 2013-11-15 13:25:56 -08:00
Vinnie Falco
a399b571ac Journal API improvements 2013-11-15 12:30:01 -08:00
Vinnie Falco
d0e71225c4 Fix severity check on ~ScopedStream 2013-11-15 11:29:45 -08:00
Vinnie Falco
19d4bf0ea5 Add README and tidy up comments 2013-11-15 11:29:45 -08:00
Vinnie Falco
9e519af887 Add missing README and TODO for all new modules 2013-11-15 11:27:26 -08:00
JoelKatz
29aa462bfd Add more comments to the consensus code. 2013-11-14 22:41:34 -08:00
JoelKatz
7a91872ee5 Fix broken indentation around BOOST_FOREACH 2013-11-14 22:35:09 -08:00
JoelKatz
68307d1012 Functions like remote_endpoint().address() can throw 2013-11-14 11:20:35 -08:00
JoelKatz
48cb707bb6 Handle a missing ledger node discovered during pathfinding. 2013-11-14 11:20:16 -08:00
JoelKatz
9322233b37 Allow the SHAMap visitLeaves functions to sanely handle a missing map node. 2013-11-13 11:04:17 -08:00
JoelKatz
1daf1b9932 Use MultiSocket for websocket 2013-11-12 21:09:01 -08:00
JoelKatz
a3024352ba Pathfinding improvements. 2013-11-12 21:08:52 -08:00
David Schwartz
58f07a573f New ResourceManager for managing server load.
* Track abusive endpoints
* Gossip across cluster.
* Use resource manager's gossip support to share load reporting across a cluster
* Swtich from legacy fees to new Resource::Charge fees.
* Connect RPC to the new resource manager.
* Set load levels where needed in RPC/websocket commands.
* Disconnect abusive peer endpoints.
* Don't start conversations with abusive peer endpoints.
* Move Resource::Consumer to InfoSub and remove LoadSource
* Remove port from inbound Consumer keys
* Add details in getJson
* Fix doAccountCurrencies for the new resource manager.
2013-11-12 21:08:52 -08:00
Vinnie Falco
a05f33f6a7 Add annotation and clean up whitespace 2013-11-12 19:30:07 -08:00
Vinnie Falco
968624971f Add TestOverlay README 2013-11-12 09:18:11 -08:00
JoelKatz
57e77a5bd2 Use Ledger::visitStateItems to implement OrderBookDB::update 2013-11-11 21:31:18 -08:00
JoelKatz
74c65cfdc5 Cleanup path request logging. 2013-11-11 19:29:56 -08:00
JoelKatz
399760fda9 Assign each path finding request an ID and track its lifecycle. 2013-11-11 18:32:45 -08:00
Vinnie Falco
67b8f95b1e Add PeerFinder README doc 2013-11-10 15:51:29 -08:00
Vinnie Falco
d4d6acdf68 Add MSVC Output window Journal config setting
Conflicts:
	src/ripple/peerfinder/impl/Manager.cpp
	src/ripple/validators/impl/Manager.cpp
2013-11-10 15:06:05 -08:00
Vinnie Falco
472baa8bac Update README 2013-11-10 10:42:07 -08:00
Vinnie Falco
dd74c19858 Tidy up LoadMonitor stats API 2013-11-09 12:08:23 -08:00
Vinnie Falco
b5f8d447a0 Tidy up Resource::Manager APIs 2013-11-09 12:00:37 -08:00
JoelKatz
5f4a1917a6 Change how cluster load is computed from average-ish to median-ish. 2013-11-08 11:05:43 -08:00
JoelKatz
cf71680aee Don't return too many paths. 2013-11-08 11:05:05 -08:00
JoelKatz
f04b9131cc terNO_LINE should never be the final result of a payment transaction that can claim a fee. 2013-11-08 10:32:15 -08:00
JoelKatz
46861fac48 Don't allow a payment to take anything from an expired offer. 2013-11-08 10:17:12 -08:00
JoelKatz
4620b667e7 Fix a race condition if PathRequest::doCreate races with the path being processed. 2013-11-07 22:30:11 -08:00
Vinnie Falco
49f43ccc0a Set version to 0.17.0-rc5 2013-11-07 10:30:50 -08:00
Vinnie Falco
63aa7284c4 Disable peerfinder hooks 2013-11-07 09:59:28 -08:00
Patrick Dehne
286ade2d17 Beast improvements and vflib compatibility module work
* Add CallQueue vflib compatibility class
* Use run instead of run_one
* Merge BindableServiceQueue into CallQueue
* Take BEAST_VARIADIC_MAX into account
* Fix license headers as suggested by Vinnie
* Remove obsolete comment
* Add ManualServiceQueue
* Add ManualServiceQueue to beast_vflib include
* Move static unit test variables of header only classes to module cpp
* Remove no longer used mutex member
* _VARIADIC_MAX maxes out at 10
* Correctly apply BEAST_VARIADIC_MAX
* Merge BindableServiceQueue into CallQueue
* New GuiServiceQueue and its JUCE dependency
* Fix leftover merge errors
* Fix CallQueue unit test
* Don't use bassert for better CI support
2013-11-07 09:42:37 -08:00
Vinnie Falco
066d92ecfa Improve MultiSocket::ssl_handle 2013-11-07 09:35:04 -08:00
Vinnie Falco
c5ccabec38 Fix to use IPS from config 2013-11-06 06:19:06 -08:00
Vinnie Falco
548fedb859 Fix missing cstdlib 2013-11-06 06:19:02 -08:00
Nicholas Dudfield
8d5378a2ca Ensure no offers cancel each other out 2013-11-05 23:20:45 -08:00
David Schwartz
bf1843be9e Add "account_currencies" command. 2013-11-05 16:07:17 -08:00
David Schwartz
d50439cc4d doAccountLines cleanup. 2013-11-05 15:41:15 -08:00
Vinnie Falco
6a8f313394 Set version to 0.17.0-rc4 2013-11-05 14:41:49 -08:00
David Schwartz
c211094d3e Allow two trust lines to be created without reserve check. 2013-11-05 13:29:07 -08:00
Vinnie Falco
072b4f3b73 Set version to 0.17.0-rc3 2013-11-05 11:22:20 -08:00
Vinnie Falco
08cbcba4ee Fix warning 2013-11-05 03:23:15 -08:00
Vinnie Falco
2a9171c623 Improve hasher for IPAddress 2013-11-05 03:15:09 -08:00
Vinnie Falco
8573679fbb Fix compile error 2013-11-05 03:09:39 -08:00
Vinnie Falco
811f244fc2 Set boolalpha for Journal::ScopedStream 2013-11-05 03:09:39 -08:00
Vinnie Falco
a31b2556a3 Add ostream support for PropertyStream items 2013-11-05 03:09:39 -08:00
Vinnie Falco
a0ad5cdbfe Add to_string for asio endpoints 2013-11-05 03:09:39 -08:00
Nicholas Dudfield
59cf668348 Fix IPAddress::V4::Proxy 2013-11-05 03:02:20 -08:00
Stefan Thomas
09acc26c50 Fix marker being set for last result. 2013-11-03 22:39:55 -08:00
JoelKatz
0ae7bcff52 Fix the path filtering loop exit condition. 2013-11-03 17:20:10 -08:00
JoelKatz
2210dbac94 Don't abort the path filtering loop too early. 2013-11-03 16:37:35 -08:00
JoelKatz
6b2f654a30 Improve path filtering:
1) Ignore paths with very low liquidity
2) Allow an extra filling path to be added if needed
2013-11-03 02:20:18 -08:00
Vinnie Falco
3296ac5628 Turn off test URL in SiteFiles 2013-11-01 16:10:25 -07:00
Vinnie Falco
6d06cb29df Block until thread exits in manager dtors 2013-11-01 15:48:37 -07:00
Vinnie Falco
b08c7d15cd Stoppable, make stop() require call to start() 2013-11-01 13:31:38 -07:00
Vinnie Falco
940d620a96 Fix SiteFiles thread name 2013-11-01 10:34:35 -07:00
Vinnie Falco
a39fa8ae5f New SiteFiles for fetching and managing ripple.txt files 2013-10-31 08:10:06 -07:00
Vinnie Falco
f859bf160a Improve URL string conversions and ostream support 2013-10-31 08:10:06 -07:00
Vinnie Falco
e0512930ae Fix error parameter in HTTPClient logic 2013-10-31 08:10:06 -07:00
Vinnie Falco
7bbf6c553f Move ServiceQueueBase out of detail namespace 2013-10-31 08:10:05 -07:00
Vinnie Falco
aeb335ebdc Add hash function to URL 2013-10-31 08:10:05 -07:00
Vinnie Falco
73ab408b3c Move MurmurHash to beast 2013-10-31 08:10:04 -07:00
Vinnie Falco
f333a33f3d Make ServiceQueue::enqueue virtual 2013-10-31 08:10:04 -07:00
Nik Bougalis
42b841735e PeerFinder work 2013-10-29 20:52:57 -07:00
Vinnie Falco
e710bd2183 Use IPAddressConversion 2013-10-29 20:52:57 -07:00
Vinnie Falco
84556ba76a Add Bootstrap Strategy exposition 2013-10-29 20:52:56 -07:00
David Schwartz
4eebea91d3 DecayingSample::decay must always return with the time current. 2013-10-29 14:46:22 -07:00
JoelKatz
4ddadb8792 Correctly compute amount left on sell offer when a crossing offer pays us more than we asked for. 2013-10-28 16:48:47 -07:00
JoelKatz
8e65d6288d Fix limit calculation. 2013-10-28 07:24:01 -07:00
Justin Lynn
8e18deb74f disable e-mail notifications for travisCI 2013-10-25 17:48:20 -07:00
Justin Lynn
7ae1ad524b Merge branch 'develop' of github.com:ripple/rippled into develop 2013-10-24 19:11:17 -07:00
Justin Lynn
1ba1b3983a travis installs exuberant-ctags 2013-10-24 19:11:08 -07:00
Nicholas Dudfield
aabd6980ac Fix a bug in websocket-test.js referencing done() not declared in test() function signature, was causing failure of subsequent test suite, due to mocha's enveloped exception handling style 2013-10-24 19:03:03 -07:00
Nicholas Dudfield
3b19310252 Declarative path tests 2013-10-24 19:03:03 -07:00
Justin Lynn
8201805b28 explicitly use libboost 1.48 2013-10-24 18:53:38 -07:00
Justin Lynn
7277c8478b install dependencies when running travis ci 2013-10-24 18:47:18 -07:00
Justin Lynn
963a0dd934 initial travis yml file 2013-10-24 18:40:07 -07:00
JoelKatz
3108d58791 Fix typo. 2013-10-24 16:57:27 -07:00
Patrick Dehne
31b1a6a7e6 Add beast_vflib compatibility module and stand alone unit test app 2013-10-23 17:37:00 -07:00
JoelKatz
9ff65d0da4 Fix setting the no ripple flag when a trust line is created. 2013-10-23 17:24:34 -07:00
JoelKatz
c11abb42d1 Fix a case where 'sign' won't work in standalone mode. 2013-10-23 17:24:16 -07:00
Vinnie Falco
7b6d81d812 Measure CPU usage in Workers 2013-10-22 17:23:54 -07:00
Vinnie Falco
ca0daad11f Update notes 2013-10-22 12:59:56 -07:00
Vinnie Falco
a0c4e685c5 Add local_endpoint and remote_endpoint to MultiSocket 2013-10-22 12:33:11 -07:00
Nik Bougalis
b30f7a622c Set PEERS_MAX default value 2013-10-22 11:48:43 -07:00
Vinnie Falco
23f44f12bd Add IPAddressConversion and asio module 2013-10-22 11:45:30 -07:00
Nik Bougalis
6c17002e8a Peerfinder work 2013-10-22 10:43:17 -07:00
Vinnie Falco
5dda088335 Peerfinder work 2013-10-22 10:43:16 -07:00
Vinnie Falco
2427cce2c8 Rename to IPAddress and remove unused files 2013-10-22 10:43:16 -07:00
Nik Bougalis
1c41dae51c PeerFinder work 2013-10-22 10:43:15 -07:00
Vinnie Falco
1a6d72b14c Squelch spurious linker warning 2013-10-22 10:43:15 -07:00
Vinnie Falco
3dc646e03e Use serialized Context wrapper in Validators 2013-10-22 10:43:14 -07:00
Vinnie Falco
96328a8632 Add FixedPeers connection policy to peerfinder 2013-10-22 10:43:14 -07:00
Vinnie Falco
2cc4488d8e Fix crash in PropertyStream::find 2013-10-22 10:13:46 -07:00
wltsmrz
a6c2fe4761 Remove coffeescript compiler from mocha.opts until it is needed and added to dependencies 2013-10-21 17:54:36 -07:00
JoelKatz
ed905d3c3d Remove redundant code. 2013-10-21 15:06:05 -07:00
Vinnie Falco
81eadbd05c RelativeTime tidying 2013-10-20 15:31:50 -07:00
Patrick Dehne
ef1e2f8595 monotonicCurrentTimeInSeconds should return seconds, not milliseconds 2013-10-21 00:11:44 +02:00
Patrick Dehne
fae7082049 Wrap hiResCounterHandler in a function to prevent an order of initialization problems 2013-10-20 23:38:52 +02:00
Patrick Dehne
a63de23156 Rename millisecondsSinceStartup to monotonicCurrentTimeInSeconds 2013-10-20 23:37:24 +02:00
Patrick Dehne
8e0dda8480 #ifdef unneeded sys/prctl.h include in the mac build 2013-10-20 01:43:24 +02:00
Patrick Dehne
ad7b9ff8b5 Make fromStartup compile on mac 2013-10-20 01:38:59 +02:00
Vinnie Falco
04f2d0787a Merge commit '2ad98a025eb263d97b1942fc468937b4719becd8' into develop
Conflicts:
	src/beast/beast/utility/PropertyStream.h
	src/beast/beast/utility/impl/PropertyStream.cpp
	src/beast/modules/beast_sqlite/beast_sqlite.h
2013-10-19 15:57:15 -07:00
Vinnie Falco
2ad98a025e Squashed 'src/beast/' changes from 43e6d34..0e7bac9
0e7bac9 Fix include path
e5bb90f Fix constness of Proxy
ac0142a Use template cast
ef6e381 Add missing Url.h include
206e65c Fix constness of operator[]
695cc38 Use template instantiation for friend declaration
7b1e03a Add BaseFromMember
49bc04f Make List<>::Node not uncopyable
d5954ff Add Journal to UnitTest
58da106 Temporarily disable ServiceQueue dtor precondition asserts
fe58c1a Add missing #include
2c02580 Add PropertyStream for server state introspection
24c2315 Add ScopedWrapperContext
a3845f5 Add RelativeTime::value_type typedef
7442932 Fix missing PropertyStream members
ed5a98f More PropertyStream output for PeerFinder
fcfa10d Add PropertyStream
3cf0729 Tidy up AbstractHandler usage in HTTPClient
55171f4 Remove obsolete source files
1311ca3 Increase arity of SharedFunction
67d807d Add IPEndpoint::key_equal
ebf395e Add ErrorCode and boost library
2c3ead3 Add ServiceQueue::wrap
6c7f5d0 Move many Thread related classes
93e9d86 Measure CPU utilization in ServiceQueue
ca47d72 Move ServiceQueue, ThreadLocalValue, SpinLock
c864e4d Move WaitableEvent
ff305e6 Add CPUMeter and ScopedTimeInterval
01fd05c Add RecursiveMutex, UnlockGuard, TryLockGuard
5831a53 Remove Journal from most Stoppable overrides
b60a7f3 Add Request and Response HTTP parsers
44445ff Refactor net buffers classes
ac37c38 Beast class refactor
8b7056b Fix eof on HTTP client get
228b664 Remove obsolete beast container classes
1dfd655 Use RelativeTime from startup in DeadlineTimer
ae22d5d Add more methods to RelativeTime
c67929e Remove unhandled exception catcher
2472a90 Add 64 bit output for MurmurHash
f3d97c7 Add RelativeTime::fromStartup
b0b8660 IPEndpoint better parsing
ae551cd Add alternate form string parsing to IPEndpoint
d0a0dbf Don't break on Throw
0e46762 Add hasher functors for IPEndpoint
a1ec423 Add Thread::stopThreadAsync
4f7dca3 Add compiler, stdlib, and platform skeleton to beast/config
4394594 Tidy up some use of Error for throw
e5e0f52 Journal console output improvements
f07515e Add Stoppable prepare and start interfaces
d37dd46 Move RelativeTime to chrono, add ostream support
3f6e7aa Add console feature to Journal
ad0064a Journal option to write to Output window (MSVC)
0b7574b Add compilation test script
cc05ce1 Add ServiceQueue
e132aab Use boost for functional when the config is set
026b926 Fix is_continuation for boost version
c807a4e Fix invoked_type type reference
2ff781b Remove LockFreeStack::size
3acb474 Add SharedData::ConstAccess
7e4c834 Add LockFreeStack::empty
9c61a6d Added AbstractHandler, WrapHandler. HTTPClient Fixes.
94e40dc Fix unittest, by removing recursive call.
38bf408 Fix nonstandard C++ extension in getNullSink
1ef044d Build fixes
d5d3746 Fix missing <cmath> include for Gentoo
5f231d3 Update copyright notice and licenses
7b89bf6 Add FixedArray, IntrusiveArray, Crypto
5c5de57 Reorganize beast modules and files
9e18bb3 Merge commit '43deaaa5cf0d0178a4a6c3cb69c02a2a9a43ec7d' as 'src/beast/beast/http/impl/http-parser'
57703ac Fix BeforeBoost.h include
fbc247b Add Stoppable to beast
56496d8 IPEndpoint comparisons
9d9c822 Migrate some headers and general tidying
1a3cddc Add SharedArg and AsyncObject
373ca9c Add HTTPRequest and improvements to HTTPMessage parsing
9534516 Add some thread classes and fix SharedData with a simple mutex adapter
755ab36 Make CallQueue unit test runManual
c0ca037 Remove Beast version printing on startup
7efb6a3 Reorganize some MPL and Utility classes and files
69c26a1 Fix missing BeastConfig.h include in Net.cpp
40aa552 Disable Beast version printing in Ripple BeastConfig.h
7b1352d Add InterruptibleThread unit test
68cf759 ThreadWithCallQueue unit test adjustment
6501dea IPEndpoint parsing and tidying
72fc42b Move and add some template metaprogramming classes
2a164f0 Change filname capitalization (end)
6a14f25 Change filename capitalization
92fd417 Move integer types to beast/CStdInt.h
ebbd9ff Move TargetPlatform.h to beast/Config.h
874b524 Add IPEndpoint
14b34fc Tidy up some zlib macro undefines
34fffca Rename beast sources for consistency
4e59ab2 Add CallQueue unit test
327d7a6 Fixes for consolidated beast unity includes
d5ece4e Remove unused and broken classes
39f13be Remove unused ConcurrentObject
37624a7 Add ThreadWithCallQueue unit test
e82ec68 Remove obsolete beast_Function
90551a6 Temporarily leave sqlite3 in whatever threading mode it was already in.
43ebbb1 Fix SharedSingleton to use memoryBarrier
f343941 Tidy up SharedSingleton doc comments
001997e Fix leak on exit from Singleton dependency cycle
83b9d22 Rename to DeadlineTimer::cancel()
77874ee Use new instead of ::new for placement
2a04dcc Journal improvements
50965ca SharedFunction improvements
277e32b Add LockFreeStack iterators
d94e4c2 Fix undefined behavior in UnsignedIntegerCalc (again)
2dc25ce Fix DeadlineTimer, callback while holding lock
207ffde Fix undefined behavior in UnsignedIntegerCalc
1ad8ff9 Fix UnsignedInteger::isZero
1dd2836 Add support for multiprecision integer arithmetic and binary data encoding
a45fc47 Update .gitignore
962a95d Tidy up UnsignedInteger
ca695fa Add Time::isNull()
e96ce99 Better random number facilities in UnitTest
550b8e5 Fine tune UnsignedInteger declaration
8e7e3b7 Allow negative relative expirations in DeadlineTimer
f3dc7ce Add generic Journal class for logging
bfdda32 Make ChildProcess UnitTest manual since it malfunctions
02acf7d General refactoring of beast framework classes
84ef06e Fix ExitHook to derive from AtExitHook
f0acc9c Reduce the max threads in the Workers unit test
55447b0 New SharedSingleton, resolves destruction of objects with static storage duration.
41eb8a1 Remove deprecated SharedPtr::getObject
9eda4bc Make SharedObject members const, the counter mutable
6eda777 Remove deprecated createOnDemandOnce SingletonLifetime option
8c522aa Fix off by one in pending i/o count on HTTPClient
057344e Add HTTPMessage::toString and family
ee728e3 Add UniformResourceLocator::empty
ae324fb Move ./modules to ./src

git-subtree-dir: src/beast
git-subtree-split: 0e7bac945f
2013-10-19 15:54:21 -07:00
JoelKatz
67516766a6 Operations on the raw socket can throw exceptions if it's no longer connected. 2013-10-19 14:14:47 -07:00
Vinnie Falco
3b2ead3476 Turn off console output for msvc logic and managers 2013-10-18 16:29:13 -07:00
Vinnie Falco
fc5be2b911 Use DiscreteClock in ResourceManager 2013-10-18 16:04:37 -07:00
Vinnie Falco
466e623dd6 Add BaseFromMember 2013-10-18 16:04:37 -07:00
Vinnie Falco
a1b487c512 New Resource::Manager for controlling access to server resources 2013-10-18 16:04:31 -07:00
Vinnie Falco
0902af8eb5 Add DiscreteClock and sources 2013-10-17 17:46:23 -07:00
Vinnie Falco
a8a4caf0e4 Make List<>::Node not uncopyable 2013-10-17 17:46:18 -07:00
Vinnie Falco
33478517a6 Add Journal to UnitTest 2013-10-17 17:46:13 -07:00
Vinnie Falco
0d5a8ca300 Revert "Ported declarative path tests to mocha"
This reverts commit abe4f1ba03.
2013-10-17 11:11:06 -07:00
Vinnie Falco
da22f06d85 Revert "Make mocha use test/mocha.opts to DRY up options used by npm test and test/runall.sh and support coffee. Add coffee-script as devDependency to package.json"
This reverts commit 9dfbffa4b8.

Conflicts:

	test/mocha.opts
2013-10-17 11:10:48 -07:00
Vinnie Falco
a918924923 Temporarily disable ServiceQueue dtor precondition asserts 2013-10-16 15:59:04 -07:00
JoelKatz
5a9416fbcf Remove an assert that is not needed. 2013-10-16 13:47:54 -07:00
Vinnie Falco
582b5bb3ac Add --version command line option 2013-10-16 13:29:43 -07:00
Nicholas Dudfield
abe4f1ba03 Ported declarative path tests to mocha 2013-10-13 18:24:41 +07:00
Nicholas Dudfield
9dfbffa4b8 Make mocha use test/mocha.opts to DRY up options used by npm test and test/runall.sh and support coffee. Add coffee-script as devDependency to package.json 2013-10-13 15:38:04 +07:00
Vinnie Falco
a25ba91876 Set version to 0.17.0-rc2 2013-10-11 18:41:45 -07:00
Nik Bougalis
334f109415 Remove extraneous index from peerfinder map. 2013-10-11 18:36:34 -07:00
JoelKatz
eb9eb3aa53 Fix a crash in checkAccept 2013-10-11 16:13:16 -07:00
JoelKatz
978c196c78 Don't assert, just throw. 2013-10-08 15:48:15 -07:00
JoelKatz
20e7cac743 Reduce some logging. 2013-10-08 15:05:41 -07:00
Vinnie Falco
b5d51214ff Add missing #include 2013-10-07 14:26:26 -07:00
Vinnie Falco
485d4b4897 Fix order of includes 2013-10-07 14:24:13 -07:00
Vinnie Falco
fb6ecebbd1 Add PropertyStream for server state introspection 2013-10-07 14:00:03 -07:00
Vinnie Falco
0b69378a03 Update Json::Reader::decodeDouble 2013-10-07 02:49:03 -07:00
Vinnie Falco
256c12f150 Add ScopedWrapperContext 2013-10-06 19:46:42 -07:00
Nik Bougalis
8d0349eee0 Add RelativeTime::value_type typedef 2013-10-06 18:33:53 -07:00
Vinnie Falco
ab0548c9af Fix std::size_t integer ambiguity 2013-10-06 18:33:15 -07:00
Vinnie Falco
4868bc4df7 Validators PropertyStream support 2013-10-06 18:25:59 -07:00
Vinnie Falco
0900dfe46f Fix missing PropertyStream members 2013-10-06 18:25:53 -07:00
Vinnie Falco
8dfe53ff7a More PropertyStream output for PeerFinder 2013-10-06 17:30:45 -07:00
Vinnie Falco
1ae3328642 Add PropertyStream 2013-10-06 17:30:44 -07:00
JoelKatz
b9e0208aee Payment engine doesn't allow returning to XRP. 2013-10-06 15:52:16 -07:00
Vinnie Falco
497cc74adc Set version to 0.17.0-rc1 2013-10-06 11:35:47 -07:00
Vinnie Falco
eac3814fb5 Tidy up AbstractHandler usage in HTTPClient 2013-10-05 15:38:27 -07:00
Vinnie Falco
bb331abeba Remove obsolete source files 2013-10-05 13:08:39 -07:00
Vinnie Falco
6e20bd2dcd Increase arity of SharedFunction 2013-10-05 13:08:39 -07:00
Vinnie Falco
09961845b4 Remove obsolete AsyncService class 2013-10-05 13:08:38 -07:00
Vinnie Falco
7eacd3bf57 Add annotation for Validators 2013-10-05 12:03:51 -07:00
Vinnie Falco
72681fa7fb PeerFinder work 2013-10-05 11:59:17 -07:00
Vinnie Falco
500bddebff Allow CycledSet to grow without bounds 2013-10-05 02:46:23 -07:00
Vinnie Falco
4d3d46f41d Add IPEndpoint::key_equal 2013-10-05 02:41:29 -07:00
Vinnie Falco
82d8d9a092 PeerFinder work, Source fetch, show port in log 2013-10-04 23:22:56 -07:00
Vinnie Falco
30ff139a29 Add ErrorCode and boost library 2013-10-04 23:18:28 -07:00
Vinnie Falco
dc8420d32d LegacyEndpointCache work 2013-10-04 23:18:27 -07:00
Vinnie Falco
bb29c8ba85 Add PeerFinder::Checker for testing endpoints 2013-10-04 23:18:27 -07:00
Vinnie Falco
625780621b Add ServiceQueue::wrap 2013-10-04 23:18:26 -07:00
Vinnie Falco
ea2589dd9c PeerFinder work 2013-10-04 19:25:48 -07:00
Vinnie Falco
942336c454 Move many Thread related classes 2013-10-04 14:34:01 -07:00
Vinnie Falco
90282707ab Measure CPU utilization in ServiceQueue 2013-10-04 14:34:00 -07:00
Vinnie Falco
70f6c41ff7 Move ServiceQueue, ThreadLocalValue, SpinLock 2013-10-04 14:34:00 -07:00
Vinnie Falco
184cf74daa Move WaitableEvent 2013-10-04 14:33:59 -07:00
Vinnie Falco
a23fb06409 Add CPUMeter and ScopedTimeInterval 2013-10-04 14:33:59 -07:00
Vinnie Falco
3638485977 Add RecursiveMutex, UnlockGuard, TryLockGuard 2013-10-04 14:33:59 -07:00
Vinnie Falco
75f3c52d53 Validators work 2013-10-04 14:33:58 -07:00
Vinnie Falco
364973a523 Rename to key_equal for conformance with std containers 2013-10-04 14:33:58 -07:00
Vinnie Falco
678c241962 Validators work 2013-10-04 14:33:57 -07:00
Vinnie Falco
a2aa938e10 Remove Journal from most Stoppable overrides 2013-10-04 14:33:57 -07:00
Vinnie Falco
48eb92e366 Validators work 2013-10-04 14:33:56 -07:00
Vinnie Falco
2894059b63 Fix Peers to stop after children are stopped 2013-10-04 14:33:56 -07:00
Vinnie Falco
66a272debd Alphabet class for base58 conversions, Validators work 2013-10-04 14:33:56 -07:00
Vinnie Falco
7d089561c3 Add Request and Response HTTP parsers 2013-10-04 14:33:55 -07:00
Vinnie Falco
53f8e73b65 Refactor net buffers classes 2013-10-04 14:33:55 -07:00
JoelKatz
37bcf7899e Improve performance of some RPC ledger commands using visitors.
Adds SHAMap::visitLeaves and Ledger::visitStateItems
2013-10-04 11:50:22 -07:00
JoelKatz
86f662aa4a It is not longer necessary to invalidate the OrderBookDB 2013-10-04 02:33:33 -07:00
Vinnie Falco
a1b958eaac Validators update, add LeakChecked to Source subclasses 2013-10-03 19:03:38 -07:00
Vinnie Falco
06189b2584 Disable MSVC OutputWindow for PeerFinder 2013-10-03 19:03:10 -07:00
Vinnie Falco
0bf006cdae Beast class refactor 2013-10-03 19:03:10 -07:00
Vinnie Falco
3f51eb7b63 Fix eof on HTTP client get 2013-10-03 18:36:55 -07:00
Vinnie Falco
b76443dbde Use a simple Thread in SqliteDatabase 2013-10-03 18:36:54 -07:00
Vinnie Falco
5fc823ae08 Show Ripple version in BuildInfo unittest 2013-10-03 18:36:54 -07:00
Vinnie Falco
68aec74b47 Remove obsolete beast container classes 2013-10-03 18:36:53 -07:00
Vinnie Falco
acd23682d1 Use RelativeTime from startup in DeadlineTimer 2013-10-03 18:36:53 -07:00
Vinnie Falco
b042397b9f Add more methods to RelativeTime 2013-10-03 18:36:53 -07:00
David Schwartz
951a8208b8 Don't let OrderBookDB oscillate between two ledgers. 2013-10-03 17:49:38 -07:00
David Schwartz
9b3c74a095 Return the account checked if account_info finds no account. 2013-10-03 16:53:56 -07:00
David Schwartz
647c0e302a Do the tryLocal/addPeers operations on an InboundLedger without the collection lock. 2013-10-03 16:36:33 -07:00
David Schwartz
b3b22d7595 Nothing we do in doTx requires the master lock. 2013-10-03 10:55:42 -07:00
JoelKatz
1ba0139683 Claim saInRemaining. 2013-10-02 16:13:14 -07:00
1294 changed files with 106213 additions and 55977 deletions

23
.travis.yml Normal file
View File

@@ -0,0 +1,23 @@
language: cpp
compiler:
- gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-software-properties
- 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 libboost1.54-all-dev protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
- sudo apt-get install -qq gcc-4.8
- sudo apt-get install -qq g++-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
- g++ -v
script: scons && ./build/rippled --unittest && npm install && npm test
notifications:
email:
false
irc:
channels:
- "chat.freenode.net#ripple-dev"

View File

@@ -65,11 +65,13 @@ UI_HEADERS_DIR += ../../src/ripple_basics
SOURCES += \
../../src/ripple/beast/ripple_beast.cpp \
../../src/ripple/beast/ripple_beastc.c \
../../src/ripple/common/ripple_common.cpp \
../../src/ripple/http/ripple_http.cpp \
../../src/ripple/json/ripple_json.cpp \
../../src/ripple/peerfinder/ripple_peerfinder.cpp \
../../src/ripple/resource/ripple_resource.cpp \
../../src/ripple/rpc/ripple_rpc.cpp \
../../src/ripple/sophia/ripple_sophia.c \
../../src/ripple/sitefiles/ripple_sitefiles.cpp \
../../src/ripple/sslutil/ripple_sslutil.cpp \
../../src/ripple/testoverlay/ripple_testoverlay.cpp \
../../src/ripple/types/ripple_types.cpp \
@@ -93,7 +95,6 @@ SOURCES += \
../../src/ripple_data/ripple_data.cpp \
../../src/ripple_hyperleveldb/ripple_hyperleveldb.cpp \
../../src/ripple_leveldb/ripple_leveldb.cpp \
../../src/ripple_mdb/ripple_mdb.c \
../../src/ripple_net/ripple_net.cpp \
../../src/ripple_websocket/ripple_websocket.cpp

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,7 @@ import glob
import os
import platform
import re
import sys
OSX = bool(platform.mac_ver()[0])
FreeBSD = bool('FreeBSD' == platform.system())
@@ -16,6 +17,8 @@ Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
Debian = bool(Linux and 'debian' == platform.linux_distribution()[0])
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
USING_CLANG = OSX
#
# We expect this to be set
#
@@ -33,8 +36,12 @@ else:
# scons tools
#
HONOR_ENVS = ['CC', 'CXX', 'PATH']
env = Environment(
tools = ['default', 'protoc']
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)
)
# Use a newer gcc on FreeBSD
@@ -48,8 +55,8 @@ if OSX:
env.Replace(CC= 'clang')
env.Replace(CXX= 'clang++')
env.Append(CXXFLAGS = ['-std=c++11', '-stdlib=libc++'])
env.Append(LINKFLAGS='-stdlib=libc++')
env['FRAMEWORKS'] = ['AppKit']
env.Append(LINKFLAGS='-stdlib=libc++')
env['FRAMEWORKS'] = ['AppKit','Foundation']
GCC_VERSION = re.split('\.', commands.getoutput(env['CXX'] + ' -dumpversion'))
@@ -93,13 +100,13 @@ BOOST_LIBS = [
'boost_regex',
'boost_system',
'boost_thread',
'boost_random',
]
# We whitelist platforms where the non -mt version is linked with pthreads. This
# can be verified with: ldd libboost_filesystem.* If a threading library is
# included the platform can be whitelisted.
if FreeBSD or Ubuntu or Archlinux or OSX:
if FreeBSD or Ubuntu or Archlinux:
# if FreeBSD or Ubuntu or Archlinux or OSX:
# non-mt libs do link with pthreads.
env.Append(
LIBS = BOOST_LIBS
@@ -156,11 +163,14 @@ COMPILED_FILES.extend (['src/ripple/beast/ripple_beastc.c'])
# New-style Ripple unity sources
#
COMPILED_FILES.extend([
'src/ripple/common/ripple_common.cpp',
'src/ripple/http/ripple_http.cpp',
'src/ripple/json/ripple_json.cpp',
'src/ripple/peerfinder/ripple_peerfinder.cpp',
'src/ripple/resource/ripple_resource.cpp',
'src/ripple/rocksdb/ripple_rocksdb.cpp',
'src/ripple/rpc/ripple_rpc.cpp',
'src/ripple/sophia/ripple_sophia.c',
'src/ripple/sitefiles/ripple_sitefiles.cpp',
'src/ripple/sslutil/ripple_sslutil.cpp',
'src/ripple/testoverlay/ripple_testoverlay.cpp',
'src/ripple/types/ripple_types.cpp',
@@ -185,7 +195,6 @@ COMPILED_FILES.extend([
'src/ripple_data/ripple_data.cpp',
'src/ripple_hyperleveldb/ripple_hyperleveldb.cpp',
'src/ripple_leveldb/ripple_leveldb.cpp',
'src/ripple_mdb/ripple_mdb.c',
'src/ripple_net/ripple_net.cpp',
'src/ripple_websocket/ripple_websocket.cpp'
])
@@ -249,10 +258,19 @@ env.Append(CXXFLAGS = ['-O1', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+D
#
env.Append(CXXFLAGS = ['-frtti'])
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) == 6):
env.Append(CXXFLAGS = ['-std=c++0x'])
elif (int(GCC_VERSION[0]) > 4 or (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) >= 7)):
env.Append(CXXFLAGS = ['-std=c++11'])
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 Ubuntu:
print UBUNTU_GCC_48_INSTALL_STEPS
sys.exit(1)
else:
env.Append(CXXFLAGS = ['-std=c++11'])
# FreeBSD doesn't support O_DSYNC
if FreeBSD:

View File

@@ -84,6 +84,16 @@
#
#
#
# [ips_fixed]
#
# List of IP addresses to which rippled should always maintain peer
# connections with. This is useful for manually forming private networks,
# for example to configure a validation server that connects to the
# Ripple network through a public-facing server, or for building a set
# of cluster peers.
#
#
#
# [peer_ip]
#
# IP address or domain to bind to allow external connections from peers.
@@ -645,8 +655,8 @@
# Choices for 'type' (not case-sensitive)
# HyperLevelDB Use an improved version of LevelDB (preferred)
# LevelDB Use Google's LevelDB database (deprecated)
# MDB Use MDB
# none Use no backend
# RocksDB Use Facebook's RocksDB database
# SQLite Use SQLite
#
# Required keys:
@@ -697,6 +707,41 @@
#
#
#
# [insight]
#
# Configuration parameters for the Beast.Insight stats collection module.
#
# Insight is a module that collects information from the areas of rippled
# that have instrumentation. The configuration paramters control where the
# collection metrics are sent. The parameters are expressed as key = value
# pairs with no white space. The main parameter is the choice of server:
#
# "server"
#
# Choice of server to send metrics to. Currently the only choice is
# "statsd" which sends UDP packets to a StatsD daemon, which must be
# running while rippled is running. More information on StatsD is
# available here:
# https://github.com/b/statsd_spec
#
# When server=statsd, these additional keys are used:
#
# "address" The UDP address and port of the listening StatsD server,
# in the format, n.n.n.n:port.
#
# "prefix" A string prepended to each collected metric. This is used
# to distinguish between different running instances of rippled.
#
# If this section is missing, or the server type is unspecified or unknown,
# statistics are not collected or reported.
#
# Example:
#
# [insight]
# server=statsd
# address=192.168.0.95:4201
# prefix=my_validator
#
#-------------------------------------------------------------------------------
# Allow other peers to connect to this server.
@@ -738,13 +783,14 @@
medium
# Note that HyperLevelDB is unavailable on Windows platforms
#
[node_db]
type=HyperLevelDB
path=db/hyperldb
path=/etc/ripple/db/hyperldb
# This needs to be an absolute directory reference, not a relative one.
# Modify this value as required.
[debug_logfile]
log/debug.log
/var/log/rippled/debug.log
[sntp_servers]
time.windows.com
@@ -762,3 +808,17 @@ pool.ntp.org
107.21.251.218 51235
184.73.226.101 51235
23.23.201.55 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
# Ditto.
[validation_quorum]
3

114
doc/rippled.init Normal file
View File

@@ -0,0 +1,114 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: ripple
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the ripple network node
# Description: starts rippled using start-stop-daemon
### END INIT INFO
set -e
NAME=rippled
USER="rippled"
GROUP="rippled"
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/local/sbin/rippled
DAEMON_OPTS="--conf /etc/ripple/rippled.cfg"
NET_OPTS="--net $DAEMON_OPTS"
LOGDIR="/var/log/rippled"
DBDIR="/var/db/rippled/db/hyperldb"
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
# I wish it didn't come down to this, but this is the easiest way to ensure
# sanity of an install.
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
chown $USER:$GROUP $LOGDIR
fi
if [ ! -d $DBDIR ]; then
mkdir -p $DBDIR
chown -R $USER:$GROUP $DBDIR
fi
case "$1" in
start)
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE \
--exec $DAEMON --chuid $USER --group $GROUP --verbose -- $NET_OPTS
echo "."
;;
stop)
echo -n "Stopping daemon: "$NAME
$DAEMON $DAEMON_OPTS stop
rm -f $PIDFILE
echo "."
;;
restart)
echo -n "Restarting daemon: "$NAME
$DAEMON $DAEMON_OPTS stop
rm -f $PIDFILE
start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE \
--exec $DAEMON --chuid $USER --group $GROUP -- $NET_OPTS
echo "."
;;
status)
echo "Status of $NAME:"
echo -n "PID of $NAME: "
if [ -f "$PIDFILE" ]; then
cat $PIDFILE
$DAEMON $DAEMON_OPTS server_info
else
echo "$NAME not running."
fi
echo "."
;;
fetch)
echo "$NAME ledger fetching info:"
$DAEMON $DAEMON_OPTS fetch_info
echo "."
;;
uptime)
echo "$NAME uptime:"
$DAEMON $DAEMON_OPTS get_counts
echo "."
;;
startconfig)
echo "$NAME is being started with the following command line:"
echo "$DAEMON $NET_OPTS"
echo "."
;;
command)
# Truncate the script's argument vector by one position to get rid of
# this entry.
shift
# Pass the remainder of the argument vector to rippled.
$DAEMON $DAEMON_OPTS "$@"
echo "."
;;
test)
$DAEMON $DAEMON_OPTS ping
echo "."
;;
*)
echo "Usage: $0 {start|stop|restart|status|fetch|uptime|startconfig|"
echo " command|test}"
exit 1
esac
exit 0

View File

@@ -4,20 +4,12 @@ RIPPLE TODO
Vinnie's List: Changes day to day, descending priority
- PeerFinder work
- Fix and tidy up broken beast classes
- Validators work
* Parse Validator line using cribbed code
- Parse ContentBodyBuffer from HTTPResponse
- HTTPMessage improvements
- 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]
- 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...
- Clean up calculation of COnfig file location.
- Remove TESTNET and all related code and settings.
- Remove addRpcSub, findRpcSub, and notify the appropriate partner(s)
@@ -28,9 +20,21 @@ David Features:
--------------------------------------------------------------------------------
- std::priority_queue for DeadlineTimer
- Change ProxyInfo to use IPAddress, 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 IPEndpoint
- IPv6 support in IPAddress
- Configuration list for Jenkins
@@ -87,8 +91,6 @@ David Features:
- Add "skipped" field to beginTestCase() to disable a test but still record
that it was skipped in the output. Like for mdb import.
- use beast DeadlineTimer for sweep in Application
- Get rid of 'ref' typedefs that really mean const&
- Use secp256k1 from beast
@@ -122,10 +124,6 @@ David Features:
- Rename RPCHandler to CallHandler
- Profile/VTune the application to identify hot spots
* Determine why rippled has a slow startup on Windows
* Improve the performance when running all unit tests on Windows
- Rename "fullBelow" to something like haveAllDescendants or haveAllChildren.
- Rewrite Sustain to use Beast and work on Windows as well
@@ -133,18 +131,10 @@ David Features:
- Make sure the leak detector output appears on Linux and FreeBSD debug builds.
- Create SharedData <LoadState>, move all load related state variables currently
protected by separated mutexes in different classes into the LoadState, and
use read/write locking semantics to update the values. Later, use Listeners
to notify dependent code to resolve the dependency inversion.
- Rename LoadMonitor to LoadMeter, change LoadEvent to LoadMeter::ScopedSample
- Rename LedgerMaster to Ledgers, create ILedgers interface.
- Figure out where previous ledgers go after a call to LedgerMaster::pushLedger()
and see if it is possible to clean up the leaks on exit.
- Replace all NULL with nullptr
- Make TxFormats a member of ICore instead of a singleton.
@@ -152,8 +142,6 @@ David Features:
singleton. It might have to remain a singleton. At the very least,
it should be a SharedSingleton to resolve ordering issues.
- Rename include guards to boost style, e.g. RIPPLE_LOG_H_INCLUDED
- Replace C11X with BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS
- Remove "ENABLE_INSECURE" when the time is right.
@@ -161,8 +149,6 @@ David Features:
- lift unique_ptr / auto_ptr into ripple namespace,
or replace with ScopedPointer (preferred)
- Make LevelDB and Ripple code work with both Unicode and non-Unicode Windows APIs
- Go searching through VFALCO notes and fix everything
- Deal with function-level statics used for SqliteDatabase (like in
@@ -173,30 +159,8 @@ David Features:
STObject
SerializedLedgerEntry
- Replace uint160, uint256 in argument lists, template parameter lists, and
data members with tyepdefs from ripple_ProtocolTypes.h
- Consolidate SQLite database classes: DatabaseCon, Database, SqliteDatabase.
--------------------------------------------------------------------------------
HYPERLEVELDB TODO
--------------------------------------------------------------------------------
- Port to Windows
--------------------------------------------------------------------------------
LEVELDB TODO
--------------------------------------------------------------------------------
- Add VisualStudio 2012 project file to our fork
- Add LevelDB unity .cpp and .h to our fork
- Replace Beast specific platform macros with universal macros so that the
unity doesn't require Beast
- Submit LevelDB fork changes to Bitcoin upstream
--------------------------------------------------------------------------------
WEBSOCKET TODO
--------------------------------------------------------------------------------
@@ -213,65 +177,6 @@ PROTOCOL BUFFERS TODO
- Make a Visual Studio 2012 Project for source browsing
--------------------------------------------------------------------------------
NOTES
--------------------------------------------------------------------------------
LoadEvent
Is referenced with both a shared pointer and an auto pointer.
Should be named LoadMeter::ScopedSample. Or possibly ScopedLoadSample
JobQueue
getLoadEvent and getLoadEventAP differ only in the style of pointer
container which is returned. Unnecessary complexity.
Naming: Some names don't make sense.
Index
Stop using Index to refer to keys in tables. Replace with "Key" ?
Index implies a small integer, or a data structure.
This is all over the place in the Ledger API, "Index" of this and
"Index" of that, the terminology is imprecise and helps neither
understanding nor recall.
Inconsistent names
We have full names like SerializedType and then acronyms like STObject
Two names for some things, e.g. SerializedLedgerEntry and SLE
Shared/Smart pointer typedefs in classes have a variety of different names
for the same thing. e.g. "pointer", "ptr", "ptr_t", "wptr"
Verbose names
The prefix "Flat" is more appealing than "Serialized" because its shorter and
easier to pronounce.
Ledger "Skip List"
Is not really a skip list data structure. This is more appropriately
called an "index" although that name is currently used to identify hashes
used as keys.
Interfaces
Serializer
Upon analysis this class does two incompatible things. Flattening, and
unflattening. The interface should be reimplemented as two distinct
abstract classes, InputStream and OutputStream with suitable implementations
such as to and from a block of memory or dynamically allocated buffer.
The name and conflation of dual roles serves to confuse code at the point
of call. Does set(Serializer& s) flatten or unflatten the data? This
would be more clear:
bool write (OutputStream& stream);
We have beast for InputStream and OutputStream, we can use those now.
--------------------------------------------------------------------------------
Davidisms
--------------------------------------------------------------------------------
@@ -300,31 +205,3 @@ A node is "full below" if we believe we have (either in the database or
The fullBelowCache is a cache of hashes of nodes that are full below. Which means
there are no missing children
What we want from the unique node list:
- Some number of trusted roots (known by domain)
probably organizations whose job is to provide a list of validators
- We imagine the IRGA for example would establish some group whose job is to
maintain a list of validators. There would be a public list of criteria
that they would use to vet the validator. Things like:
* Not anonymous
* registered business
* Physical location
* Agree not to cease operations without notice / arbitrarily
* Responsive to complaints
- Identifiable jurisdiction
* Homogeneity in the jurisdiction is a business risk
* If all validators are in the same jurisdiction this is a business risk
- OpenCoin sets criteria for the organizations
- Rippled will ship with a list of trusted root "certificates"
In other words this is a list of trusted domains from which the software
can contact each trusted root and retrieve a list of "good" validators
and then do something with that information
- All the validation information would be public, including the broadcast
messages.
- The goal is to easily identify bad actors and assess network health
* Malicious intent
* Or, just hardware problems (faulty drive or memory)

View File

@@ -13,14 +13,16 @@
"ripple-lib": "0.7.25",
"async": "~0.2.9",
"extend": "~1.2.0",
"simple-jsonrpc": "~0.0.2"
"simple-jsonrpc": "~0.0.2",
"deep-equal": "0.0.0"
},
"devDependencies": {
"coffee-script": "~1.6.3",
"mocha": "~1.13.0"
},
"scripts": {
"test": "mocha --reporter spec --ui tdd --timeout 10000 --slow 600 test/*-test.js"
"test": "mocha"
},
"repository": {

View File

@@ -107,6 +107,13 @@
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
#endif
/** Config: BEAST_SQLITE_FORCE_NDEBUG
Setting this option forces sqlite into release mode even if NDEBUG is not set
*/
#ifndef BEAST_SQLITE_FORCE_NDEBUG
#define BEAST_SQLITE_FORCE_NDEBUG 1
#endif
//------------------------------------------------------------------------------
//
// Boost
@@ -156,11 +163,25 @@
//------------------------------------------------------------------------------
// These control whether or not certain functionality gets
// compiled into the resulting rippled executable
/** Config: RIPPLE_ROCKSDB_AVAILABLE
Controls whether or not the RocksDB database back-end is compiled into
rippled. RocksDB requires a relatively modern C++ compiler (tested with
gcc versions 4.8.1 and later) that supports some C++11 features.
*/
#ifndef RIPPLE_ROCKSDB_AVAILABLE
//#define RIPPLE_ROCKSDB_AVAILABLE 0
#endif
//------------------------------------------------------------------------------
// Here temporarily to turn off new Validations code while it
// is being written.
//
#ifndef RIPPLE_USE_NEW_VALIDATORS
#define RIPPLE_USE_NEW_VALIDATORS 0
#ifndef RIPPLE_USE_VALIDATORS
#define RIPPLE_USE_VALIDATORS 0
#endif
// Turning this on will use the new PeerFinder logic to establish connections

View File

@@ -21,6 +21,16 @@ About git-subtree:
https://github.com/apenwarr/git-subtree <br>
http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ <br>
<table align=left><tr>
<th>dir</th>
<th>What</th>
</tr><tr>
<td>beast</td>
<td>Beast, the amazing cross-platform library.<br>
git@github.com:vinniefalco/Beast.git
</td>
</tr></table>
## ./beast
Beast, the amazing cross-platform library.

View File

@@ -15,6 +15,7 @@ Docs
*.manifest
*.manifest.res
*.o
*.opensdf
*.d
*.sdf
xcuserdata
@@ -24,5 +25,5 @@ contents.xcworkspacedata
profile
Builds/VisualStudio2012/Debug
Builds/VisualStudio2012/Release
project.xcworkspace
modules/beast_cryptopp

View File

@@ -82,9 +82,21 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\beast\Arithmetic.h" />
<ClInclude Include="..\..\beast\Asio.h" />
<ClInclude Include="..\..\beast\asio\io_latency_probe.h" />
<ClInclude Include="..\..\beast\asio\IPAddressConversion.h" />
<ClInclude Include="..\..\beast\Atomic.h" />
<ClInclude Include="..\..\beast\Boost.h" />
<ClInclude Include="..\..\beast\boost\ErrorCode.h" />
<ClInclude Include="..\..\beast\ByteOrder.h" />
<ClInclude Include="..\..\beast\chrono\chrono_io.h" />
<ClInclude Include="..\..\beast\chrono\chrono_util.h" />
<ClInclude Include="..\..\beast\chrono\CPUMeter.h" />
<ClInclude Include="..\..\beast\chrono\abstract_clock.h" />
<ClInclude Include="..\..\beast\chrono\manual_clock.h" />
<ClInclude Include="..\..\beast\chrono\ratio_io.h" />
<ClInclude Include="..\..\beast\chrono\RelativeTime.h" />
<ClInclude Include="..\..\beast\chrono\ScopedTimeInterval.h" />
<ClInclude Include="..\..\beast\Config.h" />
<ClInclude Include="..\..\beast\config\CompilerConfig.h" />
<ClInclude Include="..\..\beast\config\compiler\Clang.h" />
@@ -104,35 +116,52 @@
<ClInclude Include="..\..\beast\config\SelectStdlibConfig.h" />
<ClInclude Include="..\..\beast\config\StandardConfig.h" />
<ClInclude Include="..\..\beast\Crypto.h" />
<ClInclude Include="..\..\beast\crypto\BinaryEncoding.h" />
<ClInclude Include="..\..\beast\crypto\impl\sha2\sha2.h" />
<ClInclude Include="..\..\beast\crypto\MurmurHash.h" />
<ClInclude Include="..\..\beast\crypto\Sha256.h" />
<ClInclude Include="..\..\beast\crypto\UnsignedInteger.h" />
<ClInclude Include="..\..\beast\crypto\UnsignedIntegerCalc.h" />
<ClInclude Include="..\..\beast\CStdInt.h" />
<ClInclude Include="..\..\beast\cyclic_iterator.h" />
<ClInclude Include="..\..\beast\FixedArray.h" />
<ClInclude Include="..\..\beast\HeapBlock.h" />
<ClInclude Include="..\..\beast\HTTP.h" />
<ClInclude Include="..\..\beast\http\impl\http-parser\http_parser.h" />
<ClInclude Include="..\..\beast\http\ParsedURL.h" />
<ClInclude Include="..\..\beast\http\URL.h" />
<ClInclude Include="..\..\beast\Insight.h" />
<ClInclude Include="..\..\beast\insight\Collector.h" />
<ClInclude Include="..\..\beast\insight\Counter.h" />
<ClInclude Include="..\..\beast\insight\CounterImpl.h" />
<ClInclude Include="..\..\beast\insight\Event.h" />
<ClInclude Include="..\..\beast\insight\EventImpl.h" />
<ClInclude Include="..\..\beast\insight\Gauge.h" />
<ClInclude Include="..\..\beast\insight\GaugeImpl.h" />
<ClInclude Include="..\..\beast\insight\Hook.h" />
<ClInclude Include="..\..\beast\insight\HookImpl.h" />
<ClInclude Include="..\..\beast\insight\Meter.h" />
<ClInclude Include="..\..\beast\insight\MeterImpl.h" />
<ClInclude Include="..\..\beast\insight\NullCollector.h" />
<ClInclude Include="..\..\beast\insight\StatsDCollector.h" />
<ClInclude Include="..\..\beast\Intrusive.h" />
<ClInclude Include="..\..\beast\intrusive\ForwardList.h" />
<ClInclude Include="..\..\beast\intrusive\IntrusiveArray.h" />
<ClInclude Include="..\..\beast\intrusive\List.h" />
<ClInclude Include="..\..\beast\intrusive\LockFreeStack.h" />
<ClInclude Include="..\..\beast\intrusive\PointerTraits.h" />
<ClInclude Include="..\..\beast\make_unique.h" />
<ClInclude Include="..\..\beast\Memory.h" />
<ClInclude Include="..\..\beast\MPL.h" />
<ClInclude Include="..\..\beast\mpl\AddConst.h" />
<ClInclude Include="..\..\beast\mpl\CopyConst.h" />
<ClInclude Include="..\..\beast\mpl\IfCond.h" />
<ClInclude Include="..\..\beast\mpl\IsCallPossible.h" />
<ClInclude Include="..\..\beast\mpl\PointerToOther.h" />
<ClInclude Include="..\..\beast\mpl\RemoveConst.h" />
<ClInclude Include="..\..\beast\mpl\RemoveConstVolatile.h" />
<ClInclude Include="..\..\beast\mpl\RemoveReference.h" />
<ClInclude Include="..\..\beast\mpl\RemoveVolatile.h" />
<ClInclude Include="..\..\beast\Net.h" />
<ClInclude Include="..\..\beast\net\IPEndpoint.h" />
<ClInclude Include="..\..\beast\net\BufferType.h" />
<ClInclude Include="..\..\beast\net\DynamicBuffer.h" />
<ClInclude Include="..\..\beast\net\IPAddress.h" />
<ClInclude Include="..\..\beast\SafeBool.h" />
<ClInclude Include="..\..\beast\SmartPtr.h" />
<ClInclude Include="..\..\beast\smart_ptr\AbstractObject.h" />
<ClInclude Include="..\..\beast\smart_ptr\ContainerDeletePolicy.h" />
<ClInclude Include="..\..\beast\smart_ptr\ScopedPointer.h" />
<ClInclude Include="..\..\beast\smart_ptr\SharedObject.h" />
<ClInclude Include="..\..\beast\smart_ptr\SharedPtr.h" />
<ClInclude Include="..\..\beast\StaticAssert.h" />
<ClInclude Include="..\..\beast\Strings.h" />
<ClInclude Include="..\..\beast\strings\CharacterFunctions.h" />
@@ -144,12 +173,25 @@
<ClInclude Include="..\..\beast\strings\String.h" />
<ClInclude Include="..\..\beast\strings\StringCharPointerType.h" />
<ClInclude Include="..\..\beast\strings\StringFromNumber.h" />
<ClInclude Include="..\..\beast\Thread.h" />
<ClInclude Include="..\..\beast\thread\LockGuard.h" />
<ClInclude Include="..\..\beast\thread\SharedData.h" />
<ClInclude Include="..\..\beast\thread\SharedLockGuard.h" />
<ClInclude Include="..\..\beast\thread\SharedMutexAdapter.h" />
<ClInclude Include="..\..\beast\Threads.h" />
<ClInclude Include="..\..\beast\Chrono.h" />
<ClInclude Include="..\..\beast\threads\detail\BindHandler.h" />
<ClInclude Include="..\..\beast\threads\detail\DispatchedHandler.h" />
<ClInclude Include="..\..\beast\threads\LockGuard.h" />
<ClInclude Include="..\..\beast\threads\RecursiveMutex.h" />
<ClInclude Include="..\..\beast\threads\semaphore.h" />
<ClInclude Include="..\..\beast\threads\ServiceQueue.h" />
<ClInclude Include="..\..\beast\threads\SharedData.h" />
<ClInclude Include="..\..\beast\threads\SharedLockGuard.h" />
<ClInclude Include="..\..\beast\threads\SharedMutexAdapter.h" />
<ClInclude Include="..\..\beast\threads\SpinLock.h" />
<ClInclude Include="..\..\beast\threads\Stoppable.h" />
<ClInclude Include="..\..\beast\threads\Thread.h" />
<ClInclude Include="..\..\beast\threads\ThreadLocalValue.h" />
<ClInclude Include="..\..\beast\threads\TryLockGuard.h" />
<ClInclude Include="..\..\beast\threads\UnlockGuard.h" />
<ClInclude Include="..\..\beast\threads\WaitableEvent.h" />
<ClInclude Include="..\..\beast\threads\ScopedWrapperContext.h" />
<ClInclude Include="..\..\beast\TypeTraits.h" />
<ClInclude Include="..\..\beast\type_traits\IntegralConstant.h" />
<ClInclude Include="..\..\beast\type_traits\IsIntegral.h" />
@@ -157,10 +199,15 @@
<ClInclude Include="..\..\beast\type_traits\RemoveSigned.h" />
<ClInclude Include="..\..\beast\Uncopyable.h" />
<ClInclude Include="..\..\beast\Utility.h" />
<ClInclude Include="..\..\beast\utility\BaseFromMember.h" />
<ClInclude Include="..\..\beast\utility\Debug.h" />
<ClInclude Include="..\..\beast\utility\EnableIf.h" />
<ClInclude Include="..\..\beast\utility\Error.h" />
<ClInclude Include="..\..\beast\utility\hash_pair.h" />
<ClInclude Include="..\..\beast\utility\Journal.h" />
<ClInclude Include="..\..\beast\utility\LeakChecked.h" />
<ClInclude Include="..\..\beast\utility\PropertyStream.h" />
<ClInclude Include="..\..\beast\utility\StaticObject.h" />
<ClInclude Include="..\..\beast\Version.h" />
<ClInclude Include="..\..\config\BeastConfig.h" />
<ClInclude Include="..\..\modules\beast_asio\async\AbstractHandler.h" />
@@ -171,8 +218,6 @@
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerAllocator.h" />
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerPtr.h" />
<ClInclude Include="..\..\modules\beast_asio\async\SharedHandlerType.h" />
<ClInclude Include="..\..\modules\beast_asio\basics\BufferType.h" />
<ClInclude Include="..\..\modules\beast_asio\basics\ContentBodyBuffer.h" />
<ClInclude Include="..\..\modules\beast_asio\basics\BuffersType.h" />
<ClInclude Include="..\..\modules\beast_asio\basics\FixedInputBuffer.h" />
<ClInclude Include="..\..\modules\beast_asio\basics\PeerRole.h" />
@@ -186,7 +231,9 @@
<ClInclude Include="..\..\modules\beast_asio\http\HTTPParserImpl.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPParser.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPRequest.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPRequestParser.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPResponse.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPResponseParser.h" />
<ClInclude Include="..\..\modules\beast_asio\http\HTTPVersion.h" />
<ClInclude Include="..\..\modules\beast_asio\protocol\HandshakeDetectLogic.h" />
<ClInclude Include="..\..\modules\beast_asio\protocol\HandshakeDetectLogicPROXY.h" />
@@ -214,29 +261,19 @@
<ClInclude Include="..\..\modules\beast_asio\tests\PeerTest.h" />
<ClInclude Include="..\..\modules\beast_asio\tests\TestPeerType.h" />
<ClInclude Include="..\..\modules\beast_core\beast_core.h" />
<ClInclude Include="..\..\modules\beast_core\containers\AbstractFifo.h" />
<ClInclude Include="..\..\modules\beast_core\containers\Array.h" />
<ClInclude Include="..\..\modules\beast_core\containers\ArrayAllocationBase.h" />
<ClInclude Include="..\..\modules\beast_core\containers\DynamicObject.h" />
<ClInclude Include="..\..\modules\beast_core\containers\ElementComparator.h" />
<ClInclude Include="..\..\modules\beast_core\containers\DynamicArray.h" />
<ClInclude Include="..\..\modules\beast_core\containers\HashMap.h" />
<ClInclude Include="..\..\modules\beast_core\containers\LinkedListPointer.h" />
<ClInclude Include="..\..\modules\beast_core\containers\LockFreeQueue.h" />
<ClInclude Include="..\..\modules\beast_core\containers\NamedValueSet.h" />
<ClInclude Include="..\..\modules\beast_core\containers\OwnedArray.h" />
<ClInclude Include="..\..\modules\beast_core\containers\PropertySet.h" />
<ClInclude Include="..\..\modules\beast_core\containers\SharedObjectArray.h" />
<ClInclude Include="..\..\modules\beast_core\containers\ScopedValueSetter.h" />
<ClInclude Include="..\..\modules\beast_core\containers\SharedTable.h" />
<ClInclude Include="..\..\modules\beast_core\containers\SortedLookupTable.h" />
<ClInclude Include="..\..\modules\beast_core\containers\SortedSet.h" />
<ClInclude Include="..\..\modules\beast_core\containers\SparseSet.h" />
<ClInclude Include="..\..\modules\beast_core\containers\DynamicList.h" />
<ClInclude Include="..\..\modules\beast_core\containers\Variant.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\FPUFlags.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\LeakChecked.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\SemanticVersion.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\Throw.h" />
<ClInclude Include="..\..\modules\beast_core\diagnostic\UnitTest.h" />
@@ -254,37 +291,16 @@
<ClInclude Include="..\..\modules\beast_core\logging\FileLogger.h" />
<ClInclude Include="..\..\modules\beast_core\logging\Logger.h" />
<ClInclude Include="..\..\modules\beast_core\maths\BigInteger.h" />
<ClInclude Include="..\..\modules\beast_core\maths\Expression.h" />
<ClInclude Include="..\..\modules\beast_core\maths\Interval.h" />
<ClInclude Include="..\..\modules\beast_core\maths\Math.h" />
<ClInclude Include="..\..\modules\beast_core\maths\MurmurHash.h" />
<ClInclude Include="..\..\modules\beast_core\maths\Random.h" />
<ClInclude Include="..\..\modules\beast_core\maths\Range.h" />
<ClInclude Include="..\..\modules\beast_core\maths\uint24.h" />
<ClInclude Include="..\..\modules\beast_core\memory\AllocatedBy.h" />
<ClInclude Include="..\..\modules\beast_core\memory\AtomicCounter.h" />
<ClInclude Include="..\..\modules\beast_core\memory\AtomicFlag.h" />
<ClInclude Include="..\..\modules\beast_core\memory\AtomicPointer.h" />
<ClInclude Include="..\..\modules\beast_core\memory\AtomicState.h" />
<ClInclude Include="..\..\modules\beast_core\memory\CacheLine.h" />
<ClInclude Include="..\..\modules\beast_core\memory\ContainerDeletePolicy.h" />
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStore.h" />
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStoreWithoutTLS.h" />
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStoreWithTLS.h" />
<ClInclude Include="..\..\modules\beast_core\memory\GlobalFifoFreeStore.h" />
<ClInclude Include="..\..\modules\beast_core\memory\GlobalPagedFreeStore.h" />
<ClInclude Include="..\..\modules\beast_core\memory\MemoryAlignment.h" />
<ClInclude Include="..\..\modules\beast_core\memory\MemoryBlock.h" />
<ClInclude Include="..\..\modules\beast_core\memory\OptionalScopedPointer.h" />
<ClInclude Include="..\..\modules\beast_core\memory\PagedFreeStore.h" />
<ClInclude Include="..\..\modules\beast_core\memory\RecycledObjectPool.h" />
<ClInclude Include="..\..\modules\beast_core\memory\SharedFunction.h" />
<ClInclude Include="..\..\modules\beast_core\memory\SharedObject.h" />
<ClInclude Include="..\..\modules\beast_core\memory\ScopedPointer.h" />
<ClInclude Include="..\..\modules\beast_core\memory\SharedSingleton.h" />
<ClInclude Include="..\..\modules\beast_core\memory\WeakReference.h" />
<ClInclude Include="..\..\modules\beast_core\memory\SharedPtr.h" />
<ClInclude Include="..\..\modules\beast_core\memory\StaticObject.h" />
<ClInclude Include="..\..\modules\beast_core\misc\Main.h" />
<ClInclude Include="..\..\modules\beast_core\misc\Result.h" />
<ClInclude Include="..\..\modules\beast_core\misc\Uuid.h" />
@@ -294,7 +310,6 @@
<ClInclude Include="..\..\modules\beast_core\native\osx_ObjCHelpers.h" />
<ClInclude Include="..\..\modules\beast_core\native\posix_SharedCode.h" />
<ClInclude Include="..\..\modules\beast_core\native\win32_ComSmartPtr.h" />
<ClInclude Include="..\..\modules\beast_core\network\IPAddress.h" />
<ClInclude Include="..\..\modules\beast_core\network\MACAddress.h" />
<ClInclude Include="..\..\modules\beast_core\network\NamedPipe.h" />
<ClInclude Include="..\..\modules\beast_core\network\Socket.h" />
@@ -327,26 +342,11 @@
<ClInclude Include="..\..\modules\beast_core\threads\InterProcessLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\Process.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ReadWriteLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ReadWriteMutex.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ScopedLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ScopedReadLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ScopedWriteLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\SpinDelay.h" />
<ClInclude Include="..\..\modules\beast_core\threads\SpinLock.h" />
<ClInclude Include="..\..\modules\beast_core\threads\Thread.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ThreadLocalValue.h" />
<ClInclude Include="..\..\modules\beast_core\threads\ThreadPool.h" />
<ClInclude Include="..\..\modules\beast_core\threads\TimeSliceThread.h" />
<ClInclude Include="..\..\modules\beast_core\threads\WaitableEvent.h" />
<ClInclude Include="..\..\modules\beast_core\thread\CallQueue.h" />
<ClInclude Include="..\..\modules\beast_core\thread\DeadlineTimer.h" />
<ClInclude Include="..\..\modules\beast_core\thread\InterruptibleThread.h" />
<ClInclude Include="..\..\modules\beast_core\thread\Listeners.h" />
<ClInclude Include="..\..\modules\beast_core\thread\ManualCallQueue.h" />
<ClInclude Include="..\..\modules\beast_core\thread\Semaphore.h" />
<ClInclude Include="..\..\modules\beast_core\thread\ServiceQueue.h" />
<ClInclude Include="..\..\modules\beast_core\thread\Stoppable.h" />
<ClInclude Include="..\..\modules\beast_core\thread\ThreadWithCallQueue.h" />
<ClInclude Include="..\..\modules\beast_core\thread\Workers.h" />
<ClInclude Include="..\..\modules\beast_core\thread\detail\ScopedLock.h" />
<ClInclude Include="..\..\modules\beast_core\thread\detail\TrackedMutex.h" />
@@ -374,14 +374,6 @@
<ClInclude Include="..\..\modules\beast_core\zip\zlib\zconf.in.h" />
<ClInclude Include="..\..\modules\beast_core\zip\zlib\zlib.h" />
<ClInclude Include="..\..\modules\beast_core\zip\zlib\zutil.h" />
<ClInclude Include="..\..\modules\beast_crypto\beast_crypto.h" />
<ClInclude Include="..\..\modules\beast_crypto\math\BinaryEncoding.h" />
<ClInclude Include="..\..\modules\beast_crypto\math\UnsignedInteger.h" />
<ClInclude Include="..\..\modules\beast_crypto\math\UnsignedIntegerCalc.h" />
<ClInclude Include="..\..\modules\beast_db\beast_db.h" />
<ClInclude Include="..\..\modules\beast_db\keyvalue\KeyvaDB.h" />
<ClInclude Include="..\..\modules\beast_extras\beast_extras.h" />
<ClInclude Include="..\..\modules\beast_extras\traits\BoostLockableTraits.h" />
<ClInclude Include="..\..\modules\beast_sqdb\api\backend.h" />
<ClInclude Include="..\..\modules\beast_sqdb\api\blob.h" />
<ClInclude Include="..\..\modules\beast_sqdb\api\into.h" />
@@ -407,7 +399,33 @@
<ClInclude Include="..\..\modules\beast_sqlite\sqlite\sqlite3ext.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\beast\asio\Asio.cpp" />
<ClCompile Include="..\..\beast\asio\impl\IPAddressConversion.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="..\..\beast\boost\Boost.cpp" />
<ClCompile Include="..\..\beast\chrono\Chrono.cpp" />
<ClCompile Include="..\..\beast\chrono\impl\chrono_io.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="..\..\beast\chrono\impl\CPUMeter.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="..\..\beast\chrono\impl\abstract_clock.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="..\..\beast\chrono\impl\RelativeTime.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -415,6 +433,18 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\beast\crypto\Crypto.cpp" />
<ClCompile Include="..\..\beast\crypto\impl\BinaryEncoding.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="..\..\beast\crypto\impl\MurmurHash.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="..\..\beast\crypto\impl\Sha256.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -439,6 +469,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\beast\crypto\impl\UnsignedInteger.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="..\..\beast\http\HTTP.cpp" />
<ClCompile Include="..\..\beast\http\impl\http_parser.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -482,13 +518,57 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\beast\net\impl\IPEndpoint.cpp">
<ClCompile Include="..\..\beast\insight\impl\Collector.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="..\..\beast\insight\impl\Hook.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="..\..\beast\insight\impl\Metric.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="..\..\beast\insight\impl\NullCollector.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="..\..\beast\insight\impl\StatsDCollector.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="..\..\beast\insight\Insight.cpp" />
<ClCompile Include="..\..\beast\net\impl\DynamicBuffer.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="..\..\beast\net\impl\IPAddress.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="..\..\beast\net\Net.cpp" />
<ClCompile Include="..\..\beast\smart_ptr\impl\AbstractObject.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="..\..\beast\smart_ptr\SmartPtr.cpp" />
<ClCompile Include="..\..\beast\strings\impl\CharacterFunctions.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -502,6 +582,43 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\beast\strings\Strings.cpp" />
<ClCompile Include="..\..\beast\threads\impl\Atomic.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="..\..\beast\threads\impl\RecursiveMutex.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="..\..\beast\threads\impl\ServiceQueue.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="..\..\beast\threads\impl\Stoppable.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="..\..\beast\threads\impl\Thread.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="..\..\beast\threads\impl\WaitableEvent.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="..\..\beast\threads\Threads.cpp" />
<ClCompile Include="..\..\beast\utility\impl\Debug.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -520,14 +637,26 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\beast\utility\Utility.cpp" />
<ClCompile Include="..\..\modules\beast_asio\async\SharedHandler.cpp">
<ClCompile Include="..\..\beast\utility\impl\LeakChecked.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="..\..\modules\beast_asio\basics\ContentBodyBuffer.cpp">
<ClCompile Include="..\..\beast\utility\impl\PropertyStream.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="..\..\beast\utility\impl\StaticObject.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="..\..\beast\utility\Utility.cpp" />
<ClCompile Include="..\..\modules\beast_asio\async\SharedHandler.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>
@@ -580,12 +709,24 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\http\HTTPRequestParser.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="..\..\modules\beast_asio\http\HTTPResponse.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="..\..\modules\beast_asio\http\HTTPResponseParser.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="..\..\modules\beast_asio\http\HTTPVersion.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -671,12 +812,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\beast_core.cpp" />
<ClCompile Include="..\..\modules\beast_core\containers\AbstractFifo.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\DynamicObject.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -701,30 +836,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\DynamicArray.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="..\..\modules\beast_core\containers\DynamicList.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="..\..\modules\beast_core\containers\HashMap.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="..\..\modules\beast_core\diagnostic\Assert.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="..\..\modules\beast_core\diagnostic\FatalError.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -735,12 +846,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\LeakChecked.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="..\..\modules\beast_core\diagnostic\SemanticVersion.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -825,60 +930,18 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\maths\Expression.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\maths\MurmurHash.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="..\..\modules\beast_core\maths\Random.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\FifoFreeStoreWithoutTLS.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="..\..\modules\beast_core\memory\FifoFreeStoreWithTLS.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="..\..\modules\beast_core\memory\GlobalPagedFreeStore.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="..\..\modules\beast_core\memory\MemoryBlock.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\PagedFreeStore.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="..\..\modules\beast_core\memory\StaticObject.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="..\..\modules\beast_core\misc\Main.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1023,12 +1086,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\network\IPAddress.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\network\MACAddress.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
@@ -1161,90 +1218,18 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\ReadWriteMutex.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="..\..\modules\beast_core\threads\SpinDelay.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="..\..\modules\beast_core\threads\Thread.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\ThreadPool.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\TimeSliceThread.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\CallQueue.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="..\..\modules\beast_core\thread\DeadlineTimer.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="..\..\modules\beast_core\thread\InterruptibleThread.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="..\..\modules\beast_core\thread\Listeners.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="..\..\modules\beast_core\thread\ManualCallQueue.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="..\..\modules\beast_core\thread\Semaphore.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="..\..\modules\beast_core\thread\ServiceQueue.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="..\..\modules\beast_core\thread\Stoppable.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="..\..\modules\beast_core\thread\ThreadWithCallQueue.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="..\..\modules\beast_core\thread\Workers.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1371,27 +1356,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\modules\beast_crypto\beast_crypto.cpp" />
<ClCompile Include="..\..\modules\beast_crypto\math\BinaryEncoding.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="..\..\modules\beast_crypto\math\UnsignedInteger.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="..\..\modules\beast_db\beast_db.cpp" />
<ClCompile Include="..\..\modules\beast_db\keyvalue\KeyvaDB.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="..\..\modules\beast_extras\beast_extras.cpp" />
<ClCompile Include="..\..\modules\beast_sqdb\beast_sqdb.cpp" />
<ClCompile Include="..\..\modules\beast_sqdb\source\blob.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -1536,6 +1500,8 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -1564,6 +1530,8 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@@ -135,18 +135,6 @@
<Filter Include="beast_core\diagnostic">
<UniqueIdentifier>{69e28551-92ea-420b-a465-75ed248e3b59}</UniqueIdentifier>
</Filter>
<Filter Include="beast_crypto">
<UniqueIdentifier>{62b1f8e3-79e4-46cc-b3fb-a12754aef249}</UniqueIdentifier>
</Filter>
<Filter Include="beast_crypto\math">
<UniqueIdentifier>{1170f2bc-2456-410a-ab2b-c45f6ed37b9e}</UniqueIdentifier>
</Filter>
<Filter Include="beast_db">
<UniqueIdentifier>{4834218f-f13f-41bc-a8a0-50314a3a99a3}</UniqueIdentifier>
</Filter>
<Filter Include="beast_db\keyvalue">
<UniqueIdentifier>{15a98fee-1b52-45eb-9480-514b8750d755}</UniqueIdentifier>
</Filter>
<Filter Include="beast_sqlite">
<UniqueIdentifier>{cbf5f5a3-5d66-4b6d-996d-20ed14b41793}</UniqueIdentifier>
</Filter>
@@ -195,12 +183,6 @@
<Filter Include="beast_core\thread\impl">
<UniqueIdentifier>{91538dcf-b219-4c80-9861-bb4949089775}</UniqueIdentifier>
</Filter>
<Filter Include="beast_extras">
<UniqueIdentifier>{2f5b95a8-1adf-4319-8464-ddc2b2e03f0b}</UniqueIdentifier>
</Filter>
<Filter Include="beast_extras\traits">
<UniqueIdentifier>{bf498396-2e1f-4903-be68-3053ba439af5}</UniqueIdentifier>
</Filter>
<Filter Include="beast_asio\protocol">
<UniqueIdentifier>{c0724499-ab69-40c3-90e2-65242dbd2eaa}</UniqueIdentifier>
</Filter>
@@ -234,9 +216,6 @@
<Filter Include="beast\utility\impl">
<UniqueIdentifier>{775ab0d6-aa5f-43d7-ab3b-3c01652a9ef1}</UniqueIdentifier>
</Filter>
<Filter Include="beast\thread">
<UniqueIdentifier>{da8084c0-491b-4eb0-b750-97182a9deed4}</UniqueIdentifier>
</Filter>
<Filter Include="beast\http">
<UniqueIdentifier>{56ef157f-ad92-4da7-8fbf-00723f769732}</UniqueIdentifier>
</Filter>
@@ -258,15 +237,6 @@
<Filter Include="beast\config">
<UniqueIdentifier>{1fff3bd8-44ae-41df-8dd4-8bb6f07b2908}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto">
<UniqueIdentifier>{9c1ef4c4-5623-4500-859f-12d6ce5ae362}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto\impl">
<UniqueIdentifier>{fc3d3f14-9ba1-43e4-b086-cbbd2f63b944}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto\impl\sha2">
<UniqueIdentifier>{44489531-f44a-439a-a6ea-d32c252b1e8b}</UniqueIdentifier>
</Filter>
<Filter Include="beast\chrono">
<UniqueIdentifier>{57dc7059-cbb2-437c-9c52-79825d9a4cf5}</UniqueIdentifier>
</Filter>
@@ -285,14 +255,50 @@
<Filter Include="beast\config\stdlib">
<UniqueIdentifier>{7243e5e5-ad7e-4d81-8444-d545919e850c}</UniqueIdentifier>
</Filter>
<Filter Include="beast\smart_ptr">
<UniqueIdentifier>{4e9c54da-1581-41d7-ac75-48140e4a13d4}</UniqueIdentifier>
</Filter>
<Filter Include="beast\threads">
<UniqueIdentifier>{f864ff58-1055-4c56-805f-9f181c4f0aa1}</UniqueIdentifier>
</Filter>
<Filter Include="beast\threads\impl">
<UniqueIdentifier>{386a8cd8-6be3-4cac-9bca-7a01fdb5327a}</UniqueIdentifier>
</Filter>
<Filter Include="beast\threads\detail">
<UniqueIdentifier>{b116764e-1ad5-4854-a549-73c5beb5ae37}</UniqueIdentifier>
</Filter>
<Filter Include="beast\boost">
<UniqueIdentifier>{d7ec873a-d1e7-4341-9d20-a1be8f8ddd88}</UniqueIdentifier>
</Filter>
<Filter Include="beast\asio">
<UniqueIdentifier>{f73fedee-2efb-431b-9f4f-d2fd405454f6}</UniqueIdentifier>
</Filter>
<Filter Include="beast\asio\impl">
<UniqueIdentifier>{30b0fdfb-02b6-47dd-bdd9-ffc1f57e1f2c}</UniqueIdentifier>
</Filter>
<Filter Include="beast\smart_ptr\impl">
<UniqueIdentifier>{df4f2935-13a1-4afe-90cc-d86472ec2466}</UniqueIdentifier>
</Filter>
<Filter Include="beast\insight">
<UniqueIdentifier>{174b9125-76a7-4796-be97-79c2dcc751f1}</UniqueIdentifier>
</Filter>
<Filter Include="beast\insight\impl">
<UniqueIdentifier>{04f27818-7843-4ef3-967c-1761dc892342}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto">
<UniqueIdentifier>{9c1ef4c4-5623-4500-859f-12d6ce5ae362}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto\impl">
<UniqueIdentifier>{fc3d3f14-9ba1-43e4-b086-cbbd2f63b944}</UniqueIdentifier>
</Filter>
<Filter Include="beast\crypto\impl\sha2">
<UniqueIdentifier>{44489531-f44a-439a-a6ea-d32c252b1e8b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\modules\beast_core\beast_core.h">
<Filter>beast_core</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\AbstractFifo.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\Array.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
@@ -320,9 +326,6 @@
<ClInclude Include="..\..\modules\beast_core\containers\ScopedValueSetter.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\SortedSet.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\SparseSet.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
@@ -362,9 +365,6 @@
<ClInclude Include="..\..\modules\beast_core\maths\BigInteger.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\maths\Expression.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\maths\Random.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
@@ -377,12 +377,6 @@
<ClInclude Include="..\..\modules\beast_core\memory\OptionalScopedPointer.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\ScopedPointer.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\WeakReference.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\misc\Result.h">
<Filter>beast_core\misc</Filter>
</ClInclude>
@@ -407,9 +401,6 @@
<ClInclude Include="..\..\modules\beast_core\native\win32_ComSmartPtr.h">
<Filter>beast_core\native</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\network\IPAddress.h">
<Filter>beast_core\network</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\network\MACAddress.h">
<Filter>beast_core\network</Filter>
</ClInclude>
@@ -491,24 +482,6 @@
<ClInclude Include="..\..\modules\beast_core\threads\ScopedWriteLock.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\SpinLock.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\Thread.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\ThreadLocalValue.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\ThreadPool.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\TimeSliceThread.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\WaitableEvent.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\time\PerformanceCounter.h">
<Filter>beast_core\time</Filter>
</ClInclude>
@@ -569,66 +542,24 @@
<ClInclude Include="..\..\modules\beast_core\memory\MemoryAlignment.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\AtomicCounter.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\AtomicFlag.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\AtomicPointer.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\AtomicState.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\LockFreeQueue.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\SpinDelay.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\SharedTable.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\SortedLookupTable.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\FPUFlags.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\LeakChecked.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\Throw.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\maths\Interval.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\UnitTest.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_crypto\beast_crypto.h">
<Filter>beast_crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\SharedObjectArray.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\files\RandomAccessFile.h">
<Filter>beast_core\files</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\UnitTestUtilities.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\RecycledObjectPool.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_db\beast_db.h">
<Filter>beast_db</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_db\keyvalue\KeyvaDB.h">
<Filter>beast_db\keyvalue</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_sqlite\beast_sqlite.h">
<Filter>beast_sqlite</Filter>
</ClInclude>
@@ -698,9 +629,6 @@
<ClInclude Include="..\..\modules\beast_sqdb\detail\use_type.h">
<Filter>beast_sqdb\detail</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\maths\MurmurHash.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\text\LexicalCast.h">
<Filter>beast_core\text</Filter>
</ClInclude>
@@ -710,15 +638,9 @@
<ClInclude Include="..\..\modules\beast_core\maths\uint24.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\ContainerDeletePolicy.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\diagnostic\MeasureFunctionCallTime.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\threads\ReadWriteMutex.h">
<Filter>beast_core\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\MutexTraits.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
@@ -743,51 +665,12 @@
<ClInclude Include="..\..\modules\beast_core\thread\DeadlineTimer.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\CallQueue.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\InterruptibleThread.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\Listeners.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\ManualCallQueue.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\Semaphore.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\ThreadWithCallQueue.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\Workers.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\maths\Math.h">
<Filter>beast_core\maths</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\AllocatedBy.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStore.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStoreWithoutTLS.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\FifoFreeStoreWithTLS.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\GlobalFifoFreeStore.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\GlobalPagedFreeStore.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\PagedFreeStore.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h">
<Filter>beast_asio\sockets</Filter>
</ClInclude>
@@ -800,12 +683,6 @@
<ClInclude Include="..\..\modules\beast_asio\system\BoostIncludes.h">
<Filter>beast_asio\system</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_extras\traits\BoostLockableTraits.h">
<Filter>beast_extras\traits</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_extras\beast_extras.h">
<Filter>beast_extras</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\system\BeforeBoost.h">
<Filter>beast_core\system</Filter>
</ClInclude>
@@ -824,45 +701,6 @@
<ClInclude Include="..\..\modules\beast_core\system\SystemStats.h">
<Filter>beast_core\system</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\DynamicList.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\DynamicArray.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\containers\HashMap.h">
<Filter>beast_core\containers</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\intrusive\ForwardList.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\intrusive\PointerTraits.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\RemoveConst.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\RemoveConstVolatile.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\RemoveReference.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\RemoveVolatile.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\AddConst.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\PointerToOther.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\SharedPtr.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\SharedObject.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\async\ComposedAsyncOperation.h">
<Filter>beast_asio\async</Filter>
</ClInclude>
@@ -953,9 +791,6 @@
<ClInclude Include="..\..\modules\beast_asio\protocol\PrefilledReadStream.h">
<Filter>beast_asio\protocol</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\basics\ContentBodyBuffer.h">
<Filter>beast_asio\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\http\HTTPResponse.h">
<Filter>beast_asio\http</Filter>
</ClInclude>
@@ -980,15 +815,9 @@
<ClInclude Include="..\..\modules\beast_asio\http\HTTPParserImpl.h">
<Filter>beast_asio\http</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\IfCond.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\basics\BuffersType.h">
<Filter>beast_asio\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\basics\BufferType.h">
<Filter>beast_asio\basics</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\SharedSingleton.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
@@ -1001,24 +830,9 @@
<ClInclude Include="..\..\modules\beast_core\diagnostic\FatalError.h">
<Filter>beast_core\diagnostic</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\StaticObject.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_crypto\math\UnsignedInteger.h">
<Filter>beast_crypto\math</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_crypto\math\UnsignedIntegerCalc.h">
<Filter>beast_crypto\math</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_crypto\math\BinaryEncoding.h">
<Filter>beast_crypto\math</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\memory\SharedFunction.h">
<Filter>beast_core\memory</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\net\IPEndpoint.h">
<Filter>beast\net</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Config.h">
<Filter>beast</Filter>
</ClInclude>
@@ -1058,21 +872,6 @@
<ClInclude Include="..\..\beast\mpl\IsCallPossible.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Thread.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\thread\LockGuard.h">
<Filter>beast\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\thread\SharedLockGuard.h">
<Filter>beast\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\thread\SharedData.h">
<Filter>beast\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\thread\SharedMutexAdapter.h">
<Filter>beast\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Uncopyable.h">
<Filter>beast</Filter>
</ClInclude>
@@ -1094,15 +893,6 @@
<ClInclude Include="..\..\beast\intrusive\LockFreeStack.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\intrusive\List.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\mpl\CopyConst.h">
<Filter>beast\mpl</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\Stoppable.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\http\impl\http-parser\http_parser.h">
<Filter>beast\http\impl\http-parser</Filter>
</ClInclude>
@@ -1184,9 +974,6 @@
<ClInclude Include="..\..\beast\FixedArray.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\intrusive\IntrusiveArray.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Crypto.h">
<Filter>beast</Filter>
</ClInclude>
@@ -1202,9 +989,6 @@
<ClInclude Include="..\..\modules\beast_asio\async\AbstractHandler.h">
<Filter>beast_asio\async</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_core\thread\ServiceQueue.h">
<Filter>beast_core\thread</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Chrono.h">
<Filter>beast</Filter>
</ClInclude>
@@ -1257,11 +1041,209 @@
<ClInclude Include="..\..\beast\config\SelectStdlibConfig.h">
<Filter>beast\config</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\smart_ptr\ContainerDeletePolicy.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\smart_ptr\ScopedPointer.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\SmartPtr.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\net\DynamicBuffer.h">
<Filter>beast\net</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\net\BufferType.h">
<Filter>beast\net</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\http\HTTPRequestParser.h">
<Filter>beast_asio\http</Filter>
</ClInclude>
<ClInclude Include="..\..\modules\beast_asio\http\HTTPResponseParser.h">
<Filter>beast_asio\http</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\ScopedTimeInterval.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\CPUMeter.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\smart_ptr\SharedObject.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\smart_ptr\SharedPtr.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Threads.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\LockGuard.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\RecursiveMutex.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\ServiceQueue.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\SharedData.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\SharedLockGuard.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\SharedMutexAdapter.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\SpinLock.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\Thread.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\ThreadLocalValue.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\TryLockGuard.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\UnlockGuard.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\WaitableEvent.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\utility\LeakChecked.h">
<Filter>beast\utility</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\utility\StaticObject.h">
<Filter>beast\utility</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\Stoppable.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\detail\DispatchedHandler.h">
<Filter>beast\threads\detail</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\detail\BindHandler.h">
<Filter>beast\threads\detail</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\boost\ErrorCode.h">
<Filter>beast\boost</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Boost.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\utility\PropertyStream.h">
<Filter>beast\utility</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\ScopedWrapperContext.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\utility\BaseFromMember.h">
<Filter>beast\utility</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\net\IPAddress.h">
<Filter>beast\net</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Asio.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\asio\IPAddressConversion.h">
<Filter>beast\asio</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\crypto\MurmurHash.h">
<Filter>beast\crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\smart_ptr\AbstractObject.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Insight.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Collector.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Counter.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\CounterImpl.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Event.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\EventImpl.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Gauge.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\GaugeImpl.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Meter.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\MeterImpl.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\NullCollector.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\StatsDCollector.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\Hook.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\insight\HookImpl.h">
<Filter>beast\insight</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\cyclic_iterator.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\threads\semaphore.h">
<Filter>beast\threads</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\intrusive\List.h">
<Filter>beast\intrusive</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\crypto\BinaryEncoding.h">
<Filter>beast\crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\crypto\UnsignedInteger.h">
<Filter>beast\crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\crypto\UnsignedIntegerCalc.h">
<Filter>beast\crypto</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\abstract_clock.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\manual_clock.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\ratio_io.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\chrono_io.h">
<Filter>beast\chrono</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\utility\hash_pair.h">
<Filter>beast\utility</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\asio\io_latency_probe.h">
<Filter>beast\asio</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\make_unique.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\chrono\chrono_util.h">
<Filter>beast\chrono</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\modules\beast_core\containers\AbstractFifo.cpp">
<Filter>beast_core\containers</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\DynamicObject.cpp">
<Filter>beast_core\containers</Filter>
</ClCompile>
@@ -1304,9 +1286,6 @@
<ClCompile Include="..\..\modules\beast_core\maths\BigInteger.cpp">
<Filter>beast_core\maths</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\maths\Expression.cpp">
<Filter>beast_core\maths</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\maths\Random.cpp">
<Filter>beast_core\maths</Filter>
</ClCompile>
@@ -1364,9 +1343,6 @@
<ClCompile Include="..\..\modules\beast_core\native\win32_Threads.cpp">
<Filter>beast_core\native</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\network\IPAddress.cpp">
<Filter>beast_core\network</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\network\MACAddress.cpp">
<Filter>beast_core\network</Filter>
</ClCompile>
@@ -1424,15 +1400,6 @@
<ClCompile Include="..\..\modules\beast_core\threads\ReadWriteLock.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\Thread.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\ThreadPool.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\TimeSliceThread.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\time\PerformanceCounter.cpp">
<Filter>beast_core\time</Filter>
</ClCompile>
@@ -1502,9 +1469,6 @@
<ClCompile Include="..\..\modules\beast_core\diagnostic\FPUFlags.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\LeakChecked.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\SpinDelay.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
@@ -1523,12 +1487,6 @@
<ClCompile Include="..\..\modules\beast_core\diagnostic\UnitTestUtilities.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_db\beast_db.cpp">
<Filter>beast_db</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_db\keyvalue\KeyvaDB.cpp">
<Filter>beast_db\keyvalue</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_sqlite\beast_sqlite.c">
<Filter>beast_sqlite</Filter>
</ClCompile>
@@ -1574,57 +1532,21 @@
<ClCompile Include="..\..\modules\beast_sqdb\source\use_type.cpp">
<Filter>beast_sqdb\source</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\maths\MurmurHash.cpp">
<Filter>beast_core\maths</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\text\LexicalCast.cpp">
<Filter>beast_core\text</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\SemanticVersion.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\threads\ReadWriteMutex.cpp">
<Filter>beast_core\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\impl\TrackedMutex.cpp">
<Filter>beast_core\thread\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\DeadlineTimer.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\CallQueue.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\InterruptibleThread.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\Listeners.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\ManualCallQueue.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\Semaphore.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\ThreadWithCallQueue.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\Workers.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\FifoFreeStoreWithoutTLS.cpp">
<Filter>beast_core\memory</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\FifoFreeStoreWithTLS.cpp">
<Filter>beast_core\memory</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\GlobalPagedFreeStore.cpp">
<Filter>beast_core\memory</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\PagedFreeStore.cpp">
<Filter>beast_core\memory</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\basics\SSLContext.cpp">
<Filter>beast_asio\basics</Filter>
</ClCompile>
@@ -1634,15 +1556,6 @@
<ClCompile Include="..\..\modules\beast_core\system\SystemStats.cpp">
<Filter>beast_core\system</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\DynamicArray.cpp">
<Filter>beast_core\containers</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\DynamicList.cpp">
<Filter>beast_core\containers</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\containers\HashMap.cpp">
<Filter>beast_core\containers</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\async\SharedHandler.cpp">
<Filter>beast_asio\async</Filter>
</ClCompile>
@@ -1688,9 +1601,6 @@
<ClCompile Include="..\..\modules\beast_asio\protocol\HandshakeDetectLogicPROXY.cpp">
<Filter>beast_asio\protocol</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\basics\ContentBodyBuffer.cpp">
<Filter>beast_asio\basics</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\http\HTTPResponse.cpp">
<Filter>beast_asio\http</Filter>
</ClCompile>
@@ -1712,9 +1622,6 @@
<ClCompile Include="..\..\modules\beast_asio\http\HTTPParser.cpp">
<Filter>beast_asio\http</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_crypto\beast_crypto.cpp">
<Filter>beast_crypto</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\beast_core.cpp">
<Filter>beast_core</Filter>
</ClCompile>
@@ -1730,24 +1637,6 @@
<ClCompile Include="..\..\modules\beast_core\diagnostic\FatalError.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\memory\StaticObject.cpp">
<Filter>beast_core\memory</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\diagnostic\Assert.cpp">
<Filter>beast_core\diagnostic</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_crypto\math\UnsignedInteger.cpp">
<Filter>beast_crypto\math</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_crypto\math\BinaryEncoding.cpp">
<Filter>beast_crypto\math</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_extras\beast_extras.cpp">
<Filter>beast_extras</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\net\impl\IPEndpoint.cpp">
<Filter>beast\net\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\net\Net.cpp">
<Filter>beast\net</Filter>
</ClCompile>
@@ -1760,9 +1649,6 @@
<ClCompile Include="..\..\modules\beast_asio\http\HTTPRequest.cpp">
<Filter>beast_asio\http</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\Stoppable.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\http\impl\http-parser\http_parser.c">
<Filter>beast\http\impl\http-parser</Filter>
</ClCompile>
@@ -1811,9 +1697,6 @@
<ClCompile Include="..\..\beast\crypto\impl\Sha256.cpp">
<Filter>beast\crypto\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_core\thread\ServiceQueue.cpp">
<Filter>beast_core\thread</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\chrono\impl\RelativeTime.cpp">
<Filter>beast\chrono\impl</Filter>
</ClCompile>
@@ -1826,6 +1709,99 @@
<ClCompile Include="..\..\beast\utility\impl\Error.cpp">
<Filter>beast\utility\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\net\impl\DynamicBuffer.cpp">
<Filter>beast\net\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\http\HTTPRequestParser.cpp">
<Filter>beast_asio\http</Filter>
</ClCompile>
<ClCompile Include="..\..\modules\beast_asio\http\HTTPResponseParser.cpp">
<Filter>beast_asio\http</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\chrono\impl\CPUMeter.cpp">
<Filter>beast\chrono\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\smart_ptr\SmartPtr.cpp">
<Filter>beast\smart_ptr</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\Atomic.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\RecursiveMutex.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\ServiceQueue.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\WaitableEvent.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\Threads.cpp">
<Filter>beast\threads</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\Thread.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\utility\impl\LeakChecked.cpp">
<Filter>beast\utility\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\utility\impl\StaticObject.cpp">
<Filter>beast\utility\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\threads\impl\Stoppable.cpp">
<Filter>beast\threads\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\boost\Boost.cpp">
<Filter>beast\boost</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\utility\impl\PropertyStream.cpp">
<Filter>beast\utility\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\net\impl\IPAddress.cpp">
<Filter>beast\net\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\asio\Asio.cpp">
<Filter>beast\asio</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\asio\impl\IPAddressConversion.cpp">
<Filter>beast\asio\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\crypto\impl\MurmurHash.cpp">
<Filter>beast\crypto\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\smart_ptr\impl\AbstractObject.cpp">
<Filter>beast\smart_ptr\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\Insight.cpp">
<Filter>beast\insight</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\impl\Collector.cpp">
<Filter>beast\insight\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\impl\Metric.cpp">
<Filter>beast\insight\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\impl\NullCollector.cpp">
<Filter>beast\insight\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\impl\StatsDCollector.cpp">
<Filter>beast\insight\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\insight\impl\Hook.cpp">
<Filter>beast\insight\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\chrono\impl\abstract_clock.cpp">
<Filter>beast\chrono\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\chrono\impl\chrono_io.cpp">
<Filter>beast\chrono\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\crypto\impl\BinaryEncoding.cpp">
<Filter>beast\crypto\impl</Filter>
</ClCompile>
<ClCompile Include="..\..\beast\crypto\impl\UnsignedInteger.cpp">
<Filter>beast\crypto\impl</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\TODO.txt">

View File

@@ -2,13 +2,6 @@
BEAST TODO
--------------------------------------------------------------------------------
- Remove ReadWriteMutex and replace it with a CriticalSection
since the implementation is broken.
- Rewrite SharedData to work with a CriticalSection
- Use new file naming convention
- Use SemanticVersion for beast version numbers to replace BEAST_VERSION
- add support for a __PRETTY_FUNCTION__ equivalent for all environments
@@ -17,13 +10,6 @@ BEAST TODO
- Import secp256k1 from sipa
- HashMap work:
- Add unit test
- Return size_t from hash function, take out upperLimit, move mod % to caller
- Make hash function a functor using operator()
- Implement HardenedHashFunctions
- Fix problem with assigning to the result of operator[] maybe use a proxy?
- Set sqlite thread safety model to '2' in beast_sqlite
- Document and rename all the sqdb files and classes
@@ -60,16 +46,12 @@ BEAST TODO
- Rename malloc/calloc JUCE members that conflict with the debug CRT from MSVC
- Make beast::HashMap support assignment via operator[]
- Reformat every Doxygen comment
- Fix Doxygen metatags
- update Beast Doxyfile
- Rename include guards to boost style, e.g. BEAST_THROW_H_INCLUDED
- Decide if we should get rid of AtomicCounter, AtomicFlag, AtomicPointer, AtomicState
- Clean up CacheLine, StaticObject
- Clean up ConcurrentObject

View File

@@ -17,12 +17,9 @@
*/
//==============================================================================
#ifndef BEAST_THREAD_H_INCLUDED
#define BEAST_THREAD_H_INCLUDED
#ifndef BEAST_ASIO_H_INCLUDED
#define BEAST_ASIO_H_INCLUDED
#include "thread/LockGuard.h"
#include "thread/SharedLockGuard.h"
#include "thread/SharedMutexAdapter.h"
#include "thread/SharedData.h"
#include "asio/IPAddressConversion.h"
#endif

27
src/beast/beast/Boost.h Normal file
View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
/*
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_H_INCLUDED
#define BEAST_BOOST_H_INCLUDED
// These classes require boost in order to be used.
#include "boost/ErrorCode.h"
#endif

View File

@@ -20,6 +20,14 @@
#ifndef BEAST_CHRONO_H_INCLUDED
#define BEAST_CHRONO_H_INCLUDED
#include "chrono/abstract_clock.h"
#include "chrono/chrono_io.h"
#include "chrono/chrono_util.h"
#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

@@ -20,7 +20,11 @@
#ifndef BEAST_CRYPTO_H_INCLUDED
#define BEAST_CRYPTO_H_INCLUDED
#include "crypto/BinaryEncoding.h"
#include "crypto/MurmurHash.h"
#include "crypto/Sha256.h"
#include "crypto/UnsignedInteger.h"
#include "crypto/UnsignedIntegerCalc.h"
#endif

View File

@@ -139,7 +139,8 @@ bool operator!= (FixedArray <T, N> const& lhs, FixedArray <T, N> const& 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());
return std::lexicographical_compare (
lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
template <class T, std::size_t N>

View File

@@ -17,30 +17,19 @@
*/
//==============================================================================
#ifndef BEAST_MPL_IFCOND_H_INCLUDED
#define BEAST_MPL_IFCOND_H_INCLUDED
#ifndef BEAST_INSIGHT_H_INCLUDED
#define BEAST_INSIGHT_H_INCLUDED
namespace beast {
namespace mpl {
// Ideas based on boost
/** Select between T1 or T2 depending on Condition. */
/** @{ */
template <bool Condition, typename T1, typename T2>
struct IfCond
{
typedef T1 type;
};
template <typename T1, typename T2>
struct IfCond <false, T1, T2>
{
typedef T2 type;
};
/** @} */
}
}
#include "insight/Counter.h"
#include "insight/CounterImpl.h"
#include "insight/Event.h"
#include "insight/EventImpl.h"
#include "insight/Gauge.h"
#include "insight/GaugeImpl.h"
#include "insight/Hook.h"
#include "insight/HookImpl.h"
#include "insight/Collector.h"
#include "insight/NullCollector.h"
#include "insight/StatsDCollector.h"
#endif

View File

@@ -20,8 +20,6 @@
#ifndef BEAST_INTRUSIVE_H_INCLUDED
#define BEAST_INTRUSIVE_H_INCLUDED
#include "intrusive/ForwardList.h"
#include "intrusive/IntrusiveArray.h"
#include "intrusive/List.h"
#include "intrusive/LockFreeStack.h"

View File

@@ -20,14 +20,6 @@
#ifndef BEAST_MPL_H_INCLUDED
#define BEAST_MPL_H_INCLUDED
#include "mpl/AddConst.h"
#include "mpl/CopyConst.h"
#include "mpl/IfCond.h"
#include "mpl/IsCallPossible.h"
#include "mpl/PointerToOther.h"
#include "mpl/RemoveConst.h"
#include "mpl/RemoveConstVolatile.h"
#include "mpl/RemoveReference.h"
#include "mpl/RemoveVolatile.h"
#endif

View File

@@ -27,6 +27,7 @@
#include <cstring>
#include "Config.h"
#include "Uncopyable.h"
namespace beast {

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_NET_H_INCLUDED
#define BEAST_NET_H_INCLUDED
#include "net/IPEndpoint.h"
#include "net/BufferType.h"
#include "net/DynamicBuffer.h"
#include "net/IPAddress.h"
#endif

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
/*
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_SMARTPTR_H_INCLUDED
#define BEAST_SMARTPTR_H_INCLUDED
#include "Config.h"
#include "smart_ptr/AbstractObject.h"
#include "smart_ptr/ContainerDeletePolicy.h"
#include "smart_ptr/SharedObject.h"
#include "smart_ptr/SharedPtr.h"
#include "smart_ptr/ScopedPointer.h"
#endif

39
src/beast/beast/Threads.h Normal file
View File

@@ -0,0 +1,39 @@
//------------------------------------------------------------------------------
/*
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_THREADS_H_INCLUDED
#define BEAST_THREADS_H_INCLUDED
#include "threads/LockGuard.h"
#include "threads/UnlockGuard.h"
#include "threads/TryLockGuard.h"
#include "threads/SharedLockGuard.h"
#include "threads/SharedMutexAdapter.h"
#include "threads/SharedData.h"
#include "threads/ServiceQueue.h"
#include "threads/SpinLock.h"
#include "threads/Stoppable.h"
#include "threads/Thread.h"
#include "threads/ThreadLocalValue.h"
#include "threads/WaitableEvent.h"
#include "threads/ScopedWrapperContext.h"
#include "threads/semaphore.h"
#endif

View File

@@ -20,10 +20,16 @@
#ifndef BEAST_UTILITY_H_INCLUDED
#define BEAST_UTILITY_H_INCLUDED
#include "utility/BaseFromMember.h"
#include "utility/Debug.h"
#include "utility/EnableIf.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

@@ -19,11 +19,4 @@
#include "BeastConfig.h"
#include "beast_extras.h"
namespace beast
{
}
#include "impl/IPAddressConversion.cpp"

View File

@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
/*
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_IPADDRESSCONVERSION_H_INCLUDED
#define BEAST_ASIO_IPADDRESSCONVERSION_H_INCLUDED
#include "../net/IPAddress.h"
#include <sstream>
#include <boost/asio.hpp>
namespace beast {
struct IPAddressConversion
{
/** Convert to IPAddress.
The port is set to zero.
*/
static IPAddress from_asio (boost::asio::ip::address const& address);
/** Convert to IPAddress, including port. */
static IPAddress from_asio (boost::asio::ip::tcp::endpoint const& endpoint);
/** Convert to asio::ip::address.
The port is ignored.
*/
static boost::asio::ip::address to_asio_address (IPAddress const& address);
/** Convert to asio::ip::tcp::endpoint. */
static boost::asio::ip::tcp::endpoint to_asio_endpoint (IPAddress const& address);
/** Conversions to string. */
/** @{ */
static std::string to_string (boost::asio::ip::tcp::endpoint const& endpoint)
{
std::stringstream ss;
ss << endpoint;
return ss.str();
}
/** @} */
};
}
#endif

View File

@@ -0,0 +1,65 @@
//------------------------------------------------------------------------------
/*
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 "../IPAddressConversion.h"
namespace beast {
IPAddress IPAddressConversion::from_asio (boost::asio::ip::address const& address)
{
if (address.is_v4 ())
{
boost::asio::ip::address_v4::bytes_type const bytes (
address.to_v4().to_bytes());
return IPAddress (IPAddress::V4 (
bytes [0], bytes [1], bytes [2], bytes [3]));
}
// VFALCO TODO IPv6 support
bassertfalse;
return IPAddress();
}
IPAddress IPAddressConversion::from_asio (boost::asio::ip::tcp::endpoint const& endpoint)
{
return from_asio (endpoint.address()).withPort (endpoint.port());
}
boost::asio::ip::address IPAddressConversion::to_asio_address (IPAddress const& address)
{
if (address.isV4 ())
{
return boost::asio::ip::address (
boost::asio::ip::address_v4 (
address.v4().value));
}
// VFALCO TODO IPv6 support
bassertfalse;
return boost::asio::ip::address (
boost::asio::ip::address_v6 ());
}
boost::asio::ip::tcp::endpoint IPAddressConversion::to_asio_endpoint (IPAddress const& address)
{
return boost::asio::ip::tcp::endpoint (
to_asio_address (address), address.port());
}
}

View File

@@ -0,0 +1,245 @@
//------------------------------------------------------------------------------
/*
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_IO_LATENCY_PROBE_H_INCLUDED
#define BEAST_ASIO_IO_LATENCY_PROBE_H_INCLUDED
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <stdexcept>
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/config.hpp>
namespace beast {
/** Measures handler latency on an io_service queue. */
template <class Clock>
class io_latency_probe
{
private:
typedef typename Clock::duration duration;
typedef typename Clock::time_point time_point;
std::recursive_mutex m_mutex;
std::condition_variable_any m_cond;
std::size_t m_count;
duration const m_period;
boost::asio::io_service& m_ios;
boost::asio::deadline_timer m_timer;
bool m_cancel;
public:
io_latency_probe (duration const& period,
boost::asio::io_service& ios)
: m_count (1)
, m_period (period)
, m_ios (ios)
, m_timer (m_ios)
, m_cancel (false)
{
}
~io_latency_probe ()
{
std::unique_lock <decltype (m_mutex)> lock (m_mutex);
cancel (lock, true);
}
/** Return the io_service associated with the latency probe. */
/** @{ */
boost::asio::io_service& get_io_service ()
{
return m_ios;
}
boost::asio::io_service const& get_io_service () const
{
return m_ios;
}
/** @} */
/** Cancel all pending i/o.
Any handlers which have already been queued will still be called.
*/
/** @{ */
void cancel ()
{
std::unique_lock <decltype(m_mutex)> lock (m_mutex);
cancel (lock, true);
}
void cancel_async ()
{
std::unique_lock <decltype(m_mutex)> lock (m_mutex);
cancel (lock, false);
}
/** @} */
/** Measure one sample of i/o latency.
Handler will be called with this signature:
void Handler (Duration d);
*/
template <class Handler>
void sample_one (Handler&& handler)
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
if (m_cancel)
throw std::logic_error ("io_latency_probe is canceled");
m_ios.post (sample_op <Handler> (
std::forward <Handler> (handler),
Clock::now(), false, this));
}
/** Initiate continuous i/o latency sampling.
Handler will be called with this signature:
void Handler (std::chrono::milliseconds);
*/
template <class Handler>
void sample (Handler&& handler)
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
if (m_cancel)
throw std::logic_error ("io_latency_probe is canceled");
m_ios.post (sample_op <Handler> (
std::forward <Handler> (handler),
Clock::now(), true, this));
}
private:
void cancel (std::unique_lock <decltype (m_mutex)>& lock,
bool wait)
{
if (! m_cancel)
{
--m_count;
m_cancel = true;
}
if (wait)
#ifdef BOOST_NO_CXX11_LAMBDAS
while (m_count != 0)
m_cond.wait (lock);
#else
m_cond.wait (lock, [this] {
return this->m_count == 0; });
#endif
}
void addref ()
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
++m_count;
}
void release ()
{
std::lock_guard <decltype(m_mutex)> lock (m_mutex);
if (--m_count == 0)
m_cond.notify_all ();
}
template <class Handler>
struct sample_op
{
Handler m_handler;
time_point m_start;
bool m_repeat;
io_latency_probe* m_probe;
sample_op (Handler const& handler, time_point const& start,
bool repeat, io_latency_probe* probe)
: m_handler (handler)
, m_start (start)
, m_repeat (repeat)
, m_probe (probe)
{
m_probe->addref();
}
sample_op (sample_op const& other)
: m_handler (other.m_handler)
, m_start (other.m_start)
, m_probe (other.m_probe)
{
m_probe->addref();
}
~sample_op ()
{
m_probe->release();
}
void operator() () const
{
typename Clock::time_point const now (Clock::now());
typename Clock::duration const elapsed (now - m_start);
m_handler (elapsed);
{
std::lock_guard <decltype (m_probe->m_mutex)
> lock (m_probe->m_mutex);
if (m_probe->m_cancel)
return;
}
if (m_repeat)
{
// Calculate when we want to sample again, and
// adjust for the expected latency.
//
typename Clock::time_point const when (
now + m_probe->m_period - 2 * elapsed);
if (when <= now)
{
// The latency is too high to maintain the desired
// period so don't bother with a timer.
//
m_probe->m_ios.post (sample_op <Handler> (
m_handler, now, m_repeat, m_probe));
}
else
{
boost::posix_time::microseconds mms (
std::chrono::duration_cast <
std::chrono::microseconds> (
when - now).count ());
m_probe->m_timer.expires_from_now (mms);
m_probe->m_timer.async_wait (sample_op <Handler> (
m_handler, now, m_repeat, m_probe));
}
}
}
void operator () (boost::system::error_code const& ec)
{
typename Clock::time_point const now (Clock::now());
m_probe->m_ios.post (sample_op <Handler> (
m_handler, now, m_repeat, m_probe));
}
};
};
}
#endif

View File

@@ -19,12 +19,12 @@
#include "BeastConfig.h"
#include "beast_crypto.h"
#include "ErrorCode.h"
namespace beast
{
namespace detail {
#include "math/BinaryEncoding.cpp"
#include "math/UnsignedInteger.cpp"
// to squelch linker warnings
int boostUnusedVariable = 0;
}

View File

@@ -17,30 +17,19 @@
*/
//==============================================================================
#ifndef BEAST_MPL_REMOVEREFERENCE_H_INCLUDED
#define BEAST_MPL_REMOVEREFERENCE_H_INCLUDED
#ifndef BEAST_BOOST_ERRORCODE_H_INCLUDED
#define BEAST_BOOST_ERRORCODE_H_INCLUDED
#include <boost/system/error_code.hpp>
namespace beast {
namespace mpl {
// Ideas based on boost
// Lift this into our namespace. For now we will
// use boost, and then switch to std::error_code when
// it is available on all our supported platforms.
//
typedef boost::system::error_code ErrorCode;
/** Remove the reference qualifier from a type. */
/** @{ */
template <class T>
struct RemoveReference
{
typedef T type;
};
template <class T>
struct RemoveReference <T&>
{
typedef T type;
};
/** @} */
}
}
#endif

View File

@@ -0,0 +1,159 @@
//------------------------------------------------------------------------------
/*
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

@@ -19,4 +19,11 @@
#include "BeastConfig.h"
#include "../Config.h"
#include "../../modules/beast_core/beast_core.h" // for UnitTest
#include "impl/abstract_clock.cpp"
#include "impl/chrono_io.cpp"
#include "impl/CPUMeter.cpp"
#include "impl/RelativeTime.cpp"

View File

@@ -43,13 +43,22 @@ namespace beast {
class BEAST_API RelativeTime
{
public:
//==============================================================================
/** The underlying data type used by RelativeTime.
If you need to get to the underlying time and manipulate it
you can use this to declare a type that is guaranteed to
work cleanly.
*/
typedef double value_type;
//==============================================================================
/** Creates a RelativeTime.
@param seconds the number of seconds, which may be +ve or -ve.
@see milliseconds, minutes, hours, days, weeks
*/
explicit RelativeTime (double seconds = 0.0) noexcept;
explicit RelativeTime (value_type seconds = 0.0) noexcept;
/** Copies another relative time. */
RelativeTime (const RelativeTime& other) noexcept;
@@ -60,6 +69,12 @@ public:
/** Destructor. */
~RelativeTime() noexcept;
bool isZero() const
{ return numSeconds == 0; }
bool isNotZero() const
{ return numSeconds != 0; }
/** Returns the amount of time since the process was started. */
static RelativeTime fromStartup ();
@@ -77,27 +92,27 @@ public:
/** Creates a new RelativeTime object representing a number of seconds.
@see milliseconds, minutes, hours, days, weeks
*/
static RelativeTime seconds (double seconds) noexcept;
static RelativeTime seconds (value_type seconds) noexcept;
/** Creates a new RelativeTime object representing a number of minutes.
@see milliseconds, hours, days, weeks
*/
static RelativeTime minutes (double numberOfMinutes) noexcept;
static RelativeTime minutes (value_type numberOfMinutes) noexcept;
/** Creates a new RelativeTime object representing a number of hours.
@see milliseconds, minutes, days, weeks
*/
static RelativeTime hours (double numberOfHours) noexcept;
static RelativeTime hours (value_type numberOfHours) noexcept;
/** Creates a new RelativeTime object representing a number of days.
@see milliseconds, minutes, hours, weeks
*/
static RelativeTime days (double numberOfDays) noexcept;
static RelativeTime days (value_type numberOfDays) noexcept;
/** Creates a new RelativeTime object representing a number of weeks.
@see milliseconds, minutes, hours, days
*/
static RelativeTime weeks (double numberOfWeeks) noexcept;
static RelativeTime weeks (value_type numberOfWeeks) noexcept;
//==============================================================================
/** Returns the number of milliseconds this time represents.
@@ -108,27 +123,27 @@ public:
/** Returns the number of seconds this time represents.
@see inMilliseconds, inMinutes, inHours, inDays, inWeeks
*/
double inSeconds() const noexcept { return numSeconds; }
value_type inSeconds() const noexcept { return numSeconds; }
/** Returns the number of minutes this time represents.
@see inMilliseconds, inSeconds, inHours, inDays, inWeeks
*/
double inMinutes() const noexcept;
value_type inMinutes() const noexcept;
/** Returns the number of hours this time represents.
@see inMilliseconds, inSeconds, inMinutes, inDays, inWeeks
*/
double inHours() const noexcept;
value_type inHours() const noexcept;
/** Returns the number of days this time represents.
@see inMilliseconds, inSeconds, inMinutes, inHours, inWeeks
*/
double inDays() const noexcept;
value_type inDays() const noexcept;
/** Returns the number of weeks this time represents.
@see inMilliseconds, inSeconds, inMinutes, inHours, inDays
*/
double inWeeks() const noexcept;
value_type inWeeks() const noexcept;
/** Returns a readable textual description of the time.
@@ -148,10 +163,12 @@ public:
String getDescription (const String& returnValueForZeroTime = "0") const;
std::string to_string () const;
RelativeTime operator+ (double seconds) const noexcept
template <typename Number>
RelativeTime operator+ (Number seconds) const noexcept
{ return RelativeTime (numSeconds + seconds); }
RelativeTime operator- (double seconds) const noexcept
template <typename Number>
RelativeTime operator- (Number seconds) const noexcept
{ return RelativeTime (numSeconds - seconds); }
/** Adds another RelativeTime to this one. */
@@ -161,13 +178,13 @@ public:
RelativeTime operator-= (RelativeTime timeToSubtract) noexcept;
/** Adds a number of seconds to this time. */
RelativeTime operator+= (double secondsToAdd) noexcept;
RelativeTime operator+= (value_type secondsToAdd) noexcept;
/** Subtracts a number of seconds from this time. */
RelativeTime operator-= (double secondsToSubtract) noexcept;
RelativeTime operator-= (value_type secondsToSubtract) noexcept;
private:
double numSeconds;
value_type numSeconds;
};
//------------------------------------------------------------------------------

View File

@@ -17,47 +17,46 @@
*/
//==============================================================================
#ifndef BEAST_GLOBALFIFOFREESTORE_H_INCLUDED
#define BEAST_GLOBALFIFOFREESTORE_H_INCLUDED
#ifndef BEAST_CHRONO_SCOPEDTIMEINTERVAL_H_INCLUDED
#define BEAST_CHRONO_SCOPEDTIMEINTERVAL_H_INCLUDED
/*============================================================================*/
/**
A @ref FifoFreeStoreType singleton.
#include "../Uncopyable.h"
#include "RelativeTime.h"
@ingroup beast_concurrent
namespace beast {
/** Time measurement using scoped RAII container.
UnaryFunction will be called with this signature:
void (RelativeTime const& interval);
*/
template <class Tag>
class GlobalFifoFreeStore
template <class UnaryFunction>
class ScopedTimeInterval : public Uncopyable
{
public:
inline void* allocate (size_t bytes)
{
return m_allocator.allocate (bytes);
}
static inline void deallocate (void* const p)
{
FifoFreeStoreType::deallocate (p);
}
typedef SharedPtr <SharedSingleton <GlobalFifoFreeStore> > Ptr;
static Ptr getInstance ()
{
return SharedSingleton <GlobalFifoFreeStore>::getInstance();
}
public:
GlobalFifoFreeStore ()
/** Create the measurement with a default-constructed UnaryFunction. */
ScopedTimeInterval ()
: m_start (RelativeTime::fromStartup())
{
}
~GlobalFifoFreeStore ()
/** Create the measurement with UnaryFunction constructed from one argument. */
template <typename Arg>
explicit ScopedTimeInterval (Arg& arg)
: m_func (arg)
, m_start (RelativeTime::fromStartup ())
{
}
~ScopedTimeInterval ()
{
m_func (RelativeTime::fromStartup() - m_start);
}
private:
FifoFreeStoreType m_allocator;
UnaryFunction m_func;
RelativeTime m_start;
};
}
#endif

View File

@@ -0,0 +1,166 @@
//------------------------------------------------------------------------------
/*
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_ABSTRACT_CLOCK_H_INCLUDED
#define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
#include <chrono>
#include "chrono_io.h"
namespace beast {
/** Abstract interface to a clock.
The abstract clock interface allows a dependency injection to take
place so that the choice of implementation can be made at run-time
instead of compile time. The trade-off is that the Duration used to
represent the clock must be chosen at compile time and cannot be
changed. This includes both the choice of representation (integers
for example) and the period in ticks corresponding to one second.
Example:
@code
struct Implementation
{
abstract_clock <std::chrono::seconds>& m_clock;
// Dependency injection
//
explicit Implementation (
abstract_clock <std::chrono::seconds>& clock)
: m_clock (clock)
{
}
};
@endcode
@tparam The length of time, in seconds, corresponding to one tick.
*/
template <class Duration>
class abstract_clock
{
public:
typedef typename Duration::rep rep;
typedef typename Duration::period period;
typedef Duration duration;
typedef std::chrono::time_point <
abstract_clock, duration> time_point;
virtual ~abstract_clock () { }
/** Returns `true` if this is a steady clock. */
virtual bool is_steady () const = 0;
/** Returns the current time. */
virtual time_point now () = 0;
/** Convert the specified time point to a string. */
/** @{ */
virtual std::string to_string (time_point const& tp) = 0;
template <class Duration2>
std::string to_string (
std::chrono::time_point <abstract_clock, Duration2> const& tp)
{
return to_string (
std::chrono::time_point_cast <Duration> (tp));
}
/** @} */
/** Returning elapsed ticks since the epoch. */
rep elapsed ()
{
return now().time_since_epoch().count();
}
};
//------------------------------------------------------------------------------
namespace detail {
template <class TrivialClock, class Duration>
struct basic_abstract_clock_wrapper : public abstract_clock <Duration>
{
using typename abstract_clock <Duration>::duration;
using typename abstract_clock <Duration>::time_point;
bool is_steady () const
{
return TrivialClock::is_steady;
}
time_point now ()
{
return time_point (duration (
std::chrono::duration_cast <duration> (
TrivialClock::now().time_since_epoch ()).count ()));
}
};
template <class TrivialClock, class Duration>
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)
{
std::stringstream ss;
ss << tp.time_since_epoch();
return ss.str ();
}
};
/*
template <class Duration>
struct abstract_clock_wrapper <std::chrono::system_clock, Duration>
: public basic_abstract_clock_wrapper <std::chrono::system_clock, Duration>
{
typedef std::chrono::system_clock clock_type;
std::string to_string (time_point const& tp)
{
std::stringstream ss;
ss << clock_type::time_point (tp.time_since_epoch ());
return ss.str ();
}
};
*/
}
//------------------------------------------------------------------------------
/** Retrieve a discrete clock for a type implementing the Clock concept.
The interface is created as an object with static storage duration.
*/
template <class TrivialClock, class Duration>
abstract_clock <Duration>& get_abstract_clock ()
{
static detail::abstract_clock_wrapper <
TrivialClock, Duration> clock;
return clock;
}
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
//------------------------------------------------------------------------------
/*
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_UTIL_H_INCLUDED
#define BEAST_CHRONO_UTIL_H_INCLUDED
// From Howard Hinnant
// http://home.roadrunner.com/~hinnant/duration_io/chrono_util.html
// round down
template <class To, class Rep, class Period>
To floor(std::chrono::duration <Rep, Period> const& d)
{
To t = std::chrono::duration_cast<To>(d);
if (t > d)
--t;
return t;
}
// round to nearest, to even on tie
template <class To, class Rep, class Period>
To round (std::chrono::duration <Rep, Period> const& d)
{
To t0 = std::chrono::duration_cast<To>(d);
To t1 = t0;
++t1;
auto diff0 = d - t0;
auto diff1 = t1 - d;
if (diff0 == diff1)
{
if (t0.count() & 1)
return t1;
return t0;
}
else if (diff0 < diff1)
return t0;
return t1;
}
// round up
template <class To, class Rep, class Period>
To ceil (std::chrono::duration <Rep, Period> const& d)
{
To t = std::chrono::duration_cast<To>(d);
if (t < d)
++t;
return t;
}
#endif

View File

@@ -0,0 +1,21 @@
//------------------------------------------------------------------------------
/*
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 "../CPUMeter.h"

View File

@@ -35,7 +35,7 @@
namespace beast {
RelativeTime::RelativeTime (const double secs) noexcept
RelativeTime::RelativeTime (const RelativeTime::value_type secs) noexcept
: numSeconds (secs)
{
}
@@ -59,27 +59,27 @@ RelativeTime RelativeTime::milliseconds (const int64 milliseconds) noexcept
return RelativeTime (milliseconds * 0.001);
}
RelativeTime RelativeTime::seconds (double s) noexcept
RelativeTime RelativeTime::seconds (RelativeTime::value_type s) noexcept
{
return RelativeTime (s);
}
RelativeTime RelativeTime::minutes (const double numberOfMinutes) noexcept
RelativeTime RelativeTime::minutes (const RelativeTime::value_type numberOfMinutes) noexcept
{
return RelativeTime (numberOfMinutes * 60.0);
}
RelativeTime RelativeTime::hours (const double numberOfHours) noexcept
RelativeTime RelativeTime::hours (const RelativeTime::value_type numberOfHours) noexcept
{
return RelativeTime (numberOfHours * (60.0 * 60.0));
}
RelativeTime RelativeTime::days (const double numberOfDays) noexcept
RelativeTime RelativeTime::days (const RelativeTime::value_type numberOfDays) noexcept
{
return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0));
}
RelativeTime RelativeTime::weeks (const double numberOfWeeks) noexcept
RelativeTime RelativeTime::weeks (const RelativeTime::value_type numberOfWeeks) noexcept
{
return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0));
}
@@ -91,22 +91,22 @@ int64 RelativeTime::inMilliseconds() const noexcept
return (int64) (numSeconds * 1000.0);
}
double RelativeTime::inMinutes() const noexcept
RelativeTime::value_type RelativeTime::inMinutes() const noexcept
{
return numSeconds / 60.0;
}
double RelativeTime::inHours() const noexcept
RelativeTime::value_type RelativeTime::inHours() const noexcept
{
return numSeconds / (60.0 * 60.0);
}
double RelativeTime::inDays() const noexcept
RelativeTime::value_type RelativeTime::inDays() const noexcept
{
return numSeconds / (60.0 * 60.0 * 24.0);
}
double RelativeTime::inWeeks() const noexcept
RelativeTime::value_type RelativeTime::inWeeks() const noexcept
{
return numSeconds / (60.0 * 60.0 * 24.0 * 7.0);
}
@@ -125,12 +125,12 @@ RelativeTime RelativeTime::operator-= (RelativeTime t) noexcept
numSeconds -= t.numSeconds; return *this;
}
RelativeTime RelativeTime::operator+= (const double secs) noexcept
RelativeTime RelativeTime::operator+= (const RelativeTime::value_type secs) noexcept
{
numSeconds += secs; return *this;
}
RelativeTime RelativeTime::operator-= (const double secs) noexcept
RelativeTime RelativeTime::operator-= (const RelativeTime::value_type secs) noexcept
{
numSeconds -= secs; return *this;
}
@@ -256,71 +256,126 @@ std::string RelativeTime::to_string () const
}
}
#if BEAST_WINDOWS
#include <Windows.h>
#include <windows.h>
namespace beast {
namespace detail {
RelativeTime RelativeTime::fromStartup ()
static double monotonicCurrentTimeInSeconds()
{
ULONGLONG ticks (GetTickCount64());
return RelativeTime (ticks / 1000.0);
return GetTickCount64() / 1000.0;
}
}
}
#elif BEAST_MAC || BEAST_IOS
#include <mach/mach_time.h>
#include <mach/mach.h>
namespace beast {
namespace detail {
static double monotonicCurrentTimeInSeconds()
{
struct StaticInitializer
{
StaticInitializer ()
{
double numerator;
double denominator;
mach_timebase_info_data_t timebase;
(void) mach_timebase_info (&timebase);
if (timebase.numer % 1000000 == 0)
{
numerator = timebase.numer / 1000000.0;
denominator = timebase.denom * 1000.0;
}
else
{
numerator = timebase.numer;
// VFALCO NOTE I don't understand this code
//denominator = timebase.denom * (uint64) 1000000 * 1000.0;
denominator = timebase.denom * 1000000000.0;
}
ratio = numerator / denominator;
}
double ratio;
};
static StaticInitializer const data;
return mach_absolute_time() * data.ratio;
}
}
}
#else
#include <time.h>
namespace beast {
namespace detail {
// Converts a timespec to a RelativeTme
static RelativeTime toRelativeTime (timespec const& ts)
static double monotonicCurrentTimeInSeconds()
{
return RelativeTime (ts.tv_sec +
ts.tv_nsec / 1000000000.0);
timespec t;
clock_gettime (CLOCK_MONOTONIC, &t);
return t.tv_sec + t.tv_nsec / 1000000000.0;
}
}
}
#endif
namespace beast {
namespace detail {
// Records and returns the time from process startup
static RelativeTime getStartupTime()
static double getStartupTime()
{
struct StartupTime
{
StartupTime ()
{ clock_gettime (CLOCK_MONOTONIC, &ts); }
timespec ts;
};
struct StaticInitializer
{
StaticInitializer ()
{
when = detail::monotonicCurrentTimeInSeconds();
}
double when;
};
static StartupTime startupTime;
static StaticInitializer const data;
return toRelativeTime (startupTime.ts);
return data.when;
}
// Used to call getStartupTime as early as possible
struct StartupTimeStaticInitializer
{
StartupTimeStaticInitializer ()
{ getStartupTime(); }
StartupTimeStaticInitializer ()
{
getStartupTime();
}
};
static StartupTimeStaticInitializer startupTimeStaticInitializer;
}
RelativeTime RelativeTime::fromStartup ()
{
timespec ts;
clock_gettime (CLOCK_MONOTONIC, &ts);
return detail::toRelativeTime (ts) - detail::getStartupTime();
return RelativeTime (
detail::monotonicCurrentTimeInSeconds() - detail::getStartupTime());
}
}
#endif

View File

@@ -0,0 +1,98 @@
//------------------------------------------------------------------------------
/*
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_clock.h"
#include "../manual_clock.h"
#include <thread>
#include <string>
#include <sstream>
namespace beast {
class abstract_clock_tests : public UnitTest
{
public:
void test (abstract_clock <std::chrono::seconds>& c)
{
{
auto const t1 (c.now ());
std::this_thread::sleep_for (
std::chrono::milliseconds (1500));
auto const t2 (c.now ());
std::stringstream ss;
ss <<
"t1= " << c.to_string (t1) <<
", t2= " << c.to_string (t2) <<
", elapsed= " << (t2 - t1);
logMessage (ss.str());
}
}
void test_manual ()
{
typedef manual_clock <std::chrono::seconds> clock_type;
clock_type c;
std::stringstream ss;
ss << "now() = " << c.to_string (c.now ()) << std::endl;
c.set (clock_type::time_point (std::chrono::seconds (1)));
ss << "now() = " << c.to_string (c.now ()) << std::endl;
c.set (clock_type::time_point (std::chrono::seconds (2)));
ss << "now() = " << c.to_string (c.now ()) << std::endl;
logMessage (ss.str());
}
void runTest ()
{
beginTestCase ("Syntax");
logMessage ("steady_clock");
test (get_abstract_clock <std::chrono::steady_clock,
std::chrono::seconds> ());
logMessage ("system_clock");
test (get_abstract_clock <std::chrono::system_clock,
std::chrono::seconds> ());
logMessage ("high_resolution_clock");
test (get_abstract_clock <std::chrono::high_resolution_clock,
std::chrono::seconds> ());
logMessage ("manual_clock");
test_manual ();
pass ();
}
abstract_clock_tests ()
: UnitTest ("abstract_clock", "beast", runManual)
{
}
};
static abstract_clock_tests abstract_clock_tests_;
}

View File

@@ -17,27 +17,25 @@
*/
//==============================================================================
namespace
{
// Size of a page
// chrono_io
//
static const size_t globalPageBytes = 8 * 1024;
// (C) Copyright Howard Hinnant
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
}
#include "../chrono_io.h"
GlobalPagedFreeStore::GlobalPagedFreeStore ()
: m_allocator (globalPageBytes)
//_LIBCPP_BEGIN_NAMESPACE_STD
namespace std {
namespace chrono
{
locale::id
durationpunct::id;
} // chrono
//_LIBCPP_END_NAMESPACE_STD
}
GlobalPagedFreeStore::~GlobalPagedFreeStore ()
{
}
GlobalPagedFreeStore::Ptr GlobalPagedFreeStore::getInstance ()
{
return SharedSingleton <GlobalPagedFreeStore>::getInstance();
}

View File

@@ -0,0 +1,92 @@
//------------------------------------------------------------------------------
/*
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_MANUAL_CLOCK_H_INCLUDED
#define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
#include "abstract_clock.h"
namespace beast {
/** Manual clock implementation.
This concrete class implements the @ref abstract_clock interface and
allows the time to be advanced manually, mainly for the purpose of
providing a clock in unit tests.
@tparam The length of time, in seconds, corresponding to one tick.
*/
template <class Duration, bool IsSteady = true>
class manual_clock : public abstract_clock <Duration>
{
public:
using typename abstract_clock <Duration>::rep;
using typename abstract_clock <Duration>::duration;
using typename abstract_clock <Duration>::time_point;
explicit manual_clock (time_point const& t = time_point (Duration (0)))
: m_now (t)
{
}
bool is_steady () const
{
return IsSteady;
}
time_point now ()
{
return m_now;
}
std::string to_string (time_point const& tp)
{
std::stringstream ss;
ss << tp.time_since_epoch() << " from start";
return ss.str ();
}
/** Set the current time of the manual clock.
Precondition:
! IsSteady || t > now()
*/
void set (time_point const& t)
{
//if (IsSteady)
m_now = t;
}
/** Convenience for setting the time using a duration in @ref rep units. */
void set (rep v)
{
set (time_point (duration (v)));
}
/** Convenience for advancing the clock by one. */
manual_clock& operator++ ()
{
m_now += duration (1);
return *this;
}
private:
time_point m_now;
};
}
#endif

View File

@@ -0,0 +1,622 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
// ratio_io
//
// (C) Copyright Howard Hinnant
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#ifndef BEAST_CHRONO_RATIO_IO_H_INCLUDED
#define BEAST_CHRONO_RATIO_IO_H_INCLUDED
/*
ratio_io synopsis
#include <ratio>
#include <string>
namespace std
{
template <class Ratio, class charT>
struct ratio_string
{
static basic_string<charT> symbol();
static basic_string<charT> prefix();
};
} // std
*/
#include <ratio>
#include <string>
#include <sstream>
//_LIBCPP_BEGIN_NAMESPACE_STD
namespace std {
template <class _Ratio, class _CharT>
struct ratio_string
{
static basic_string<_CharT> symbol() {return prefix();}
static basic_string<_CharT> prefix();
};
template <class _Ratio, class _CharT>
basic_string<_CharT>
ratio_string<_Ratio, _CharT>::prefix()
{
basic_ostringstream<_CharT> __os;
__os << _CharT('[') << _Ratio::num << _CharT('/')
<< _Ratio::den << _CharT(']');
return __os.str();
}
// atto
template <>
struct ratio_string<atto, char>
{
static string symbol() {return string(1, 'a');}
static string prefix() {return string("atto");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<atto, char16_t>
{
static u16string symbol() {return u16string(1, u'a');}
static u16string prefix() {return u16string(u"atto");}
};
template <>
struct ratio_string<atto, char32_t>
{
static u32string symbol() {return u32string(1, U'a');}
static u32string prefix() {return u32string(U"atto");}
};
#endif
template <>
struct ratio_string<atto, wchar_t>
{
static wstring symbol() {return wstring(1, L'a');}
static wstring prefix() {return wstring(L"atto");}
};
// femto
template <>
struct ratio_string<femto, char>
{
static string symbol() {return string(1, 'f');}
static string prefix() {return string("femto");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<femto, char16_t>
{
static u16string symbol() {return u16string(1, u'f');}
static u16string prefix() {return u16string(u"femto");}
};
template <>
struct ratio_string<femto, char32_t>
{
static u32string symbol() {return u32string(1, U'f');}
static u32string prefix() {return u32string(U"femto");}
};
#endif
template <>
struct ratio_string<femto, wchar_t>
{
static wstring symbol() {return wstring(1, L'f');}
static wstring prefix() {return wstring(L"femto");}
};
// pico
template <>
struct ratio_string<pico, char>
{
static string symbol() {return string(1, 'p');}
static string prefix() {return string("pico");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<pico, char16_t>
{
static u16string symbol() {return u16string(1, u'p');}
static u16string prefix() {return u16string(u"pico");}
};
template <>
struct ratio_string<pico, char32_t>
{
static u32string symbol() {return u32string(1, U'p');}
static u32string prefix() {return u32string(U"pico");}
};
#endif
template <>
struct ratio_string<pico, wchar_t>
{
static wstring symbol() {return wstring(1, L'p');}
static wstring prefix() {return wstring(L"pico");}
};
// nano
template <>
struct ratio_string<nano, char>
{
static string symbol() {return string(1, 'n');}
static string prefix() {return string("nano");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<nano, char16_t>
{
static u16string symbol() {return u16string(1, u'n');}
static u16string prefix() {return u16string(u"nano");}
};
template <>
struct ratio_string<nano, char32_t>
{
static u32string symbol() {return u32string(1, U'n');}
static u32string prefix() {return u32string(U"nano");}
};
#endif
template <>
struct ratio_string<nano, wchar_t>
{
static wstring symbol() {return wstring(1, L'n');}
static wstring prefix() {return wstring(L"nano");}
};
// micro
template <>
struct ratio_string<micro, char>
{
static string symbol() {return string("\xC2\xB5");}
static string prefix() {return string("micro");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<micro, char16_t>
{
static u16string symbol() {return u16string(1, u'\xB5');}
static u16string prefix() {return u16string(u"micro");}
};
template <>
struct ratio_string<micro, char32_t>
{
static u32string symbol() {return u32string(1, U'\xB5');}
static u32string prefix() {return u32string(U"micro");}
};
#endif
template <>
struct ratio_string<micro, wchar_t>
{
static wstring symbol() {return wstring(1, L'\xB5');}
static wstring prefix() {return wstring(L"micro");}
};
// milli
template <>
struct ratio_string<milli, char>
{
static string symbol() {return string(1, 'm');}
static string prefix() {return string("milli");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<milli, char16_t>
{
static u16string symbol() {return u16string(1, u'm');}
static u16string prefix() {return u16string(u"milli");}
};
template <>
struct ratio_string<milli, char32_t>
{
static u32string symbol() {return u32string(1, U'm');}
static u32string prefix() {return u32string(U"milli");}
};
#endif
template <>
struct ratio_string<milli, wchar_t>
{
static wstring symbol() {return wstring(1, L'm');}
static wstring prefix() {return wstring(L"milli");}
};
// centi
template <>
struct ratio_string<centi, char>
{
static string symbol() {return string(1, 'c');}
static string prefix() {return string("centi");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<centi, char16_t>
{
static u16string symbol() {return u16string(1, u'c');}
static u16string prefix() {return u16string(u"centi");}
};
template <>
struct ratio_string<centi, char32_t>
{
static u32string symbol() {return u32string(1, U'c');}
static u32string prefix() {return u32string(U"centi");}
};
#endif
template <>
struct ratio_string<centi, wchar_t>
{
static wstring symbol() {return wstring(1, L'c');}
static wstring prefix() {return wstring(L"centi");}
};
// deci
template <>
struct ratio_string<deci, char>
{
static string symbol() {return string(1, 'd');}
static string prefix() {return string("deci");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deci, char16_t>
{
static u16string symbol() {return u16string(1, u'd');}
static u16string prefix() {return u16string(u"deci");}
};
template <>
struct ratio_string<deci, char32_t>
{
static u32string symbol() {return u32string(1, U'd');}
static u32string prefix() {return u32string(U"deci");}
};
#endif
template <>
struct ratio_string<deci, wchar_t>
{
static wstring symbol() {return wstring(1, L'd');}
static wstring prefix() {return wstring(L"deci");}
};
// deca
template <>
struct ratio_string<deca, char>
{
static string symbol() {return string("da");}
static string prefix() {return string("deca");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deca, char16_t>
{
static u16string symbol() {return u16string(u"da");}
static u16string prefix() {return u16string(u"deca");}
};
template <>
struct ratio_string<deca, char32_t>
{
static u32string symbol() {return u32string(U"da");}
static u32string prefix() {return u32string(U"deca");}
};
#endif
template <>
struct ratio_string<deca, wchar_t>
{
static wstring symbol() {return wstring(L"da");}
static wstring prefix() {return wstring(L"deca");}
};
// hecto
template <>
struct ratio_string<hecto, char>
{
static string symbol() {return string(1, 'h');}
static string prefix() {return string("hecto");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<hecto, char16_t>
{
static u16string symbol() {return u16string(1, u'h');}
static u16string prefix() {return u16string(u"hecto");}
};
template <>
struct ratio_string<hecto, char32_t>
{
static u32string symbol() {return u32string(1, U'h');}
static u32string prefix() {return u32string(U"hecto");}
};
#endif
template <>
struct ratio_string<hecto, wchar_t>
{
static wstring symbol() {return wstring(1, L'h');}
static wstring prefix() {return wstring(L"hecto");}
};
// kilo
template <>
struct ratio_string<kilo, char>
{
static string symbol() {return string(1, 'k');}
static string prefix() {return string("kilo");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<kilo, char16_t>
{
static u16string symbol() {return u16string(1, u'k');}
static u16string prefix() {return u16string(u"kilo");}
};
template <>
struct ratio_string<kilo, char32_t>
{
static u32string symbol() {return u32string(1, U'k');}
static u32string prefix() {return u32string(U"kilo");}
};
#endif
template <>
struct ratio_string<kilo, wchar_t>
{
static wstring symbol() {return wstring(1, L'k');}
static wstring prefix() {return wstring(L"kilo");}
};
// mega
template <>
struct ratio_string<mega, char>
{
static string symbol() {return string(1, 'M');}
static string prefix() {return string("mega");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<mega, char16_t>
{
static u16string symbol() {return u16string(1, u'M');}
static u16string prefix() {return u16string(u"mega");}
};
template <>
struct ratio_string<mega, char32_t>
{
static u32string symbol() {return u32string(1, U'M');}
static u32string prefix() {return u32string(U"mega");}
};
#endif
template <>
struct ratio_string<mega, wchar_t>
{
static wstring symbol() {return wstring(1, L'M');}
static wstring prefix() {return wstring(L"mega");}
};
// giga
template <>
struct ratio_string<giga, char>
{
static string symbol() {return string(1, 'G');}
static string prefix() {return string("giga");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<giga, char16_t>
{
static u16string symbol() {return u16string(1, u'G');}
static u16string prefix() {return u16string(u"giga");}
};
template <>
struct ratio_string<giga, char32_t>
{
static u32string symbol() {return u32string(1, U'G');}
static u32string prefix() {return u32string(U"giga");}
};
#endif
template <>
struct ratio_string<giga, wchar_t>
{
static wstring symbol() {return wstring(1, L'G');}
static wstring prefix() {return wstring(L"giga");}
};
// tera
template <>
struct ratio_string<tera, char>
{
static string symbol() {return string(1, 'T');}
static string prefix() {return string("tera");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<tera, char16_t>
{
static u16string symbol() {return u16string(1, u'T');}
static u16string prefix() {return u16string(u"tera");}
};
template <>
struct ratio_string<tera, char32_t>
{
static u32string symbol() {return u32string(1, U'T');}
static u32string prefix() {return u32string(U"tera");}
};
#endif
template <>
struct ratio_string<tera, wchar_t>
{
static wstring symbol() {return wstring(1, L'T');}
static wstring prefix() {return wstring(L"tera");}
};
// peta
template <>
struct ratio_string<peta, char>
{
static string symbol() {return string(1, 'P');}
static string prefix() {return string("peta");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<peta, char16_t>
{
static u16string symbol() {return u16string(1, u'P');}
static u16string prefix() {return u16string(u"peta");}
};
template <>
struct ratio_string<peta, char32_t>
{
static u32string symbol() {return u32string(1, U'P');}
static u32string prefix() {return u32string(U"peta");}
};
#endif
template <>
struct ratio_string<peta, wchar_t>
{
static wstring symbol() {return wstring(1, L'P');}
static wstring prefix() {return wstring(L"peta");}
};
// exa
template <>
struct ratio_string<exa, char>
{
static string symbol() {return string(1, 'E');}
static string prefix() {return string("exa");}
};
#if HAS_UNICODE_SUPPORT
template <>
struct ratio_string<exa, char16_t>
{
static u16string symbol() {return u16string(1, u'E');}
static u16string prefix() {return u16string(u"exa");}
};
template <>
struct ratio_string<exa, char32_t>
{
static u32string symbol() {return u32string(1, U'E');}
static u32string prefix() {return u32string(U"exa");}
};
#endif
template <>
struct ratio_string<exa, wchar_t>
{
static wstring symbol() {return wstring(1, L'E');}
static wstring prefix() {return wstring(L"exa");}
};
//_LIBCPP_END_NAMESPACE_STD
}
#endif // _RATIO_IO

View File

@@ -107,7 +107,7 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
This is only compiled in a debug build.
@see Logger::outputDebugString
*/
#define DBG(dbgtext) { beast::String tempDbgBuf; tempDbgBuf << dbgtext; beast::Logger::outputDebugString (tempDbgBuf); }
#define BDBG(dbgtext) { beast::String tempDbgBuf; tempDbgBuf << dbgtext; beast::Logger::outputDebugString (tempDbgBuf); }
/** This will always cause an assertion failure.
It is only compiled in a debug build, (unless BEAST_LOG_ASSERTIONS is enabled for your build).
@@ -127,7 +127,7 @@ extern void beast_reportFatalError (char const* message, char const* fileName, i
// If debugging is disabled, these dummy debug and assertion macros are used..
#define DBG(dbgtext)
#define BDBG(dbgtext)
#define bassertfalse { beast_LogCurrentAssertion }
# if BEAST_LOG_ASSERTIONS

View File

@@ -81,6 +81,10 @@
#define BEAST_ZLIB_INCLUDE_PATH <zlib.h>
#endif
#ifndef BEAST_SQLITE_FORCE_NDEBUG
#define BEAST_SQLITE_FORCE_NDEBUG 0
#endif
#ifndef BEAST_STRING_UTF_TYPE
#define BEAST_STRING_UTF_TYPE 8
#endif

View File

@@ -174,7 +174,6 @@
#ifdef __clang__
#define BEAST_CLANG 1
#define BEAST_GCC 1
#elif defined (__GNUC__)
#define BEAST_GCC 1
#elif defined (_MSC_VER)

View File

@@ -20,5 +20,4 @@
#ifndef BEAST_CRYPTO_BINARYENCODING_H_INCLUDED
#define BEAST_CRYPTO_BINARYENCODING_H_INCLUDED
#endif

View File

@@ -19,4 +19,9 @@
#include "BeastConfig.h"
#include "../../modules/beast_core/beast_core.h" // for UnitTest
#include "impl/BinaryEncoding.cpp"
#include "impl/MurmurHash.cpp"
#include "impl/Sha256.cpp"
#include "impl/UnsignedInteger.cpp"

View File

@@ -17,15 +17,15 @@
*/
//==============================================================================
#ifndef BEAST_MURMURHASH_H_INCLUDED
#define BEAST_MURMURHASH_H_INCLUDED
#ifndef BEAST_CRYPTO_MURMURHASH_H_INCLUDED
#define BEAST_CRYPTO_MURMURHASH_H_INCLUDED
#include "../CStdInt.h"
// Original source code links in .cpp file
// This file depends on some Beast declarations and defines
namespace Murmur
{
namespace beast {
namespace Murmur {
extern void MurmurHash3_x86_32 (const void* key, int len, uint32 seed, void* out);
extern void MurmurHash3_x86_128 (const void* key, int len, uint32 seed, void* out);
@@ -77,6 +77,7 @@ inline void Hash (const void* key, int len, uint32 seed, HashType* out)
};
}
}
}
#endif

View File

@@ -20,6 +20,15 @@
#ifndef BEAST_CRYPTO_UNSIGNEDINTEGER_H_INCLUDED
#define BEAST_CRYPTO_UNSIGNEDINTEGER_H_INCLUDED
#include "../SafeBool.h"
#include "UnsignedIntegerCalc.h"
#include "MurmurHash.h"
#include <cstdint>
#include <memory>
namespace beast {
/** Represents a set of bits of fixed size.
The data is stored in "canonical" format which is network (big endian)
@@ -36,17 +45,17 @@ public:
static std::size_t const size = Bytes;
// The underlying integer type we use when converting to calculation format.
typedef uint32 IntCalcType;
typedef std::uint32_t IntCalcType;
// The type of object resulting from a conversion to calculation format.
typedef UnsignedIntegerCalc <IntCalcType> CalcType;
// Standard container compatibility
typedef uint8 value_type;
typedef std::uint8_t value_type;
typedef value_type* iterator;
typedef value_type const* const_iterator;
/** Hardened hash function for use with HashMap.
/** Hardened hash function for use with hash based containers.
The seed is used to make the hash unpredictable. This prevents
attackers from exploiting crafted inputs to produce degenerate
containers.
@@ -59,21 +68,21 @@ public:
will be generated from the system
@param seedToUse An optional seed to use.
*/
explicit hasher (HashValue seedToUse = Random::getSystemRandom ().nextInt ())
explicit hasher (std::size_t seedToUse = Random::getSystemRandom ().nextInt ())
: m_seed (seedToUse)
{
}
/** Generates a simple hash from an UnsignedInteger. */
HashValue operator() (UnsignedInteger const& key) const
std::size_t operator() (UnsignedInteger const& key) const
{
HashValue hash;
std::size_t hash;
Murmur::Hash (key.cbegin (), key.size, m_seed, &hash);
return hash;
}
private:
HashValue m_seed;
std::size_t m_seed;
};
/** Determins if two UnsignedInteger objects are equal. */
@@ -135,7 +144,8 @@ public:
template <class UnsignedIntegralType>
static UnsignedInteger createFromInteger (UnsignedIntegralType value)
{
static_bassert (Bytes >= sizeof (UnsignedIntegralType));
static_assert (Bytes >= sizeof (UnsignedIntegralType),
"Bytes is too small.");
UnsignedInteger <Bytes> result;
value = toNetworkByteOrder <UnsignedIntegralType> (value);
result.clear ();
@@ -296,4 +306,6 @@ private:
IntCalcType m_values [CalcCount];
};
}
#endif

View File

@@ -20,22 +20,25 @@
#ifndef BEAST_CRYPTO_UNSIGNEDINTEGERCALC_H_INCLUDED
#define BEAST_CRYPTO_UNSIGNEDINTEGERCALC_H_INCLUDED
namespace detail
{
#include <cstdint>
namespace beast {
namespace detail {
template <typename UInt>
struct DoubleWidthUInt;
template <>
struct DoubleWidthUInt <uint16>
struct DoubleWidthUInt <std::uint16_t>
{
typedef uint32 type;
typedef std::uint32_t type;
};
template <>
struct DoubleWidthUInt <uint32>
struct DoubleWidthUInt <std::uint32_t>
{
typedef uint64 type;
typedef std::uint64_t type;
};
}
@@ -427,4 +430,6 @@ private:
UInt* m_values;
};
}
#endif

View File

@@ -17,6 +17,14 @@
*/
//==============================================================================
#include "../BinaryEncoding.h"
#include "../UnsignedInteger.h"
#include <cstddef>
#include <string>
namespace beast {
/** Generic algorithms for base encoding and decoding. */
class BinaryEncoding
{
@@ -393,3 +401,5 @@ public:
};
static BinaryEncodingTests BinaryEncodingTests;
}

View File

@@ -19,8 +19,12 @@
// http://code.google.com/p/smhasher/
namespace Murmur
{
#include "../MurmurHash.h"
#include <cstdint>
namespace beast {
namespace Murmur {
//-----------------------------------------------------------------------------
// Platform-specific functions and macros
@@ -485,3 +489,4 @@ void MurmurHash3_x64_128 ( const void* key, const int len,
}
}
}

View File

@@ -3,6 +3,10 @@
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Portions are Copyright (c) 2013 the authors listed at the following URL,
and/or the authors of referenced articles or incorporated external code:
http://en.literateprograms.org/Arbitrary-precision_integer_arithmetic_(C)?action=history&offset=20100923155004
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.
@@ -17,7 +21,13 @@
*/
//==============================================================================
//------------------------------------------------------------------------------
#include "../UnsignedInteger.h"
namespace beast {
namespace multiprecsion {
#if 0
/* Copyright (c) 2013 the authors listed at the following URL, and/or
the authors of referenced articles or incorporated external code:
@@ -41,15 +51,11 @@
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.
Retrieved from: http://en.literateprograms.org/Arbitrary-precision_integer_arithmetic_(C)?oldid=16902
*/
namespace multiprecsion
{
#if 0
//------------------------------------------------------------------------------
//
// Retrieved from: http://en.literateprograms.org/Arbitrary-precision_integer_arithmetic_(C)?oldid=16902
//
typedef unsigned short component_t;
typedef unsigned long double_component_t;
@@ -394,3 +400,5 @@ private:
};
static UnsignedIntegerTests unsignedIntegerTests;
}

View File

@@ -0,0 +1,513 @@
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Based on work with these copyrights:
Copyright Carl Philipp Reh 2009 - 2013.
Copyright Philipp Middendorf 2009 - 2013.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
Original code taken from
https://github.com/freundlich/fcppt
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_CYCLIC_ITERATOR_H_INCLUDED
#define BEAST_CYCLIC_ITERATOR_H_INCLUDED
#include <iterator>
#include <boost/iterator/iterator_facade.hpp>
namespace beast {
//
// cyclic_iterator_fwd.hpp
//
template<
typename ContainerIterator
>
class cyclic_iterator;
//
// cyclic_iterator_category.hpp
//
namespace detail
{
template<
typename SourceCategory
>
struct cyclic_iterator_category;
template<>
struct cyclic_iterator_category<
std::forward_iterator_tag
>
{
typedef std::forward_iterator_tag type;
};
template<>
struct cyclic_iterator_category<
std::bidirectional_iterator_tag
>
{
typedef std::bidirectional_iterator_tag type;
};
template<>
struct cyclic_iterator_category<
std::random_access_iterator_tag
>
{
typedef std::bidirectional_iterator_tag type;
};
}
//
// cyclic_iterator_base.hpp
//
namespace detail
{
template<
typename ContainerIterator
>
struct cyclic_iterator_base
{
typedef boost::iterator_facade<
cyclic_iterator<
ContainerIterator
>,
typename std::iterator_traits<
ContainerIterator
>::value_type,
typename detail::cyclic_iterator_category<
typename std::iterator_traits<
ContainerIterator
>::iterator_category
>::type,
typename std::iterator_traits<
ContainerIterator
>::reference
> type;
};
}
//
// cyclic_iterator_decl.hpp
//
/**
\brief An iterator adaptor that cycles through a range
\ingroup fcpptmain
\tparam ContainerIterator The underlying iterator which must be at least a
forward iterator
A cyclic iterator can be useful in cases where you want <code>end()</code> to
become <code>begin()</code> again. For example, imagine a cycling through a
list of items which means if you skip over the last, you will return to the
first one.
This class can only increment or decrement its underlying iterator, random
access is not supported. The iterator category will be at most bidirectional.
It inherits all capabilities from <code>boost::iterator_facade</code> which
means that it will have the usual iterator operations with their semantics.
Here is a short example demonstrating its use.
\snippet cyclic_iterator.cpp cyclic_iterator
*/
template<
typename ContainerIterator
>
class cyclic_iterator
:
public detail::cyclic_iterator_base<
ContainerIterator
>::type
{
public:
/**
\brief The base type which is a <code>boost::iterator_facade</code>
*/
typedef typename detail::cyclic_iterator_base<
ContainerIterator
>::type base_type;
/**
\brief The underlying iterator type
*/
typedef ContainerIterator container_iterator_type;
/**
\brief The value type adapted from \a ContainerIterator
*/
typedef typename base_type::value_type value_type;
/**
\brief The reference type adapted from \a ContainerIterator
*/
typedef typename base_type::reference reference;
/**
\brief The pointer type adapted from \a ContainerIterator
*/
typedef typename base_type::pointer pointer;
/**
\brief The difference type adapted from \a ContainerIterator
*/
typedef typename base_type::difference_type difference_type;
/**
\brief The iterator category, either Forward or Bidirectional
*/
typedef typename base_type::iterator_category iterator_category;
/**
\brief Creates a singular iterator
*/
cyclic_iterator();
/**
\brief Copy constructs from another cyclic iterator
Copy constructs from another cyclic iterator \a other. This only works
if the underlying iterators are convertible.
\param other The iterator to copy construct from
*/
template<
typename OtherIterator
>
explicit
cyclic_iterator(
cyclic_iterator<OtherIterator> const &other
);
/**
\brief Constructs a new cyclic iterator
Constructs a new cyclic iterator, starting at \a it, inside
a range from \a begin to \a end.
\param pos The start of the iterator
\param begin The beginning of the range
\param end The end of the range
\warning The behaviour is undefined if \a pos isn't between \a begin
and \a end. Also, the behaviour is undefined, if \a begin and \a end
don't form a valid range.
*/
cyclic_iterator(
container_iterator_type const &pos,
container_iterator_type const &begin,
container_iterator_type const &end
);
/**
\brief Assigns from another cyclic iterator
Assigns from another cyclic iterator \a other. This only works if the
underlying iterators are convertible.
\param other The iterator to assign from
\return <code>*this</code>
*/
template<
typename OtherIterator
>
cyclic_iterator<ContainerIterator> &
operator=(
cyclic_iterator<OtherIterator> const &other
);
/**
\brief Returns the beginning of the range
*/
container_iterator_type
begin() const;
/**
\brief Returns the end of the range
*/
container_iterator_type
end() const;
/**
\brief Returns the underlying iterator
*/
container_iterator_type
get() const;
private:
friend class boost::iterator_core_access;
void
increment();
void
decrement();
bool
equal(
cyclic_iterator const &
) const;
reference
dereference() const;
difference_type
distance_to(
cyclic_iterator const &
) const;
private:
container_iterator_type
it_,
begin_,
end_;
};
//
// cyclic_iterator_impl.hpp
//
template<
typename ContainerIterator
>
cyclic_iterator<
ContainerIterator
>::cyclic_iterator()
:
it_(),
begin_(),
end_()
{
}
template<
typename ContainerIterator
>
template<
typename OtherIterator
>
cyclic_iterator<
ContainerIterator
>::cyclic_iterator(
cyclic_iterator<
OtherIterator
> const &_other
)
:
it_(
_other.it_
),
begin_(
_other.begin_
),
end_(
_other.end_
)
{
}
template<
typename ContainerIterator
>
cyclic_iterator<
ContainerIterator
>::cyclic_iterator(
container_iterator_type const &_it,
container_iterator_type const &_begin,
container_iterator_type const &_end
)
:
it_(
_it
),
begin_(
_begin
),
end_(
_end
)
{
}
template<
typename ContainerIterator
>
template<
typename OtherIterator
>
cyclic_iterator<
ContainerIterator
> &
cyclic_iterator<
ContainerIterator
>::operator=(
cyclic_iterator<
OtherIterator
> const &_other
)
{
it_ = _other.it_;
begin_ = _other.begin_;
end_ = _other.end_;
return *this;
}
template<
typename ContainerIterator
>
typename cyclic_iterator<
ContainerIterator
>::container_iterator_type
cyclic_iterator<
ContainerIterator
>::begin() const
{
return begin_;
}
template<
typename ContainerIterator
>
typename cyclic_iterator<
ContainerIterator
>::container_iterator_type
cyclic_iterator<
ContainerIterator
>::end() const
{
return end_;
}
template<
typename ContainerIterator
>
typename cyclic_iterator<
ContainerIterator
>::container_iterator_type
cyclic_iterator<
ContainerIterator
>::get() const
{
return it_;
}
template<
typename ContainerIterator
>
void
cyclic_iterator<
ContainerIterator
>::increment()
{
if(
begin_ != end_
&& ++it_ == end_
)
it_ = begin_;
}
template<
typename ContainerIterator
>
void
cyclic_iterator<
ContainerIterator
>::decrement()
{
if(
begin_ == end_
)
return;
if(
it_ == begin_
)
it_ =
std::prev(
end_
);
else
--it_;
}
template<
typename ContainerIterator
>
bool
cyclic_iterator<
ContainerIterator
>::equal(
cyclic_iterator const &_other
) const
{
return it_ == _other.it;
}
template<
typename ContainerIterator
>
typename cyclic_iterator<
ContainerIterator
>::reference
cyclic_iterator<
ContainerIterator
>::dereference() const
{
return *it_;
}
template<
typename ContainerIterator
>
typename cyclic_iterator<
ContainerIterator
>::difference_type
cyclic_iterator<
ContainerIterator
>::distance_to(
cyclic_iterator const &_other
) const
{
return _other.it_ - it_;
}
// Convenience function for template argument deduction
template <typename ContainerIterator>
cyclic_iterator <ContainerIterator> make_cyclic (
ContainerIterator const& pos,
ContainerIterator const& begin,
ContainerIterator const& end);
}
#endif

View File

@@ -22,6 +22,8 @@
#include "../strings/String.h"
#include <ios>
namespace beast {
/** A URL.
@@ -90,7 +92,10 @@ public:
String userinfo () const;
/** Retrieve the full URL as a single string. */
String full () const;
/** @{ */
String toString () const;
std::string to_string() const;
/** @} */
private:
String m_scheme;
@@ -103,6 +108,37 @@ private:
String m_userinfo;
};
/** URL comparisons. */
/** @{ */
inline bool operator== (URL const& lhs, URL const& rhs) { return lhs.toString() == rhs.toString(); }
inline bool operator!= (URL const& lhs, URL const& rhs) { return ! (lhs.toString() == rhs.toString()); }
inline bool operator< (URL const& lhs, URL const& rhs) { return lhs.toString() < rhs.toString(); }
inline bool operator> (URL const& lhs, URL const& rhs) { return rhs.toString() < lhs.toString(); }
inline bool operator<= (URL const& lhs, URL const& rhs) { return ! (rhs.toString() < lhs.toString()); }
inline bool operator>= (URL const& lhs, URL const& rhs) { return ! (lhs.toString() < rhs.toString()); }
/** @} */
/** Output stream conversion. */
std::ostream& operator<< (std::ostream& os, URL const& url);
/** boost::hash support */
extern std::size_t hash_value (beast::URL const& url);
}
//------------------------------------------------------------------------------
namespace std {
template <>
struct hash <beast::URL>
{
std::size_t operator() (beast::URL const& v) const
{ return beast::hash_value (v); }
};
}
//------------------------------------------------------------------------------
#endif

View File

@@ -155,7 +155,7 @@ public:
{
ParsedURL result (url);
expect (result.error () == 0);
expect (result.url ().full () == url);
expect (result.url ().toString () == url);
}
void testURL ()

View File

@@ -25,7 +25,6 @@ URL::URL ()
: m_port (0)
{
}
URL::URL (
String scheme_,
String host_,
@@ -129,7 +128,7 @@ String URL::userinfo () const
foo://username:password@example.com:8042/over/there/index.dtb?type=animal&name=narwhal#nose
*/
String URL::full () const
String URL::toString () const
{
String s;
@@ -154,5 +153,25 @@ String URL::full () const
return s;
}
std::string URL::to_string() const
{
return toString().toStdString();
}
std::ostream& operator<< (std::ostream &os, URL const& url)
{
os << url.to_string();
return os;
}
//------------------------------------------------------------------------------
std::size_t hash_value (URL const& v)
{
return std::size_t (v.toString().hash());
}
}
// boost::hash support

View File

@@ -0,0 +1,97 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_COLLECTOR_H_INCLUDED
#define BEAST_INSIGHT_COLLECTOR_H_INCLUDED
#include <string>
#include "Counter.h"
#include "Event.h"
#include "Gauge.h"
#include "Hook.h"
#include "Meter.h"
namespace beast {
namespace insight {
/** Interface for a manager that allows collection of metrics.
To export metrics from a class, pass and save a shared_ptr to this
interface in the class constructor. Create the metric objects
as desired (counters, events, gauges, meters, and an optional hook)
using the interface.
@see Counter, Event, Gauge, Hook, Meter
@see NullCollector, StatsDCollector
*/
class Collector
{
public:
typedef std::shared_ptr <Collector> ptr;
virtual ~Collector() = 0;
/** Create a hook.
A hook is called at each collection interval, on an implementation
defined thread. This is a convenience facility for gathering metrics
in the polling style. The typical usage is to update all the metrics
of interest in the handler.
Handler will be called with this signature:
void handler (void)
@see Hook
*/
/** @{ */
template <class Handler>
Hook make_hook (Handler handler)
{
return make_hook (HookImpl::HandlerType (handler));
}
virtual Hook make_hook (HookImpl::HandlerType const& handler) = 0;
/** @} */
/** Create a counter with the specified name.
@see Counter
*/
virtual Counter make_counter (std::string const& name) = 0;
/** Create an event with the specified name.
@see Event
*/
virtual Event make_event (std::string const& name) = 0;
/** Create a gauge with the specified name.
@see Gauge
*/
virtual Gauge make_gauge (std::string const& name) = 0;
/** Create a meter with the specified name.
@see Meter
*/
virtual Meter make_meter (std::string const& name) = 0;
};
}
}
#endif

View File

@@ -0,0 +1,109 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_COUNTER_H_INCLUDED
#define BEAST_INSIGHT_COUNTER_H_INCLUDED
#include <memory>
#include "CounterImpl.h"
namespace beast {
namespace insight {
/** A metric for measuring an integral value.
A counter is a gauge calculated at the server. The owner of the counter
may increment and decrement the value by an amount.
This is a lightweight reference wrapper which is cheap to copy and assign.
When the last reference goes away, the metric is no longer collected.
*/
class Counter
{
public:
typedef CounterImpl::value_type value_type;
/** Create a null metric.
A null metric reports no information.
*/
Counter ()
{
}
/** Create the metric reference the specified implementation.
Normally this won't be called directly. Instead, call the appropriate
factory function in the Collector interface.
@see Collector.
*/
explicit Counter (std::shared_ptr <CounterImpl> const& impl)
: m_impl (impl)
{
}
/** Set a handler for polling.
If a handler is set, it will be called once per collection interval.
This may be used to implement polling style collection instead of
push style.
Handler will be called with this signature:
void Handler (Counter const&);
*/
template <class Handler>
void set_handler (Handler handler) const
{
if (m_impl)
m_impl->set_handler (handler);
}
/** Increment the counter. */
/** @{ */
void increment (value_type amount) const
{
if (m_impl)
m_impl->increment (amount);
}
Counter const& operator+= (value_type amount) const
{ increment (amount); return *this; }
Counter const& operator-= (value_type amount) const
{ increment (-amount); return *this; }
Counter const& operator++ () const
{ increment (1); return *this; }
Counter const& operator++ (int) const
{ increment (1); return *this; }
Counter const& operator-- () const
{ increment (-1); return *this; }
Counter const& operator-- (int) const
{ increment (-1); return *this; }
/** @} */
private:
std::shared_ptr <CounterImpl> m_impl;
};
}
}
#endif

View File

@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_COUNTERIMPL_H_INCLUDED
#define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
#include <memory>
namespace beast {
namespace insight {
class Counter;
class CounterImpl : public std::enable_shared_from_this <CounterImpl>
{
public:
typedef int64 value_type;
typedef std::function <void (Counter const&)> HandlerType;
virtual ~CounterImpl () = 0;
virtual void increment (value_type amount) = 0;
virtual void set_handler (HandlerType const& handler) = 0;
};
}
}
#endif

View File

@@ -0,0 +1,77 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_EVENT_H_INCLUDED
#define BEAST_INSIGHT_EVENT_H_INCLUDED
#include <chrono>
#include <memory>
#include "EventImpl.h"
#include "../chrono/chrono_util.h"
namespace beast {
namespace insight {
/** A metric for reporting event timing.
An event is an operation that has an associated millisecond time, or
other integral value. Because events happen at a specific moment, the
metric only supports a push-style interface.
This is a lightweight reference wrapper which is cheap to copy and assign.
When the last reference goes away, the metric is no longer collected.
*/
class Event
{
public:
typedef EventImpl::value_type value_type;
/** Create a null metric.
A null metric reports no information.
*/
Event ()
{ }
/** Create the metric reference the specified implementation.
Normally this won't be called directly. Instead, call the appropriate
factory function in the Collector interface.
@see Collector.
*/
explicit Event (std::shared_ptr <EventImpl> const& impl)
: m_impl (impl)
{ }
/** Push an event notification. */
template <class Rep, class Period>
void notify (std::chrono::duration <Rep, Period> const& value) const
{
if (m_impl)
m_impl->notify (ceil <value_type> (value));
}
private:
std::shared_ptr <EventImpl> m_impl;
};
}
}
#endif

View File

@@ -17,28 +17,24 @@
*/
//==============================================================================
#ifndef BEAST_MPL_REMOVEVOLATILE_H_INCLUDED
#define BEAST_MPL_REMOVEVOLATILE_H_INCLUDED
#ifndef BEAST_INSIGHT_EVENTIMPL_H_INCLUDED
#define BEAST_INSIGHT_EVENTIMPL_H_INCLUDED
// Ideas based on boost
#include <memory>
namespace beast {
namespace mpl {
namespace insight {
/** Remove the `volatile` qualifier from a type. */
/** @{ */
template <typename T>
struct RemoveVolatile
{
typedef T type;
};
class Event;
template <typename T>
struct RemoveVolatile <T volatile>
class EventImpl : public std::enable_shared_from_this <EventImpl>
{
typedef T type;
public:
typedef std::chrono::milliseconds value_type;
virtual ~EventImpl () = 0;
virtual void notify (value_type const& value) = 0;
};
/** @} */
}
}

View File

@@ -0,0 +1,127 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_GAUGE_H_INCLUDED
#define BEAST_INSIGHT_GAUGE_H_INCLUDED
#include <memory>
#include "GaugeImpl.h"
namespace beast {
namespace insight {
/** A metric for measuring an integral value.
A gauge is an instantaneous measurement of a value, like the gas gauge
in a car. The caller directly sets the value, or adjusts it by a
specified amount. The value is kept in the client rather than the collector.
This is a lightweight reference wrapper which is cheap to copy and assign.
When the last reference goes away, the metric is no longer collected.
*/
class Gauge
{
public:
typedef GaugeImpl::value_type value_type;
typedef GaugeImpl::difference_type difference_type;
/** Create a null metric.
A null metric reports no information.
*/
Gauge ()
{
}
/** Create the metric reference the specified implementation.
Normally this won't be called directly. Instead, call the appropriate
factory function in the Collector interface.
@see Collector.
*/
explicit Gauge (std::shared_ptr <GaugeImpl> const& impl)
: m_impl (impl)
{
}
/** Set a handler for polling.
If a handler is set, it will be called once per collection interval.
This may be used to implement polling style collection instead of
push style.
Handler will be called with this signature:
void Handler (Gauge const&);
*/
template <class Handler>
void set_handler (Handler handler) const
{
if (m_impl)
m_impl->set_handler (handler);
}
/** Set the value on the gauge.
A Collector implementation should combine multiple calls to value
changes into a single change if the calls occur within a single
collection interval.
*/
/** @{ */
void set (value_type value) const
{
if (m_impl)
m_impl->set (value);
}
Gauge const& operator= (value_type value) const
{ set (value); return *this; }
/** @} */
/** Adjust the value of the gauge. */
/** @{ */
void increment (difference_type amount) const
{
if (m_impl)
m_impl->increment (amount);
}
Gauge const& operator+= (difference_type amount) const
{ increment (amount); return *this; }
Gauge const& operator-= (difference_type amount) const
{ increment (-amount); return *this; }
Gauge const& operator++ () const
{ increment (1); return *this; }
Gauge const& operator++ (int) const
{ increment (1); return *this; }
Gauge const& operator-- () const
{ increment (-1); return *this; }
Gauge const& operator-- (int) const
{ increment (-1); return *this; }
/** @} */
private:
std::shared_ptr <GaugeImpl> m_impl;
};
}
}
#endif

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_GAUGEIMPL_H_INCLUDED
#define BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED
#include <functional>
#include <memory>
namespace beast {
namespace insight {
class Gauge;
class GaugeImpl : public std::enable_shared_from_this <GaugeImpl>
{
public:
typedef uint64 value_type;
typedef int64 difference_type;
typedef std::function <void (Gauge const&)> HandlerType;
virtual ~GaugeImpl () = 0;
virtual void set (value_type value) = 0;
virtual void increment (difference_type amount) = 0;
virtual void set_handler (HandlerType const& handler) = 0;
};
}
}
#endif

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_HOOK_H_INCLUDED
#define BEAST_INSIGHT_HOOK_H_INCLUDED
#include "HookImpl.h"
#include <memory>
namespace beast {
namespace insight {
/** A reference to a handler for performing polled collection. */
class Hook
{
public:
/** Create a null hook.
A null hook has no associated handler.
*/
Hook ()
{ }
/** Create a hook referencing the specified implementation.
Normally this won't be called directly. Instead, call the appropriate
factory function in the Collector interface.
@see Collector.
*/
explicit Hook (std::shared_ptr <HookImpl> const& impl)
: m_impl (impl)
{
}
private:
std::shared_ptr <HookImpl> m_impl;
};
}
}
#endif

View File

@@ -17,28 +17,22 @@
*/
//==============================================================================
#ifndef BEAST_MPL_REMOVECONST_H_INCLUDED
#define BEAST_MPL_REMOVECONST_H_INCLUDED
#ifndef BEAST_INSIGHT_HOOKIMPL_H_INCLUDED
#define BEAST_INSIGHT_HOOKIMPL_H_INCLUDED
// Ideas based on boost
#include <functional>
#include <memory>
namespace beast {
namespace mpl {
namespace insight {
/** Remove the `const` qualifier from a type. */
/** @{ */
template <typename T>
struct RemoveConst
class HookImpl : public std::enable_shared_from_this <HookImpl>
{
typedef T type;
};
public:
typedef std::function <void (void)> HandlerType;
template <typename T>
struct RemoveConst <T const>
{
typedef T type;
virtual ~HookImpl () = 0;
};
/** @} */
}
}

View File

@@ -19,20 +19,14 @@
#include "BeastConfig.h"
#include "beast_db.h"
#include "../Config.h"
#include "../beast_crypto/beast_crypto.h"
#include "../../modules/beast_core/beast_core.h" // for UnitTest
namespace beast
{
#include "../Insight.h"
#if BEAST_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include "keyvalue/KeyvaDB.cpp"
#if BEAST_GCC
#pragma GCC diagnostic pop
#endif
}
#include "impl/Collector.cpp"
#include "impl/Hook.cpp"
#include "impl/Metric.cpp"
#include "impl/NullCollector.cpp"
#include "impl/StatsDCollector.cpp"

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.
*/
//==============================================================================
#ifndef BEAST_INSIGHT_METER_H_INCLUDED
#define BEAST_INSIGHT_METER_H_INCLUDED
#include "MeterImpl.h"
#include <memory>
namespace beast {
namespace insight {
/** A metric for measuring an integral value.
A meter may be thought of as an increment-only counter.
This is a lightweight reference wrapper which is cheap to copy and assign.
When the last reference goes away, the metric is no longer collected.
*/
class Meter
{
public:
typedef MeterImpl::value_type value_type;
/** Create a null metric.
A null metric reports no information.
*/
Meter ()
{ }
/** Create the metric reference the specified implementation.
Normally this won't be called directly. Instead, call the appropriate
factory function in the Collector interface.
@see Collector.
*/
explicit Meter (std::shared_ptr <MeterImpl> const& impl)
: m_impl (impl)
{ }
/** Set a handler for polling.
If a handler is set, it will be called once per collection interval.
This may be used to implement polling style collection instead of
push style.
Handler will be called with this signature:
void Handler (Meter const&);
*/
template <class Handler>
void set_handler (Handler handler) const
{
m_impl->set_handler (handler);
}
/** Increment the meter. */
/** @{ */
void increment (value_type amount) const
{
if (m_impl)
m_impl->increment (amount);
}
Meter const& operator+= (value_type amount) const
{
increment (amount);
return *this;
}
Meter const& operator++ () const
{
increment (1);
return *this;
}
Meter const& operator++ (int) const
{
increment (1);
return *this;
}
/** @} */
private:
std::shared_ptr <MeterImpl> m_impl;
};
}
}
#endif

View File

@@ -0,0 +1,45 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_METERIMPL_H_INCLUDED
#define BEAST_INSIGHT_METERIMPL_H_INCLUDED
#include <functional>
#include <memory>
namespace beast {
namespace insight {
class Meter;
class MeterImpl : public std::enable_shared_from_this <MeterImpl>
{
public:
typedef uint64 value_type;
typedef std::function <void (Meter const&)> HandlerType;
virtual ~MeterImpl () = 0;
virtual void increment (value_type amount) = 0;
virtual void set_handler (HandlerType const& handler) = 0;
};
}
}
#endif

View File

@@ -17,21 +17,19 @@
*/
//==============================================================================
#ifndef BEAST_MPL_ADDCONST_H_INCLUDED
#define BEAST_MPL_ADDCONST_H_INCLUDED
#ifndef BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED
#define BEAST_INSIGHT_NULLCOLLECTOR_H_INCLUDED
#include "RemoveConst.h"
// Ideas based on boost
#include "Collector.h"
namespace beast {
namespace mpl {
/** Add the `const` qualifier to a type. */
template <typename T>
struct AddConst
namespace insight {
/** A Collector which does not collect metrics. */
class NullCollector : public Collector
{
typedef typename RemoveConst<T>::type const type;
public:
static std::shared_ptr <Collector> New ();
};
}

View File

@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
/*
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_INSIGHT_STATSDCOLLECTOR_H_INCLUDED
#define BEAST_INSIGHT_STATSDCOLLECTOR_H_INCLUDED
#include "Collector.h"
#include "../net/IPAddress.h"
namespace beast {
namespace insight {
/** A Collector that reports metrics to a StatsD server.
Reference:
https://github.com/b/statsd_spec
*/
class StatsDCollector : public Collector
{
public:
/** Create a StatsD collector.
@param address The IP address and port of the StatsD server.
@param prefix A string pre-pended before each metric name.
@param journal Destination for logging output.
*/
static std::shared_ptr <StatsDCollector> New (IPAddress const& address,
std::string const& prefix, Journal journal);
};
}
}
#endif

View File

@@ -0,0 +1,28 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
namespace beast {
namespace insight {
Collector::~Collector ()
{
}
}
}

View File

@@ -0,0 +1,28 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
namespace beast {
namespace insight {
HookImpl::~HookImpl ()
{
}
}
}

View File

@@ -0,0 +1,40 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
namespace beast {
namespace insight {
CounterImpl::~CounterImpl ()
{
}
EventImpl::~EventImpl ()
{
}
GaugeImpl::~GaugeImpl ()
{
}
MeterImpl::~MeterImpl ()
{
}
}
}

View File

@@ -0,0 +1,149 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
namespace beast {
namespace insight {
namespace detail {
class NullHookImpl : public HookImpl
{
private:
NullHookImpl& operator= (NullHookImpl const&);
};
//------------------------------------------------------------------------------
class NullCounterImpl : public CounterImpl
{
public:
void increment (value_type)
{
}
void set_handler (HandlerType const&)
{
}
private:
NullCounterImpl& operator= (NullCounterImpl const&);
};
//------------------------------------------------------------------------------
class NullEventImpl : public EventImpl
{
public:
void notify (value_type const&)
{
}
private:
NullEventImpl& operator= (NullEventImpl const&);
};
//------------------------------------------------------------------------------
class NullGaugeImpl : public GaugeImpl
{
public:
void set (value_type)
{
}
void increment (difference_type)
{
}
void set_handler (HandlerType const&)
{
}
private:
NullGaugeImpl& operator= (NullGaugeImpl const&);
};
//------------------------------------------------------------------------------
class NullMeterImpl : public MeterImpl
{
public:
void increment (value_type)
{
}
void set_handler (HandlerType const&)
{
}
private:
NullMeterImpl& operator= (NullMeterImpl const&);
};
//------------------------------------------------------------------------------
class NullCollectorImp : public NullCollector
{
private:
public:
NullCollectorImp ()
{
}
~NullCollectorImp ()
{
}
Hook make_hook (HookImpl::HandlerType const&)
{
return Hook (std::make_shared <detail::NullHookImpl> ());
}
Counter make_counter (std::string const&)
{
return Counter (std::make_shared <detail::NullCounterImpl> ());
}
Event make_event (std::string const&)
{
return Event (std::make_shared <detail::NullEventImpl> ());
}
Gauge make_gauge (std::string const&)
{
return Gauge (std::make_shared <detail::NullGaugeImpl> ());
}
Meter make_meter (std::string const&)
{
return Meter (std::make_shared <detail::NullMeterImpl> ());
}
};
}
//------------------------------------------------------------------------------
std::shared_ptr <Collector> NullCollector::New ()
{
return std::make_shared <detail::NullCollectorImp> ();
}
}
}

View File

@@ -0,0 +1,715 @@
//------------------------------------------------------------------------------
/*
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 "../../asio/IPAddressConversion.h"
#include "../../threads/SharedData.h"
#include <deque>
#include <climits>
#include <set>
#include <sstream>
#include <thread>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/move/move.hpp>
#include <boost/optional.hpp>
#ifndef BEAST_STATSDCOLLECTOR_TRACING_ENABLED
#define BEAST_STATSDCOLLECTOR_TRACING_ENABLED 0
#endif
namespace beast {
namespace insight {
namespace detail {
class StatsDCollectorImp;
//------------------------------------------------------------------------------
class StatsDMetricBase : public List <StatsDMetricBase>::Node
{
public:
virtual void do_process () = 0;
};
//------------------------------------------------------------------------------
class StatsDHookImpl
: public HookImpl
, public StatsDMetricBase
{
public:
StatsDHookImpl (
HandlerType const& handler,
std::shared_ptr <StatsDCollectorImp> const& impl);
~StatsDHookImpl ();
void do_process ();
private:
StatsDHookImpl& operator= (StatsDHookImpl const&);
std::shared_ptr <StatsDCollectorImp> m_impl;
HandlerType m_handler;
};
//------------------------------------------------------------------------------
class StatsDCounterImpl
: public CounterImpl
, public StatsDMetricBase
{
public:
StatsDCounterImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl);
~StatsDCounterImpl ();
void increment (CounterImpl::value_type amount);
void set_handler (HandlerType const& handler);
void flush ();
void do_increment (CounterImpl::value_type amount);
void do_process ();
private:
StatsDCounterImpl& operator= (StatsDCounterImpl const&);
std::shared_ptr <StatsDCollectorImp> m_impl;
std::string m_name;
CounterImpl::value_type m_value;
bool m_dirty;
HandlerType m_handler;
};
//------------------------------------------------------------------------------
class StatsDEventImpl
: public EventImpl
{
public:
StatsDEventImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl);
~StatsDEventImpl ();
void notify (EventImpl::value_type const& alue);
void do_notify (EventImpl::value_type const& value);
void do_process ();
private:
StatsDEventImpl& operator= (StatsDEventImpl const&);
std::shared_ptr <StatsDCollectorImp> m_impl;
std::string m_name;
};
//------------------------------------------------------------------------------
class StatsDGaugeImpl
: public GaugeImpl
, public StatsDMetricBase
{
public:
StatsDGaugeImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl);
~StatsDGaugeImpl ();
void set (GaugeImpl::value_type value);
void increment (GaugeImpl::difference_type amount);
void set_handler (HandlerType const& handler);
void flush ();
void do_set (GaugeImpl::value_type value);
void do_increment (GaugeImpl::difference_type amount);
void do_process ();
private:
StatsDGaugeImpl& operator= (StatsDGaugeImpl const&);
std::shared_ptr <StatsDCollectorImp> m_impl;
std::string m_name;
GaugeImpl::value_type m_last_value;
GaugeImpl::value_type m_value;
bool m_dirty;
HandlerType m_handler;
};
//------------------------------------------------------------------------------
class StatsDMeterImpl
: public MeterImpl
, public StatsDMetricBase
{
public:
explicit StatsDMeterImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl);
~StatsDMeterImpl ();
void increment (MeterImpl::value_type amount);
void set_handler (HandlerType const& handler);
void flush ();
void do_increment (MeterImpl::value_type amount);
void do_process ();
private:
StatsDMeterImpl& operator= (StatsDMeterImpl const&);
std::shared_ptr <StatsDCollectorImp> m_impl;
std::string m_name;
MeterImpl::value_type m_value;
bool m_dirty;
HandlerType m_handler;
};
//------------------------------------------------------------------------------
class StatsDCollectorImp
: public StatsDCollector
, public std::enable_shared_from_this <StatsDCollectorImp>
{
private:
enum
{
//max_packet_size = 484
max_packet_size = 1472
};
struct StateType
{
List <StatsDMetricBase> metrics;
};
typedef SharedData <StateType> State;
Journal m_journal;
IPAddress m_address;
std::string m_prefix;
boost::asio::io_service m_io_service;
boost::optional <boost::asio::io_service::work> m_work;
boost::asio::deadline_timer m_timer;
boost::asio::ip::udp::socket m_socket;
std::deque <std::string> m_data;
State m_state;
// Must come last for order of init
std::thread m_thread;
static boost::asio::ip::udp::endpoint to_endpoint (
IPAddress const &address)
{
if (address.isV4 ())
{
return boost::asio::ip::udp::endpoint (
boost::asio::ip::address_v4 (
address.v4().value), address.port ());
}
// VFALCO TODO IPv6 support
bassertfalse;
return boost::asio::ip::udp::endpoint (
boost::asio::ip::address_v6 (), 0);
}
public:
StatsDCollectorImp (
IPAddress const& address,
std::string const& prefix,
Journal journal)
: m_journal (journal)
, m_address (address)
, m_prefix (prefix)
, m_work (boost::ref (m_io_service))
, m_timer (m_io_service)
, m_socket (m_io_service)
, m_thread (&StatsDCollectorImp::run, this)
{
}
~StatsDCollectorImp ()
{
boost::system::error_code ec;
m_timer.cancel (ec);
m_work = boost::none;
m_thread.join ();
}
Hook make_hook (HookImpl::HandlerType const& handler)
{
return Hook (std::make_shared <detail::StatsDHookImpl> (
handler, shared_from_this ()));
}
Counter make_counter (std::string const& name)
{
return Counter (std::make_shared <detail::StatsDCounterImpl> (
name, shared_from_this ()));
}
Event make_event (std::string const& name)
{
return Event (std::make_shared <detail::StatsDEventImpl> (
name, shared_from_this ()));
}
Gauge make_gauge (std::string const& name)
{
return Gauge (std::make_shared <detail::StatsDGaugeImpl> (
name, shared_from_this ()));
}
Meter make_meter (std::string const& name)
{
return Meter (std::make_shared <detail::StatsDMeterImpl> (
name, shared_from_this ()));
}
//--------------------------------------------------------------------------
void add (StatsDMetricBase& metric)
{
State::Access state (m_state);
state->metrics.push_back (metric);
}
void remove (StatsDMetricBase& metric)
{
State::Access state (m_state);
state->metrics.erase (state->metrics.iterator_to (metric));
}
//--------------------------------------------------------------------------
boost::asio::io_service& get_io_service ()
{
return m_io_service;
}
std::string const& prefix () const
{
return m_prefix;
}
void do_post_buffer (std::string const& buffer)
{
#if BEAST_STATSDCOLLECTOR_TRACING_ENABLED
m_journal.trace << std::endl << buffer;
#endif
m_data.emplace_back (buffer);
}
void post_buffer (std::string&& buffer)
{
m_io_service.dispatch (std::bind (
&StatsDCollectorImp::do_post_buffer, this,
std::move (buffer)));
}
void on_send (boost::system::error_code ec, std::size_t)
{
if (ec == boost::asio::error::operation_aborted)
return;
if (ec)
{
m_journal.error <<
"async_send failed: " << ec.message();
return;
}
}
// Send what we have
void send_buffers ()
{
// Break up the array of strings into blocks
// that each fit into one UDP packet.
//
boost::system::error_code ec;
std::vector <boost::asio::const_buffer> buffers;
buffers.reserve (m_data.size ());
std::size_t size (0);
for (std::deque <std::string>::const_iterator iter (m_data.begin());
iter != m_data.end(); ++iter)
{
std::string const& buffer (*iter);
std::size_t const length (buffer.size ());
check_precondition (! buffer.empty ());
if (! buffers.empty () && (size + length) > max_packet_size)
{
m_socket.async_send (buffers, boost::bind (
&StatsDCollectorImp::on_send, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
buffers.clear ();
size = 0;
}
buffers.emplace_back (&buffer[0], length);
size += length;
}
if (! buffers.empty ())
{
m_socket.async_send (buffers, boost::bind (
&StatsDCollectorImp::on_send, this,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
}
m_data.clear ();
}
void set_timer ()
{
m_timer.expires_from_now (boost::posix_time::seconds (1));
m_timer.async_wait (boost::bind (
&StatsDCollectorImp::on_timer, this,
boost::asio::placeholders::error));
}
void on_timer (boost::system::error_code ec)
{
if (ec == boost::asio::error::operation_aborted)
return;
if (ec)
{
m_journal.error <<
"on_timer failed: " << ec.message();
return;
}
State::Access state (m_state);
for (List <StatsDMetricBase>::iterator iter (state->metrics.begin());
iter != state->metrics.end(); ++iter)
iter->do_process();
send_buffers ();
set_timer ();
}
void run ()
{
boost::system::error_code ec;
if (m_socket.connect (to_endpoint (m_address), ec))
{
m_journal.error <<
"Connect failed: " << ec.message();
return;
}
set_timer ();
m_io_service.run ();
m_socket.shutdown (
boost::asio::ip::udp::socket::shutdown_send, ec);
m_socket.close ();
m_io_service.poll ();
}
};
//------------------------------------------------------------------------------
StatsDHookImpl::StatsDHookImpl (HandlerType const& handler,
std::shared_ptr <StatsDCollectorImp> const& impl)
: m_impl (impl)
, m_handler (handler)
{
m_impl->add (*this);
}
StatsDHookImpl::~StatsDHookImpl ()
{
m_impl->remove (*this);
}
void StatsDHookImpl::do_process ()
{
m_handler ();
}
//------------------------------------------------------------------------------
StatsDCounterImpl::StatsDCounterImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl)
: m_impl (impl)
, m_name (name)
, m_value (0)
, m_dirty (false)
{
m_impl->add (*this);
}
StatsDCounterImpl::~StatsDCounterImpl ()
{
m_impl->remove (*this);
}
void StatsDCounterImpl::increment (CounterImpl::value_type amount)
{
m_impl->get_io_service().dispatch (std::bind (
&StatsDCounterImpl::do_increment,
std::static_pointer_cast <StatsDCounterImpl> (
shared_from_this ()), amount));
}
void StatsDCounterImpl::set_handler (HandlerType const& handler)
{
m_handler = handler;
}
void StatsDCounterImpl::flush ()
{
if (m_dirty)
{
m_dirty = false;
std::stringstream ss;
ss <<
m_impl->prefix() << "." <<
m_name << ":" <<
m_value << "|c" <<
"\n";
m_value = 0;
m_impl->post_buffer (ss.str ());
}
}
void StatsDCounterImpl::do_increment (CounterImpl::value_type amount)
{
m_value += amount;
m_dirty = true;
}
void StatsDCounterImpl::do_process ()
{
if (m_handler)
m_handler (Counter (shared_from_this ()));
flush ();
}
//------------------------------------------------------------------------------
StatsDEventImpl::StatsDEventImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl)
: m_impl (impl)
, m_name (name)
{
}
StatsDEventImpl::~StatsDEventImpl ()
{
}
void StatsDEventImpl::notify (EventImpl::value_type const& value)
{
m_impl->get_io_service().dispatch (std::bind (
&StatsDEventImpl::do_notify,
std::static_pointer_cast <StatsDEventImpl> (
shared_from_this ()), value));
}
void StatsDEventImpl::do_notify (EventImpl::value_type const& value)
{
std::stringstream ss;
ss <<
m_impl->prefix() << "." <<
m_name << ":" <<
value.count() << "|ms" <<
"\n";
m_impl->post_buffer (ss.str ());
}
//------------------------------------------------------------------------------
StatsDGaugeImpl::StatsDGaugeImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl)
: m_impl (impl)
, m_name (name)
, m_last_value (0)
, m_value (0)
, m_dirty (false)
{
m_impl->add (*this);
}
StatsDGaugeImpl::~StatsDGaugeImpl ()
{
m_impl->remove (*this);
}
void StatsDGaugeImpl::set (GaugeImpl::value_type value)
{
m_impl->get_io_service().dispatch (std::bind (
&StatsDGaugeImpl::do_set,
std::static_pointer_cast <StatsDGaugeImpl> (
shared_from_this ()), value));
}
void StatsDGaugeImpl::increment (GaugeImpl::difference_type amount)
{
m_impl->get_io_service().dispatch (std::bind (
&StatsDGaugeImpl::do_increment,
std::static_pointer_cast <StatsDGaugeImpl> (
shared_from_this ()), amount));
}
void StatsDGaugeImpl::set_handler (HandlerType const& handler)
{
m_handler = handler;
}
void StatsDGaugeImpl::flush ()
{
if (m_dirty)
{
m_dirty = false;
std::stringstream ss;
ss <<
m_impl->prefix() << "." <<
m_name << ":" <<
m_value << "|c" <<
"\n";
m_impl->post_buffer (ss.str ());
}
}
void StatsDGaugeImpl::do_set (GaugeImpl::value_type value)
{
m_value = value;
if (m_value != m_last_value)
{
m_last_value = m_value;
m_dirty = true;
}
}
void StatsDGaugeImpl::do_increment (GaugeImpl::difference_type amount)
{
GaugeImpl::value_type value (m_value);
if (amount > 0)
{
GaugeImpl::value_type const d (
static_cast <GaugeImpl::value_type> (amount));
value +=
(d >= std::numeric_limits <GaugeImpl::value_type>::max() - m_value)
? std::numeric_limits <GaugeImpl::value_type>::max() - m_value
: d;
}
else if (amount < 0)
{
GaugeImpl::value_type const d (
static_cast <GaugeImpl::value_type> (-amount));
value = (d >= value) ? 0 : value - d;
}
do_set (value);
}
void StatsDGaugeImpl::do_process ()
{
if (m_handler)
m_handler (Gauge (shared_from_this ()));
flush ();
}
//------------------------------------------------------------------------------
StatsDMeterImpl::StatsDMeterImpl (std::string const& name,
std::shared_ptr <StatsDCollectorImp> const& impl)
: m_impl (impl)
, m_name (name)
, m_value (0)
, m_dirty (false)
{
m_impl->add (*this);
}
StatsDMeterImpl::~StatsDMeterImpl ()
{
m_impl->remove (*this);
}
void StatsDMeterImpl::increment (MeterImpl::value_type amount)
{
m_impl->get_io_service().dispatch (std::bind (
&StatsDMeterImpl::do_increment,
std::static_pointer_cast <StatsDMeterImpl> (
shared_from_this ()), amount));
}
void StatsDMeterImpl::set_handler (HandlerType const& handler)
{
m_handler = handler;
}
void StatsDMeterImpl::flush ()
{
if (m_dirty)
{
m_dirty = false;
std::stringstream ss;
ss <<
m_impl->prefix() << "." <<
m_name << ":" <<
m_value << "|m" <<
"\n";
m_value = 0;
m_impl->post_buffer (ss.str ());
}
}
void StatsDMeterImpl::do_increment (MeterImpl::value_type amount)
{
m_value += amount;
m_dirty = true;
}
void StatsDMeterImpl::do_process ()
{
if (m_handler)
m_handler (Meter (shared_from_this ()));
flush ();
}
}
//------------------------------------------------------------------------------
std::shared_ptr <StatsDCollector> StatsDCollector::New (
IPAddress const& address, std::string const& prefix, Journal journal)
{
return std::make_shared <detail::StatsDCollectorImp> (
address, prefix, journal);
}
}
}

View File

@@ -1,448 +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_INTRUSIVE_FORWARDLIST_H_INCLUDED
#define BEAST_INTRUSIVE_FORWARDLIST_H_INCLUDED
#include "../Config.h"
#include "PointerTraits.h"
#include "../MPL.h"
#include <iterator>
// Ideas based on boost
namespace beast {
namespace intrusive {
//------------------------------------------------------------------------------
namespace detail {
// Holds the size field
struct SizeHolder
{
public:
typedef std::size_t size_type;
inline size_type size () const noexcept
{
return m_size;
}
inline void set (size_type new_size) noexcept
{
m_size = new_size;
}
inline void increment () noexcept
{
++m_size;
}
inline void decrement () noexcept
{
--m_size;
}
private:
size_type m_size;
};
}
//------------------------------------------------------------------------------
template <class VoidPointer>
struct ForwardListNode
{
typedef typename PointerTraits <VoidPointer>::template rebind_pointer <ForwardListNode>::type node_ptr;
node_ptr next;
};
//------------------------------------------------------------------------------
// Provides value_traits for when T derives from Node
template <class T, class NodeTraits>
struct DerivedValueTraits
{
typedef NodeTraits node_traits;
typedef T value_type;
typedef typename node_traits::node node;
typedef typename node_traits::node_ptr node_ptr;
typedef typename node_traits::const_node_ptr const_node_ptr;
typedef typename mpl::PointerToOther <node_ptr, T>::type pointer;
typedef typename mpl::PointerToOther <node_ptr, const T>::type const_pointer;
typedef typename PointerTraits <pointer>::reference reference;
typedef typename PointerTraits <const_pointer>::reference const_reference;
static node_ptr to_node_ptr (reference value)
{
return node_ptr (&value);
}
static const_node_ptr to_node_ptr (const_reference value)
{
return node_ptr (&value);
}
static pointer to_value_ptr (node_ptr const& n)
{
return pointer (&static_cast <value_type&> (*n));
}
static const_pointer to_value_ptr (const_node_ptr const &n)
{
return const_pointer (&static_cast <value_type const&> (*n));
}
};
//------------------------------------------------------------------------------
template <class VoidPointer, typename Tag>
struct ForwardListNodeTraits
{
typedef ForwardListNode <VoidPointer> node;
typedef typename PointerTraits <VoidPointer>::
template rebind_pointer <node> node_ptr;
typedef typename PointerTraits <VoidPointer>::
template rebind_pointer <node const> const_node_ptr;
static node_ptr get_next (const_node_ptr const& n)
{
return n->m_next;
}
static node_ptr get_next (node_ptr const& n)
{
return n->m_next;
}
static void set_next (node_ptr const& n, node_ptr const& next)
{
n->m_next = next;
}
};
//------------------------------------------------------------------------------
template <class Container, bool IsConst>
class ForwardListIterator
: public std::iterator <
std::forward_iterator_tag,
typename Container::value_type,
typename Container::difference_type,
typename mpl::IfCond <IsConst,
typename Container::const_pointer,
typename Container::pointer>::type,
typename mpl::IfCond <IsConst,
typename Container::const_reference,
typename Container::reference>::type>
{
protected:
typedef typename Container::value_traits value_traits;
typedef typename Container::node_traits node_traits;
typedef typename node_traits::node node;
typedef typename node_traits::node_ptr node_ptr;
typedef typename PointerTraits <node_ptr>::
template rebind_pointer <void>::type void_pointer;
public:
typedef typename Container::value_type value_type;
typedef typename mpl::IfCond <IsConst,
typename Container::const_pointer,
typename Container::pointer>::type pointer;
typedef typename mpl::IfCond <IsConst,
typename Container::const_reference,
typename Container::reference>::type reference;
ForwardListIterator ()
: m_node ()
{
}
explicit ForwardListIterator (ForwardListIterator <Container, false> const& other)
: m_node (other.pointed_node ())
{
}
node_ptr const& pointed_node () const noexcept
{
return m_node;
}
ForwardListIterator& operator= (node_ptr const& node)
{
m_node = node;
return static_cast <ForwardListIterator&> (*this);
}
ForwardListIterator& operator++ ()
{
m_node = node_traits::get_next (m_node);
return static_cast <ForwardListIterator&> (*this);
}
ForwardListIterator operator++ (int)
{
ForwardListIterator result (*this);
m_node = node_traits::get_next (m_node);
return result;
}
friend bool operator== (ForwardListIterator const& lhs,
ForwardListIterator const& rhs)
{
return lhs.m_node == rhs.m_node;
}
friend bool operator!= (ForwardListIterator const& lhs,
ForwardListIterator const& rhs)
{
return ! (lhs == rhs);
}
reference operator* () const
{
return *this->operator-> ();
}
pointer operator-> () const
{
return value_traits::to_value_ptr (m_node);
}
private:
node_ptr m_node;
};
//------------------------------------------------------------------------------
template <class NodeTraits>
class ForwardListAlgorithms
{
public:
typedef typename NodeTraits::node node;
typedef typename NodeTraits::node_ptr node_ptr;
typedef typename NodeTraits::const_node_ptr const_node_ptr;
typedef NodeTraits node_traits;
static void init (node_ptr const& n)
{
NodeTraits::set_next (n, node_ptr());
}
static bool unique (const_node_ptr const& this_node)
{
node_ptr next = NodeTraits::get_next (this_node);
return !next || next == this_node;
}
static void link_after (node_ptr const& prev_node, node_ptr const& this_node)
{
NodeTraits::set_next (this_node, NodeTraits::get_next (prev_node));
NodeTraits::set_next (prev_node, this_node);
}
static void unlink_after (node_ptr const& prev_node)
{
const_node_ptr this_node (NodeTraits::get_next (prev_node));
NodeTraits::set_next (prev_node, NodeTraits::get_next (this_node));
}
};
//------------------------------------------------------------------------------
/** Singly-linked intrusive list. */
template <typename T, typename Tag = void>
class ForwardList
{
public:
typedef DerivedValueTraits <T, ForwardListNodeTraits <T, Tag> >
value_traits;
typedef typename value_traits::pointer pointer;
typedef typename value_traits::const_pointer const_pointer;
typedef typename PointerTraits <pointer>::element_type value_type;
typedef typename PointerTraits <pointer>::reference reference;
typedef typename PointerTraits <pointer>::const_reference const_reference;
typedef typename PointerTraits <pointer>::difference_type difference_type;
typedef std::size_t size_type;
typedef ForwardListIterator <ForwardList, false> iterator;
typedef ForwardListIterator <ForwardList, true> const_iterator;
typedef typename value_traits::node_traits node_traits;
typedef typename node_traits::node node;
typedef typename node_traits::node_ptr node_ptr;
typedef typename node_traits::const_node_ptr const_node_ptr;
typedef ForwardListAlgorithms <node_traits> node_algorithms;
typedef node Node;
private:
typedef detail::SizeHolder size_traits;
void default_construct ()
{
get_size_traits ().set (size_type (0));
node_algorithms::init (this->get_root_node ());
}
node_ptr get_end_node ()
{
return node_ptr ();
}
const_node_ptr get_end_node () const
{
return const_node_ptr ();
}
node_ptr get_root_node ()
{
return PointerTraits <node_ptr>::pointer_to (m_root);
}
const_node_ptr get_root_node () const
{
return PointerTraits <const_node_ptr>::pointer_to (m_root);
}
size_traits& get_size_traits () noexcept
{
return m_size;
}
size_traits const& get_size_traits () const noexcept
{
return m_size;
}
static node_ptr uncast (const_node_ptr const& ptr)
{
return PointerTraits <node_ptr>::const_cast_from (ptr);
}
public:
ForwardList ()
{
default_construct ();
}
void clear ()
{
default_construct ();
}
void push_front (reference value)
{
node_ptr this_node (value_traits::to_node_ptr (value));
node_algorithms::link_after (this->get_root_node (), this_node);
this->get_size_traits ().increment ();
}
void pop_front ()
{
//node_ptr this_node (node_traits::get_next (this->get_root ()));
node_algorithms::unlink_after (this->get_root_node ());
this->get_size_traits ().decrement ();
}
reference front ()
{
return *value_traits::to_value_ptr (node_traits::get_next (this->get_root_node ()));
}
const_reference front () const
{
return *value_traits::to_value_ptr (uncat (node_traits::get_next (this->get_root_node ())));
}
iterator begin ()
{
return iterator (node_traits::get_next (this->get_root_node (), this));
}
const_iterator begin () const
{
return const_iterator (node_traits::get_next (this->get_root_node (), this));
}
const_iterator cbegin () const
{
return this->begin ();
}
iterator end ()
{
return iterator (this->get_end_node (), this);
}
const_iterator end () const
{
return const_iterator (this->get_end_node (), this);
}
const_iterator cend () const
{
return this->end ();
}
iterator before_begin ()
{
return iterator (this->get_root_node (), this);
}
const_iterator before_begin () const
{
return const_iterator (this->get_root_node (), this);
}
const_iterator cbefore_begin () const
{
return before_begin ();
}
bool empty () const
{
return node_algorithms::unique (this->get_root_node ());
}
iterator iterator_to (reference value)
{
return iterator (value_traits::to_node_ptr (value), this);
}
const_iterator iterator_to (const_reference value) const
{
return const_iterator (value_traits::to_node_ptr (const_cast <reference> (value)), this);
}
private:
node m_root;
size_traits m_size;
};
}
}
#endif

View File

@@ -1,187 +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_INTRUSIVE_INTRUSIVEARRAY_H_INCLUDED
#define BEAST_INTRUSIVE_INTRUSIVEARRAY_H_INCLUDED
#include "../Config.h"
#include <cstddef>
#include <iterator>
#include <stdexcept>
#include <vector>
namespace beast {
/** A run-time fixed size array that references outside storage.
The interface tries to follow std::vector as closely as possible within
the limitations of a fixed size and unowned storage.
*/
template <class T>
class IntrusiveArray
{
private:
T* m_begin;
T* m_end;
public:
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;
// Calling methods on a default constructed
// array results in undefined behavior!
//
IntrusiveArray ()
: m_begin (nullptr), m_end (nullptr)
{ }
IntrusiveArray (T* begin, T* end)
: m_begin (begin), m_end (end)
{ }
IntrusiveArray (IntrusiveArray const& other)
: m_begin (other.m_begin), m_end (other.m_end)
{ }
IntrusiveArray (std::vector <T> const& v)
: m_begin (&v.front()), m_end (&v.back()+1)
{ }
IntrusiveArray (std::vector <T>& v)
: m_begin (&v.front()), m_end (&v.back()+1)
{ }
IntrusiveArray& operator= (IntrusiveArray const& other)
{
m_begin = other.m_begin;
m_end = other.m_end;
return *this;
}
// iterators
iterator begin() { return m_begin; }
const_iterator begin() const { return m_begin; }
const_iterator cbegin() const { return m_begin; }
iterator end() { return m_end; }
const_iterator end() const { return m_end; }
const_iterator cend() const { return m_end; }
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 < size());
return m_begin[i];
}
const_reference operator[](size_type i) const
{
bassert (i < size());
return m_begin[i];
}
reference at(size_type i) { rangecheck(i); return m_begin[i]; }
const_reference at(size_type i) const { rangecheck(i); return m_begin[i]; }
reference front() { return m_begin[0]; }
reference back() { return m_end[-1]; }
const_reference front () const { return m_begin; }
const_reference back() const { return m_end[-1]; }
size_type size() const { return std::distance (m_begin, m_end); }
bool empty() const { return m_begin == m_end; }
T const* data() const { return m_begin; }
T* data() { return m_begin; }
T* c_array() { return m_begin; }
void assign (T const& value) { fill (value); }
void fill (T const& value)
{
std::fill_n (begin(), size(), value);
}
void clear ()
{
fill (T ());
}
void rangecheck (size_type i)
{
if (i >= size())
throw std::out_of_range ("IntrusiveArray<>: index out of range");
}
};
//------------------------------------------------------------------------------
template <class T>
bool operator== (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
if ((lhs.begin() == rhs.begin()) && (lhs.end() == rhs.end()))
return true;
if (lhs.size() != rhs.size())
return false;
return std::equal (lhs.begin(), lhs.end(), rhs.begin());
}
template <class T>
bool operator!= (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
return !(lhs==rhs);
}
template <class T>
bool operator< (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
if ((lhs.begin() == rhs.begin()) && (lhs.end() == rhs.end()))
return false;
return std::lexicographical_compare (lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
template <class T>
bool operator> (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
return rhs<lhs;
}
template <class T>
bool operator<= (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
return !(rhs<lhs);
}
template <class T>
bool operator>= (IntrusiveArray <T> const& lhs, IntrusiveArray <T> const& rhs)
{
return !(lhs<rhs);
}
}
#endif

View File

@@ -21,33 +21,44 @@
#define BEAST_INTRUSIVE_LIST_H_INCLUDED
#include "../Config.h"
#include "../mpl/CopyConst.h"
#include "../Uncopyable.h"
#include <iterator>
#include <type_traits>
namespace beast {
template <typename, typename>
class List;
namespace detail
namespace detail {
/** Copy `const` attribute from T to U if present. */
/** @{ */
template <typename T, typename U>
struct CopyConst
{
typedef typename std::remove_const <U>::type type;
};
template <typename T, typename U>
struct CopyConst <T const, U>
{
typedef typename std::remove_const <U>::type const type;
};
/** @} */
// This is the intrusive portion of the doubly linked list.
// One derivation per list that the object may appear on
// concurrently is required.
//
template <typename T, typename Tag>
class ListNode : public Uncopyable
class ListNode
{
private:
typedef T value_type;
template <typename, typename>
friend class List;
friend class List<T, Tag>;
template <typename>
friend class ListIterator;
@@ -63,11 +74,11 @@ class ListIterator : public std::iterator <
std::bidirectional_iterator_tag, std::size_t>
{
public:
typedef typename mpl::CopyConst<N, typename N::value_type>::type
value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef std::size_t size_type;
typedef typename detail::CopyConst <
N, typename N::value_type>::type value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef std::size_t size_type;
ListIterator (N* node = nullptr) noexcept
: m_node (node)

View File

@@ -20,11 +20,12 @@
#ifndef BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED
#define BEAST_INTRUSIVE_LOCKFREESTACK_H_INCLUDED
#include <iterator>
#include "../mpl/IfCond.h"
#include "../Atomic.h"
#include "../Uncopyable.h"
#include <iterator>
#include <type_traits>
namespace beast {
//------------------------------------------------------------------------------
@@ -35,23 +36,24 @@ class LockFreeStackIterator
std::forward_iterator_tag,
typename Container::value_type,
typename Container::difference_type,
typename mpl::IfCond <IsConst,
typename std::conditional <IsConst,
typename Container::const_pointer,
typename Container::pointer>::type,
typename mpl::IfCond <IsConst,
typename std::conditional <IsConst,
typename Container::const_reference,
typename Container::reference>::type>
{
protected:
typedef typename Container::Node Node;
typedef typename mpl::IfCond <IsConst, Node const*, Node*>::type NodePtr;
typedef typename std::conditional <
IsConst, Node const*, Node*>::type NodePtr;
public:
typedef typename Container::value_type value_type;
typedef typename mpl::IfCond <IsConst,
typedef typename std::conditional <IsConst,
typename Container::const_pointer,
typename Container::pointer>::type pointer;
typedef typename mpl::IfCond <IsConst,
typedef typename std::conditional <IsConst,
typename Container::const_reference,
typename Container::reference>::type reference;
@@ -199,6 +201,7 @@ public:
@return `true` if the stack was previously empty. If multiple threads
are attempting to push, only one will receive `true`.
*/
// VFALCO NOTE Fix this, shouldn't it be a reference like intrusive list?
bool push_front (Node* node)
{
bool first;

View File

@@ -1,89 +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_INTRUSIVE_POINTERTRAITS_H_INCLUDED
#define BEAST_INTRUSIVE_POINTERTRAITS_H_INCLUDED
#include <cstddef>
namespace beast {
namespace intrusive {
// an unspecialized PointerTraits is ill-defined
template <typename P>
struct PointerTraits;
// specializations to remove cv-qualifiers
template <typename P>
struct PointerTraits <P const> : PointerTraits <P> { };
template <typename P>
struct PointerTraits <P volatile> : PointerTraits <P> { };
template <typename P>
struct PointerTraits <P const volatile> : PointerTraits <P> { };
// specialization to remove a reference attribute
template <typename P>
struct PointerTraits <P&> : PointerTraits <P> { };
// specialization for raw pointers
template <typename T>
struct PointerTraits <T*>
{
typedef T element_type;
typedef T* pointer;
typedef T& reference;
typedef std::ptrdiff_t difference_type;
template <class U>
struct rebind_pointer
{
typedef U* type;
};
static pointer pointer_to (reference r)
{
return static_cast <pointer> (
static_cast <void*> (
const_cast <char*> (
&reinterpret_cast <const char&> (
r))));
}
template <class U>
static pointer static_cast_from (U* u)
{
return static_cast <pointer> (u);
}
template <class U>
static pointer const_cast_from (U* u)
{
return const_cast <pointer> (u);
}
template <class U>
static pointer dynamic_cast_from (U* u)
{
return dynamic_cast <pointer> (u);
}
};
}
}
#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_MAKE_UNIQUE_H_INCLUDED
#define BEAST_MAKE_UNIQUE_H_INCLUDED
#include <boost/config.hpp>
namespace std {
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
# ifdef _MSC_VER
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# endif
#endif
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
template <class T>
std::unique_ptr <T> make_unique ()
{
return std::unique_ptr <T> (new T);
}
template <class T, class P1>
std::unique_ptr <T> make_unique (P1&& p1)
{
return std::unique_ptr <T> (new T (std::forward <P1> (p1)));
}
template <class T, class P1, class P2>
std::unique_ptr <T> make_unique (P1&& p1, P2&& p2)
{
return std::unique_ptr <T> (new T (
std::forward <P1> (p1), std::forward <P2> (p2)));
}
template <class T, class P1, class P2, class P3>
std::unique_ptr <T> make_unique (P1&& p1, P2&& p2, P3&& p3)
{
return std::unique_ptr <T> (new T (
std::forward <P1> (p1), std::forward <P2> (p2), std::forward <P3> (p3)));
}
template <class T, class P1, class P2, class P3, class P4>
std::unique_ptr <T> make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4)
{
return std::unique_ptr <T> (new T (
std::forward <P1> (p1), std::forward <P2> (p2), std::forward <P3> (p3),
std::forward <P4> (p4)));
}
template <class T, class P1, class P2, class P3, class P4, class P5>
std::unique_ptr <T> make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4, P5&& p5)
{
return std::unique_ptr <T> (new T (
std::forward <P1> (p1), std::forward <P2> (p2), std::forward <P3> (p3),
std::forward <P4> (p4), std::forward <P5> (p5)));
}
template <class T, class P1, class P2, class P3, class P4, class P5, class P6>
std::unique_ptr <T> make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4, P5&& p5, P6&& p6)
{
return std::unique_ptr <T> (new T (
std::forward <P1> (p1), std::forward <P2> (p2), std::forward <P3> (p3),
std::forward <P4> (p4), std::forward <P5> (p5), std::forward <P6> (p6)));
}
//------------------------------------------------------------------------------
#else
template <class T, class... Args>
std::unique_ptr <T> make_unique (Args&&... args)
{
return std::unique_ptr <T> (new T (std::forward <Args> (args)...));
}
#endif
}
#endif

View File

@@ -1,68 +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_MPL_POINTERTOOTHERH_INCLUDED
#define BEAST_MPL_POINTERTOOTHERH_INCLUDED
namespace beast {
namespace mpl {
// Ideas based on boost
/** Declares a type which is a pointer or smart pointer to U, depending on T.
This works for smart pointer containers with up to three template
parameters. More specializations can be added for containers with
more than three template parameters.
*/
/** @{ */
template <class T, class U>
struct PointerToOther;
template <class T, class U,
template <class> class SmartPointer>
struct PointerToOther <SmartPointer <T>, U>
{
typedef SmartPointer <U> type;
};
template <class T, class T2, class U,
template <class, class> class SmartPointer>
struct PointerToOther <SmartPointer <T, T2>, U>
{
typedef SmartPointer <U, T2> type;
};
template <class T, class T2, class T3, class U,
template<class, class, class> class SmartPointer>
struct PointerToOther <SmartPointer <T, T2, T3>, U>
{
typedef SmartPointer <U, T2, T3> type;
};
template <class T, class U>
struct PointerToOther <T*, U>
{
typedef U* type;
};
/** @} */
}
}
#endif

View File

@@ -17,8 +17,12 @@
*/
//==============================================================================
#ifndef BEAST_ASIO_BASICS_BUFFERTYPE_H_INCLUDED
#define BEAST_ASIO_BASICS_BUFFERTYPE_H_INCLUDED
#ifndef BEAST_NET_BASICS_BUFFERTYPE_H_INCLUDED
#define BEAST_NET_BASICS_BUFFERTYPE_H_INCLUDED
#include <type_traits>
namespace beast {
/** General linear memory buffer.
This wraps the underlying buffer type and provides additional methods
@@ -30,13 +34,11 @@ template <bool IsConst>
class BufferType
{
private:
typedef typename mpl::IfCond <IsConst,
void const*,
void*>::type pointer_type;
typedef typename std::conditional <IsConst,
void const*, void*>::type pointer_type;
typedef typename mpl::IfCond <IsConst,
uint8 const,
uint8>::type byte_type;
typedef typename std::conditional <IsConst,
uint8 const, uint8>::type byte_type;
public:
typedef std::size_t size_type;
@@ -49,7 +51,7 @@ public:
template <bool OtherIsConst>
BufferType (BufferType <OtherIsConst> const& other)
: m_data (other.cast <pointer_type> ())
: m_data (other.template cast <pointer_type> ())
, m_size (other.size ())
{
}
@@ -71,7 +73,7 @@ public:
BufferType& operator= (
BufferType <OtherIsConst> const& other) noexcept
{
m_data = other.cast <pointer_type> ();
m_data = other.template cast <pointer_type> ();
m_size = other.size ();
return *this;
}
@@ -99,4 +101,6 @@ private:
};
/** @} */
}
#endif

View File

@@ -0,0 +1,125 @@
//------------------------------------------------------------------------------
/*
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_DYNAMICBUFFER_H_INCLUDED
#define BEAST_NET_DYNAMICBUFFER_H_INCLUDED
#include <vector>
namespace beast {
/** Disjoint, but efficient buffer storage for network operations.
This is designed to not require asio in order to compile.
*/
class DynamicBuffer
{
public:
enum
{
defaultBlocksize = 32 * 1024
};
typedef std::size_t size_type;
/** Create the dynamic buffer with the specified block size. */
explicit DynamicBuffer (size_type blocksize = defaultBlocksize);
DynamicBuffer (DynamicBuffer const& other);
~DynamicBuffer ();
DynamicBuffer& operator= (DynamicBuffer const& other);
/** Swap the contents of this buffer with another.
This is the preferred way to transfer ownership.
*/
void swapWith (DynamicBuffer& other);
/** Returns the size of the input sequence. */
size_type size () const;
/** Returns a buffer to the input sequence.
ConstBufferType must be constructible with this signature:
ConstBufferType (void const* buffer, size_type bytes);
*/
template <typename ConstBufferType>
std::vector <ConstBufferType> data () const
{
std::vector <ConstBufferType> buffers;
buffers.reserve (m_buffers.size());
size_type amount (m_size);
for (typename Buffers::const_iterator iter (m_buffers.begin());
amount > 0 && iter != m_buffers.end(); ++iter)
{
size_type const n (std::min (amount, m_blocksize));
buffers.push_back (ConstBufferType (*iter, n));
amount -= n;
}
return buffers;
}
/** Reserve space in the output sequence.
This also returns a buffer suitable for writing.
MutableBufferType must be constructible with this signature:
MutableBufferType (void* buffer, size_type bytes);
*/
template <typename MutableBufferType>
std::vector <MutableBufferType> prepare (size_type amount)
{
std::vector <MutableBufferType> buffers;
buffers.reserve (m_buffers.size());
reserve (amount);
size_type offset (m_size % m_blocksize);
for (Buffers::iterator iter = m_buffers.begin () + (m_size / m_blocksize);
amount > 0 && iter != m_buffers.end (); ++iter)
{
size_type const n (std::min (amount, m_blocksize - offset));
buffers.push_back (MutableBufferType (
((static_cast <char*> (*iter)) + offset), n));
amount -= n;
offset = 0;
}
return buffers;
}
/** Reserve space in the output sequence. */
void reserve (size_type n);
/** Move bytes from the output to the input sequence. */
void commit (size_type n);
/** Release memory while preserving the input sequence. */
void shrink_to_fit ();
/** Convert the entire buffer into a single string.
This is mostly for diagnostics, it defeats the purpose of the class!
*/
std::string to_string () const;
private:
typedef std::vector <void*> Buffers;
size_type m_blocksize;
size_type m_size;
Buffers m_buffers;
};
}
#endif

View File

@@ -17,21 +17,21 @@
*/
//==============================================================================
#ifndef BEAST_NET_IPENDPOINT_H_INCLUDED
#define BEAST_NET_IPENDPOINT_H_INCLUDED
#ifndef BEAST_NET_IPADDRESS_H_INCLUDED
#define BEAST_NET_IPADDRESS_H_INCLUDED
#include <string>
#include <ios>
#include <sstream>
#include "../CStdInt.h"
#include "../mpl/IfCond.h"
namespace beast
{
//------------------------------------------------------------------------------
namespace beast {
/** Represents an IP address (v4 or v6) and port combination. */
class IPEndpoint
class IPAddress
{
public:
enum Type
@@ -104,7 +104,8 @@ public:
class Proxy
{
public:
typedef typename mpl::IfCond <IsConst, uint32 const*, uint32*>::type Pointer;
typedef typename std::conditional <
IsConst, uint32 const*, uint32*>::type Pointer;
Proxy (int shift, Pointer value)
: m_shift (shift)
@@ -114,15 +115,15 @@ public:
operator uint8() const
{
return ((*m_value)>>m_shift)&0xff;
return ((*m_value)>>m_shift) & 0xff;
}
template <typename IntegralType>
Proxy& operator= (IntegralType v)
{
(*m_value)=
(*m_value)&(!((0xff)<<m_shift)) |
((v&0xff)<<m_shift);
(*m_value) =
( (*m_value) & (~((0xff)<<m_shift)) )
| ((v&0xff) << m_shift);
return *this;
}
@@ -216,62 +217,62 @@ public:
//--------------------------------------------------------------------------
/** Create an empty address. */
IPEndpoint ();
IPAddress ();
/** Create an IPv4 address with optional port. */
IPEndpoint (V4 const& v4, uint16 port = 0);
IPAddress (V4 const& v4, uint16 port = 0);
/** Create an IPv6 address with optional port. */
IPEndpoint (V6 const& v6, uint16 port = 0);
IPAddress (V6 const& v6, uint16 port = 0);
/** Create a copy of another IPEndpoint. */
IPEndpoint (IPEndpoint const& other);
/** Create a copy of another IPAddress. */
IPAddress (IPAddress const& other);
/** Copy assign another IPEndpoint. */
IPEndpoint& operator= (IPEndpoint const& other);
/** Copy assign another IPAddress. */
IPAddress& operator= (IPAddress const& other);
/** Create an IPEndpoint from a string.
/** Create an IPAddress from a string.
If a parsing error occurs, the endpoint will be empty.
*/
static IPEndpoint from_string (std::string const& s);
static IPAddress from_string (std::string const& s);
/** Create an IPEndpoint from a string.
/** Create an IPAddress from a string.
If a parsing error occurs, the endpoint will be empty.
This recognizes an alternate form of the text. Instead of a colon
separating the optional port specification, any amount of whitespace
is allowed.
*/
static IPEndpoint from_string_altform (std::string const& s);
static IPAddress from_string_altform (std::string const& s);
/** Copy assign an IPv4 address.
The port is set to zero.
*/
IPEndpoint& operator= (V4 const& address);
IPAddress& operator= (V4 const& address);
/** Copy assign an IPv6 address.
The port is set to zero.
*/
IPEndpoint& operator= (V6 const& address);
IPAddress& operator= (V6 const& address);
/** Returns a new IPEndpoint with this address, and the given port. */
IPEndpoint withPort (uint16 port) const;
/** Returns a new IPAddress with this address, and the given port. */
IPAddress withPort (uint16 port) const;
/** Returns `true` if this IPEndpoint refers to nothing. */
/** Returns `true` if this IPAddress refers to nothing. */
bool empty () const;
/** Returns `true` if this IPEndpoint refers to nothing. */
/** Returns `true` if this IPAddress refers to nothing. */
bool isNull () const;
/** Returns `true` if this IPEndpoint refers to something. */
/** Returns `true` if this IPAddress refers to something. */
bool isNotNull () const;
/** Returns the type of this IPEndpoint. */
/** Returns the type of this IPAddress. */
Type type () const;
/** Returns `true` if this IPEndpoint represents an IPv4 address. */
/** Returns `true` if this IPAddress represents an IPv4 address. */
bool isV4 () const;
/** Returns `true` if this IPEndpoint represents an IPv6 address. */
/** Returns `true` if this IPAddress represents an IPv6 address. */
bool isV6 () const;
/** Returns the IPv4 address.
@@ -310,18 +311,20 @@ public:
operator std::string () const;
/** @} */
struct hasher
typedef std::hash <IPAddress> hasher;
struct key_equal;
/** LessThanComparable functor that ignores the port. */
struct LessWithoutPort
{
std::size_t operator() (IPEndpoint const& value) const
{
std::size_t hash (0);
if (value.isV4())
hash = V4::hasher() (value.v4());
else if (value.isV6())
hash = V6::hasher() (value.v6());
hash += value.port();
return hash;
}
bool operator() (IPAddress const& lhs, IPAddress const& rhs) const;
};
/** EqualityComparable functor that ignores the port. */
struct EqualWithoutPort
{
bool operator() (IPAddress const& lhs, IPAddress const& rhs) const;
};
private:
@@ -333,36 +336,75 @@ private:
/** Comparison. */
/** @{ */
int compare (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator== (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator!= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator< (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator<= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator> (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator>= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs);
bool operator== (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
bool operator!= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
bool operator< (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
bool operator<= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
bool operator> (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
bool operator>= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs);
int compare (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator== (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator!= (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator< (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator<= (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator> (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator>= (IPEndpoint const& lhs, IPEndpoint const& rhs);
bool operator== (IPAddress const& lhs, IPAddress const& rhs);
bool operator!= (IPAddress const& lhs, IPAddress const& rhs);
bool operator< (IPAddress const& lhs, IPAddress const& rhs);
bool operator<= (IPAddress const& lhs, IPAddress const& rhs);
bool operator> (IPAddress const& lhs, IPAddress const& rhs);
bool operator>= (IPAddress const& lhs, IPAddress const& rhs);
/** Output stream conversions. */
/** @{ */
std::ostream& operator<< (std::ostream& os, IPEndpoint::V4 const& addr);
std::ostream& operator<< (std::ostream& os, IPEndpoint::V6 const& addr);
std::ostream& operator<< (std::ostream& os, IPEndpoint const& ep);
std::ostream& operator<< (std::ostream& os, IPAddress::V4 const& addr);
std::ostream& operator<< (std::ostream& os, IPAddress::V6 const& addr);
std::ostream& operator<< (std::ostream& os, IPAddress const& ep);
/** @} */
/** Input stream conversions. */
/** @{ */
std::istream& operator>> (std::istream& is, IPEndpoint::V4& addr);
std::istream& operator>> (std::istream& is, IPEndpoint& ep);
//std::istream& operator>> (std::istream &is, IPEndpoint::V6&);
std::istream& operator>> (std::istream& is, IPAddress::V4& addr);
std::istream& operator>> (std::istream& is, IPAddress& ep);
//std::istream& operator>> (std::istream &is, IPAddress::V6&);
/** @} */
struct IPAddress::key_equal
{
bool operator() (IPAddress const& lhs, IPAddress const& rhs) const
{
return lhs == rhs;
}
};
inline bool IPAddress::LessWithoutPort::operator() (
IPAddress const& lhs, IPAddress const& rhs) const
{
return lhs.withPort (0) < rhs.withPort (0);
}
inline bool IPAddress::EqualWithoutPort::operator() (
IPAddress const& lhs, IPAddress const& rhs) const
{
return lhs.withPort (0) == rhs.withPort (0);
}
}
//------------------------------------------------------------------------------
namespace std {
template <>
struct hash <beast::IPAddress>
{
std::size_t operator() (beast::IPAddress const& value) const
{
std::size_t hash (0);
if (value.isV4())
hash = beast::IPAddress::V4::hasher() (value.v4());
else if (value.isV6())
hash = beast::IPAddress::V6::hasher() (value.v6());
hash += value.port();
return hash;
}
};
}
#endif

View File

@@ -23,4 +23,5 @@
#include "../../modules/beast_core/beast_core.h" // for UnitTest
#include "impl/IPEndpoint.cpp"
#include "impl/DynamicBuffer.cpp"
#include "impl/IPAddress.cpp"

View File

@@ -0,0 +1,91 @@
//------------------------------------------------------------------------------
/*
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 <memory>
#include "../DynamicBuffer.h"
namespace beast {
DynamicBuffer::DynamicBuffer (size_type blocksize)
: m_blocksize (blocksize)
, m_size (0)
{
}
DynamicBuffer::~DynamicBuffer ()
{
for (Buffers::iterator iter (m_buffers.begin());
iter != m_buffers.end(); ++iter)
free (*iter);
}
void DynamicBuffer::swapWith (DynamicBuffer& other)
{
std::swap (m_blocksize, other.m_blocksize);
std::swap (m_size, other.m_size);
m_buffers.swap (other.m_buffers);
}
void DynamicBuffer::commit (size_type n)
{
m_size += n;
bassert (m_size <= m_buffers.size () * m_blocksize);
}
DynamicBuffer::size_type DynamicBuffer::size () const
{
return m_size;
}
void DynamicBuffer::reserve (size_type n)
{
size_type count ((m_size + n + m_blocksize - 1) / m_blocksize);
if (count > m_buffers.size ())
for (count -= m_buffers.size (); count-- > 0;)
m_buffers.push_back (malloc (m_blocksize));
}
void DynamicBuffer::shrink_to_fit ()
{
size_type const count ((m_size + m_blocksize - 1) / m_blocksize);
while (m_buffers.size () > count)
{
free (m_buffers.back ());
m_buffers.erase (m_buffers.end () - 1);
}
}
std::string DynamicBuffer::to_string () const
{
std::string (s);
s.reserve (m_size);
std::size_t amount (m_size);
for (Buffers::const_iterator iter (m_buffers.begin());
amount > 0 && iter != m_buffers.end(); ++iter)
{
char const* p (static_cast <char const*> (*iter));
size_type const n (std::min (amount, m_blocksize));
s.append (p, p + n);
amount -= n;
}
return s;
}
}

View File

@@ -17,43 +17,42 @@
*/
//==============================================================================
#include "../IPEndpoint.h"
#include "../IPAddress.h"
namespace beast
{
namespace beast {
IPEndpoint::V4::V4 ()
IPAddress::V4::V4 ()
: value (0)
{
}
IPEndpoint::V4::V4 (uint32 value_)
IPAddress::V4::V4 (uint32 value_)
: value (value_)
{
}
IPEndpoint::V4::V4 (uint8 a, uint8 b, uint8 c, uint8 d)
IPAddress::V4::V4 (uint8 a, uint8 b, uint8 c, uint8 d)
: value ((a<<24)|(b<<16)|(c<<8)|d)
{
}
IPEndpoint::V4::V4 (V4 const& other)
IPAddress::V4::V4 (V4 const& other)
: value (other.value)
{
}
IPEndpoint::V4& IPEndpoint::V4::operator= (V4 const& other)
IPAddress::V4& IPAddress::V4::operator= (V4 const& other)
{
value = other.value;
return *this;
}
IPEndpoint::V4 IPEndpoint::V4::localBroadcastAddress ()
IPAddress::V4 IPAddress::V4::localBroadcastAddress ()
{
return V4 (0xffffffff);
}
IPEndpoint::V4 IPEndpoint::V4::broadcastAddress () const
IPAddress::V4 IPAddress::V4::broadcastAddress () const
{
switch (getClass())
{
@@ -68,18 +67,18 @@ IPEndpoint::V4 IPEndpoint::V4::broadcastAddress () const
return V4();
}
char IPEndpoint::V4::getClass () const
char IPAddress::V4::getClass () const
{
static char const* table = "AAAABBCD";
return table[(value&0xE0000000)>>29];
}
bool IPEndpoint::V4::isPublic () const
bool IPAddress::V4::isPublic () const
{
return !isPrivate() && !isBroadcast() && !isMulticast();
}
bool IPEndpoint::V4::isPrivate () const
bool IPAddress::V4::isPrivate () const
{
return
((value&0xff000000)==0x0a000000) || // Prefix /8, 10.##.#.#
@@ -88,22 +87,22 @@ bool IPEndpoint::V4::isPrivate () const
isLoopback();
}
bool IPEndpoint::V4::isBroadcast () const
bool IPAddress::V4::isBroadcast () const
{
return (value == broadcastAddress().value);
}
bool IPEndpoint::V4::isMulticast () const
bool IPAddress::V4::isMulticast () const
{
return getClass() == 'D';
}
bool IPEndpoint::V4::isLoopback () const
bool IPAddress::V4::isLoopback () const
{
return (value&0xff000000)==0x7f000000;
}
IPEndpoint::V4::Proxy <true> IPEndpoint::V4::operator[] (std::size_t index) const
IPAddress::V4::Proxy <true> IPAddress::V4::operator[] (std::size_t index) const
{
switch (index)
{
@@ -116,7 +115,7 @@ IPEndpoint::V4::Proxy <true> IPEndpoint::V4::operator[] (std::size_t index) cons
};
};
IPEndpoint::V4::Proxy <false> IPEndpoint::V4::operator[] (std::size_t index)
IPAddress::V4::Proxy <false> IPAddress::V4::operator[] (std::size_t index)
{
switch (index)
{
@@ -129,7 +128,7 @@ IPEndpoint::V4::Proxy <false> IPEndpoint::V4::operator[] (std::size_t index)
};
};
std::string IPEndpoint::V4::to_string () const
std::string IPAddress::V4::to_string () const
{
std::string s;
s.reserve (15);
@@ -140,33 +139,33 @@ std::string IPEndpoint::V4::to_string () const
return s;
}
IPEndpoint::V4::operator std::string () const
IPAddress::V4::operator std::string () const
{
return to_string();
}
//------------------------------------------------------------------------------
IPEndpoint::IPEndpoint ()
IPAddress::IPAddress ()
: m_type (none)
{
}
IPEndpoint::IPEndpoint (V4 const& v4, uint16 port)
IPAddress::IPAddress (V4 const& v4, uint16 port)
: m_type (ipv4)
, m_port (port)
, m_v4 (v4)
{
}
IPEndpoint::IPEndpoint (V6 const& v6, uint16 port)
IPAddress::IPAddress (V6 const& v6, uint16 port)
: m_type (ipv6)
, m_port (port)
, m_v6 (v6)
{
}
IPEndpoint::IPEndpoint (IPEndpoint const& other)
IPAddress::IPAddress (IPAddress const& other)
: m_type (other.m_type)
, m_port (other.m_port)
{
@@ -180,7 +179,7 @@ IPEndpoint::IPEndpoint (IPEndpoint const& other)
};
}
IPEndpoint& IPEndpoint::operator= (IPEndpoint const& other)
IPAddress& IPAddress::operator= (IPAddress const& other)
{
m_type = other.m_type;
m_port = other.m_port;
@@ -195,17 +194,17 @@ IPEndpoint& IPEndpoint::operator= (IPEndpoint const& other)
return *this;
}
IPEndpoint IPEndpoint::from_string (std::string const& s)
IPAddress IPAddress::from_string (std::string const& s)
{
std::stringstream is (s);
IPEndpoint ep;
IPAddress ep;
is >> ep;
if (! is.fail() && is.rdbuf()->in_avail() == 0)
return ep;
return IPEndpoint();
return IPAddress();
}
IPEndpoint& IPEndpoint::operator= (V4 const& address)
IPAddress& IPAddress::operator= (V4 const& address)
{
m_type = ipv4;
m_port = 0;
@@ -213,7 +212,7 @@ IPEndpoint& IPEndpoint::operator= (V4 const& address)
return *this;
}
IPEndpoint& IPEndpoint::operator= (V6 const& address)
IPAddress& IPAddress::operator= (V6 const& address)
{
m_type = ipv6;
m_port = 0;
@@ -221,66 +220,66 @@ IPEndpoint& IPEndpoint::operator= (V6 const& address)
return *this;
}
IPEndpoint IPEndpoint::withPort (uint16 port) const
IPAddress IPAddress::withPort (uint16 port) const
{
switch (m_type)
{
case ipv4: return IPEndpoint (m_v4, port);
case ipv6: return IPEndpoint (m_v6, port);
case ipv4: return IPAddress (m_v4, port);
case ipv6: return IPAddress (m_v6, port);
default:
case none:
bassertfalse;
break;
};
return IPEndpoint();
return IPAddress();
}
bool IPEndpoint::empty () const
bool IPAddress::empty () const
{
return m_type == none;
}
bool IPEndpoint::isNull () const
bool IPAddress::isNull () const
{
return empty ();
}
bool IPEndpoint::isNotNull () const
bool IPAddress::isNotNull () const
{
return ! empty ();
}
IPEndpoint::Type IPEndpoint::type () const
IPAddress::Type IPAddress::type () const
{
return m_type;
}
bool IPEndpoint::isV4 () const
bool IPAddress::isV4 () const
{
return m_type == ipv4;
}
bool IPEndpoint::isV6 () const
bool IPAddress::isV6 () const
{
return m_type == ipv6;
}
IPEndpoint::V4 const& IPEndpoint::v4 () const
IPAddress::V4 const& IPAddress::v4 () const
{
return m_v4;
}
IPEndpoint::V6 const& IPEndpoint::v6 () const
IPAddress::V6 const& IPAddress::v6 () const
{
return m_v6;
}
uint16 IPEndpoint::port () const
uint16 IPAddress::port () const
{
return m_port;
}
bool IPEndpoint::isPublic () const
bool IPAddress::isPublic () const
{
switch (m_type)
{
@@ -294,7 +293,7 @@ bool IPEndpoint::isPublic () const
return false;
}
bool IPEndpoint::isPrivate () const
bool IPAddress::isPrivate () const
{
switch (m_type)
{
@@ -308,7 +307,7 @@ bool IPEndpoint::isPrivate () const
return false;
}
bool IPEndpoint::isBroadcast () const
bool IPAddress::isBroadcast () const
{
switch (m_type)
{
@@ -322,7 +321,7 @@ bool IPEndpoint::isBroadcast () const
return false;
}
bool IPEndpoint::isMulticast () const
bool IPAddress::isMulticast () const
{
switch (m_type)
{
@@ -336,7 +335,7 @@ bool IPEndpoint::isMulticast () const
return false;
}
bool IPEndpoint::isLoopback () const
bool IPAddress::isLoopback () const
{
switch (m_type)
{
@@ -350,7 +349,7 @@ bool IPEndpoint::isLoopback () const
return false;
}
std::string IPEndpoint::to_string () const
std::string IPAddress::to_string () const
{
switch (m_type)
{
@@ -376,7 +375,7 @@ std::string IPEndpoint::to_string () const
return std::string();
}
IPEndpoint::operator std::string () const
IPAddress::operator std::string () const
{
return to_string();
}
@@ -446,7 +445,7 @@ detail::integer_holder <IntType> integer (IntType& i)
}
/** Parse IPv4 address. */
std::istream& operator>> (std::istream &is, IPEndpoint::V4& addr)
std::istream& operator>> (std::istream &is, IPAddress::V4& addr)
{
uint8 octets [4];
is >> parse::integer (octets [0]);
@@ -458,16 +457,16 @@ std::istream& operator>> (std::istream &is, IPEndpoint::V4& addr)
if (!is)
return is;
}
addr = IPEndpoint::V4 (octets[0], octets[1], octets[2], octets[3]);
addr = IPAddress::V4 (octets[0], octets[1], octets[2], octets[3]);
return is;
}
/** Parse an IPEndpoint.
/** Parse an IPAddress.
@note Currently only IPv4 addresses are supported.
*/
std::istream& operator>> (std::istream &is, IPEndpoint& ep)
std::istream& operator>> (std::istream &is, IPAddress& ep)
{
IPEndpoint::V4 v4;
IPAddress::V4 v4;
is >> v4;
if (is.fail())
return is;
@@ -479,7 +478,7 @@ std::istream& operator>> (std::istream &is, IPEndpoint& ep)
if (c != ':')
{
is.unget();
ep = IPEndpoint (v4);
ep = IPAddress (v4);
return is;
}
@@ -488,23 +487,23 @@ std::istream& operator>> (std::istream &is, IPEndpoint& ep)
if (is.fail())
return is;
ep = IPEndpoint (v4, port);
ep = IPAddress (v4, port);
}
else
{
ep = IPEndpoint (v4);
ep = IPAddress (v4);
}
return is;
}
//------------------------------------------------------------------------------
IPEndpoint IPEndpoint::from_string_altform (std::string const& s)
IPAddress IPAddress::from_string_altform (std::string const& s)
{
// Accept the regular form if it parses
{
IPEndpoint ep (IPEndpoint::from_string (s));
IPAddress ep (IPAddress::from_string (s));
if (! ep.empty())
return ep;
}
@@ -512,16 +511,16 @@ IPEndpoint IPEndpoint::from_string_altform (std::string const& s)
// Now try the alt form
std::stringstream is (s);
IPEndpoint::V4 v4;
IPAddress::V4 v4;
is >> v4;
if (! is.fail())
{
IPEndpoint ep (v4);
IPAddress ep (v4);
if (is.rdbuf()->in_avail()>0)
{
if (! parse::expect (is, ' '))
return IPEndpoint();
return IPAddress();
while (is.rdbuf()->in_avail()>0)
{
@@ -537,7 +536,7 @@ IPEndpoint IPEndpoint::from_string_altform (std::string const& s)
uint16 port;
is >> port;
if (is.fail())
return IPEndpoint();
return IPAddress();
return ep.withPort (port);
}
@@ -550,77 +549,100 @@ IPEndpoint IPEndpoint::from_string_altform (std::string const& s)
// Could be V6 here...
return IPEndpoint();
return IPAddress();
}
//------------------------------------------------------------------------------
int compare (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs)
bool operator== (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return lhs.value == rhs.value; }
bool operator< (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return lhs.value < rhs.value; }
bool operator!= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return ! (lhs == rhs); }
bool operator> (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return rhs < lhs; }
bool operator<= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return ! (rhs < lhs); }
bool operator>= (IPAddress::V4 const& lhs, IPAddress::V4 const& rhs)
{ return ! (lhs < rhs); }
//------------------------------------------------------------------------------
bool operator== (IPAddress const& lhs, IPAddress const& rhs)
{
if (lhs.value < rhs.value)
return -1;
else if (lhs.value > rhs.value)
return 1;
return 0;
}
bool operator== (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) == 0; }
bool operator!= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) != 0; }
bool operator< (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) < 0; }
bool operator<= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) <= 0; }
bool operator> (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) > 0; }
bool operator>= (IPEndpoint::V4 const& lhs, IPEndpoint::V4 const& rhs) { return compare (lhs, rhs) >= 0; }
static int type_compare (IPEndpoint const& lhs, IPEndpoint const& rhs)
{
if (lhs.type() < rhs.type())
return -1;
else if (lhs.type() > rhs.type())
return 1;
return 0;
}
int compare (IPEndpoint const& lhs, IPEndpoint const& rhs)
{
int const tc (type_compare (lhs, rhs));
if (tc < 0)
return -1;
else if (tc > 0)
return 1;
if (lhs.type() != rhs.type())
return false;
switch (lhs.type())
{
case IPEndpoint::none: return 0;
case IPEndpoint::ipv4: return compare (lhs.v4(), rhs.v4());
case IPAddress::none: return true;
case IPAddress::ipv4:
if (lhs.v4() != rhs.v4())
return false;
if (lhs.port() != rhs.port())
return false;
return true;
case IPAddress::ipv6:
default:
case IPEndpoint::ipv6:
break;
};
bassertfalse;
return 0;
bassertfalse;
}
return false;
}
bool operator== (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) == 0; }
bool operator!= (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) != 0; }
bool operator< (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) < 0; }
bool operator<= (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) <= 0; }
bool operator> (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) > 0; }
bool operator>= (IPEndpoint const& lhs, IPEndpoint const& rhs) { return compare (lhs, rhs) >= 0; }
bool operator< (IPAddress const& lhs, IPAddress const& rhs)
{
if (lhs.type() > rhs.type())
return false;
if (lhs.type() < rhs.type())
return true;
switch (lhs.type())
{
case IPAddress::none: return true;
case IPAddress::ipv4:
if (lhs.v4() < rhs.v4())
return true;
if (lhs.v4() > rhs.v4())
return false;
return lhs.port() < rhs.port();
case IPAddress::ipv6:
default:
bassertfalse;
}
return false;
}
std::ostream& operator<< (std::ostream &os, IPEndpoint::V4 const& addr)
bool operator!= (IPAddress const& lhs, IPAddress const& rhs)
{ return ! (lhs == rhs); }
bool operator> (IPAddress const& lhs, IPAddress const& rhs)
{ return rhs < lhs; }
bool operator<= (IPAddress const& lhs, IPAddress const& rhs)
{ return ! (rhs < lhs); }
bool operator>= (IPAddress const& lhs, IPAddress const& rhs)
{ return ! (lhs < rhs); }
//------------------------------------------------------------------------------
std::ostream& operator<< (std::ostream &os, IPAddress::V4 const& addr)
{
os << addr.to_string();
return os;
}
std::ostream& operator<< (std::ostream &os, IPEndpoint::V6 const& addr)
std::ostream& operator<< (std::ostream &os, IPAddress::V6 const& addr)
{
os << addr.to_string();
return os;
}
std::ostream& operator<< (std::ostream &os, IPEndpoint const& ep)
std::ostream& operator<< (std::ostream &os, IPAddress const& ep)
{
os << ep.to_string();
return os;
@@ -628,10 +650,10 @@ std::ostream& operator<< (std::ostream &os, IPEndpoint const& ep)
//------------------------------------------------------------------------------
class IPEndpointTests : public UnitTest
class IPAddressTests : public UnitTest
{
public:
bool parse (char const* text, IPEndpoint& ep)
bool parse (char const* text, IPAddress& ep)
{
std::string input (text);
std::istringstream stream (input);
@@ -641,14 +663,14 @@ public:
void shouldPass (char const* text)
{
IPEndpoint ep;
IPAddress ep;
expect (parse (text, ep));
expect (ep.to_string() == std::string(text));
}
void shouldFail (char const* text)
{
IPEndpoint ep;
IPAddress ep;
unexpected (parse (text, ep));
}
@@ -669,13 +691,33 @@ public:
shouldFail ("1.2.3:80");
}
void testV4Proxy ()
{
beginTestCase("v4 proxy");
IPAddress::V4 v4 (10, 0, 0, 1);
expect (v4[0]==10);
expect (v4[1]==0);
expect (v4[2]==0);
expect (v4[3]==1);
expect((!((0xff)<<16)) == 0x00000000);
expect((~((0xff)<<16)) == 0xff00ffff);
v4[1] = 10;
expect (v4[0]==10);
expect (v4[1]==10);
expect (v4[2]==0);
expect (v4[3]==1);
}
void testPrint ()
{
beginTestCase ("addresses");
IPEndpoint ep;
IPAddress ep;
ep = IPEndpoint(IPEndpoint::V4(127,0,0,1)).withPort (80);
ep = IPAddress(IPAddress::V4(127,0,0,1)).withPort (80);
expect (!ep.isPublic());
expect ( ep.isPrivate());
expect (!ep.isBroadcast());
@@ -683,7 +725,7 @@ public:
expect ( ep.isLoopback());
expect (ep.to_string() == "127.0.0.1:80");
ep = IPEndpoint::V4(10,0,0,1);
ep = IPAddress::V4(10,0,0,1);
expect ( ep.v4().getClass() == 'A');
expect (!ep.isPublic());
expect ( ep.isPrivate());
@@ -692,7 +734,7 @@ public:
expect (!ep.isLoopback());
expect (ep.to_string() == "10.0.0.1");
ep = IPEndpoint::V4(166,78,151,147);
ep = IPAddress::V4(166,78,151,147);
expect ( ep.isPublic());
expect (!ep.isPrivate());
expect (!ep.isBroadcast());
@@ -705,13 +747,14 @@ public:
{
testPrint();
testParse();
testV4Proxy();
}
IPEndpointTests () : UnitTest ("IPEndpoint", "beast")
IPAddressTests () : UnitTest ("IPAddress", "beast")
{
}
};
static IPEndpointTests ipEndpointTests;
static IPAddressTests ipEndpointTests;
}

View File

@@ -0,0 +1,255 @@
//------------------------------------------------------------------------------
/*
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_SMARTPTR_ABSTRACTOBJECT_H_INCLUDED
#define BEAST_SMARTPTR_ABSTRACTOBJECT_H_INCLUDED
#include <list>
#include <memory>
#include <stdexcept>
#include <typeinfo>
#include "../Atomic.h"
#include "../Config.h"
#include "../Uncopyable.h"
#include "../intrusive/LockFreeStack.h"
namespace beast {
namespace abstract {
/** Base for all abstract interfaces. */
class BasicInterface
{
public:
virtual ~BasicInterface() { }
/** Returns the unique ID of this interface type.
The ID must be the same for all instances of the
derived interface.
*/
virtual std::size_t id () const = 0;
/** Returns the unique ID associated with the Derived type. */
template <typename Derived>
static std::size_t type_id ()
{
static std::size_t const value (next_id ());
return value;
}
private:
// Returns a new unique id
static std::size_t next_id ()
{
static Atomic <std::size_t> value;
return ++value;
}
};
//------------------------------------------------------------------------------
/** Base for a derived interface. */
template <typename Derived>
class Interface : public BasicInterface
{
public:
// Returns the unique ID for all instances of Derived
std::size_t id () const
{
return BasicInterface::type_id <Derived> ();
}
};
//------------------------------------------------------------------------------
/** Factory for producing interfaces on a specific object. */
template <typename Object>
class Factory
{
public:
class Callback;
private:
struct Item;
typedef LockFreeStack <Item> Items;
struct Item : Items::Node
{
Item (Callback& owner_)
: owner (owner_)
{ }
Callback& owner;
};
Items m_items;
public:
/** Base for hooking object creation. */
class Callback
{
public:
/** Create the callback and insert it into the factory. */
explicit Callback (Factory& factory)
: m_item (*this)
{
factory.m_items.push_front (&m_item);
}
/** Called when Object is created.
Object must be fully constructed. The order of calls to callbacks
is not defined.
*/
virtual void create_interfaces (Object& object) = 0;
private:
Item m_item;
};
/** Invokes the callbacks for an instance of Object.
This must be called after the object is fully constructed, for example
as the last statement in the constructor.
*/
void create_interfaces (Object& object)
{
for (typename Items::iterator iter (m_items.begin());
iter != m_items.end(); ++iter)
iter->owner.create_interfaces (object);
}
};
//------------------------------------------------------------------------------
/** A container of polymorphic interfaces.
The Object type associated with the container is used to gain access
to the corresponding factory.
*/
template <typename Object>
class Interfaces : public Uncopyable
{
public:
Interfaces ()
{
}
/** Returns a reference to the specified interface.
The interface must exist in the container or an exception is thrown.
Requirements:
Derived must be a subclass of Interface
*/
/** @{ */
template <typename Derived>
Derived& get_interface()
{
Derived* derived (find_interface <Derived> ());
if (derived == nullptr)
throw std::bad_cast ();
return *derived;
}
template <typename Derived>
Derived const& get_interface() const
{
Derived const* derived (find_interface <Derived> ());
if (derived == nullptr)
throw std::bad_cast ();
return *derived;
}
/** @} */
/** Returns a pointer to the specified interface.
If the interface does not exist, `nullptr` is returned.
Requirements:
Derived must be a subclass of Interface
*/
/** @{ */
template <typename Derived>
Derived* find_interface()
{
std::size_t const id = BasicInterface::type_id <Derived> ();
for (typename Set::iterator iter (m_set.begin());
iter != m_set.end(); ++iter)
{
if ((*iter)->id() == id)
{
Derived* const derived (
dynamic_cast <Derived*> (iter->get()));
check_postcondition (derived != nullptr);
return derived;
}
}
return nullptr;
}
template <typename Derived>
Derived const* find_interface() const
{
std::size_t const id = BasicInterface::type_id <Derived> ();
for (typename Set::const_iterator iter (m_set.begin());
iter != m_set.end(); ++iter)
{
if ((*iter)->id() == id)
{
Derived const* const derived (
dynamic_cast <Derived const*> (iter->get()));
check_postcondition (derived != nullptr);
return derived;
}
}
return nullptr;
}
template <typename Derived>
bool has_interface() const
{
return find_interface <Derived> () != nullptr;
}
/** @} */
/** Adds the specified interface to the container.
Ownership of the object, which must be allocated via operator new,
is transferred to the container. If the interface already exists,
an exception is thrown.
Requirements:
Derived must be a subclass of Interface
*/
template <typename Derived>
void add_interface (Derived* derived)
{
std::unique_ptr <BasicInterface> base_interface (
derived);
if (has_interface <Derived> ())
throw std::invalid_argument ("non-unique");
m_set.emplace_back (base_interface.release ());
}
private:
typedef std::list <std::unique_ptr <BasicInterface>> Set;
Set m_set;
};
}
}
#endif

View File

@@ -17,8 +17,10 @@
*/
//==============================================================================
#ifndef BEAST_CONTAINERDELETEPOLICY_H_INCLUDED
#define BEAST_CONTAINERDELETEPOLICY_H_INCLUDED
#ifndef BEAST_SMARTPTR_CONTAINERDELETEPOLICY_H_INCLUDED
#define BEAST_SMARTPTR_CONTAINERDELETEPOLICY_H_INCLUDED
namespace beast {
/** The DeletePolicy provides a way to destroy objects stored in containers.
@@ -45,4 +47,6 @@ struct ContainerDeletePolicy
}
};
}
#endif

View File

@@ -21,8 +21,16 @@
*/
//==============================================================================
#ifndef BEAST_SCOPEDPOINTER_H_INCLUDED
#define BEAST_SCOPEDPOINTER_H_INCLUDED
#ifndef BEAST_SMARTPTR_SCOPEDPOINTER_H_INCLUDED
#define BEAST_SMARTPTR_SCOPEDPOINTER_H_INCLUDED
#include "../Config.h"
#include "../Uncopyable.h"
#include "../StaticAssert.h"
#include "ContainerDeletePolicy.h"
namespace beast {
//==============================================================================
/**
@@ -67,13 +75,13 @@ class ScopedPointer : public Uncopyable
public:
//==============================================================================
/** Creates a ScopedPointer containing a null pointer. */
inline ScopedPointer() noexcept
inline ScopedPointer()
: object (nullptr)
{
}
/** Creates a ScopedPointer that owns the specified object. */
inline ScopedPointer (ObjectType* const objectToTakePossessionOf) noexcept
inline ScopedPointer (ObjectType* const objectToTakePossessionOf)
: object (objectToTakePossessionOf)
{
}
@@ -84,7 +92,7 @@ public:
the pointer from the other object to this one, and the other object is reset to
be a null pointer.
*/
ScopedPointer (ScopedPointer& objectToTransferFrom) noexcept
ScopedPointer (ScopedPointer& objectToTransferFrom)
: object (objectToTransferFrom.object)
{
objectToTransferFrom.object = nullptr;
@@ -144,13 +152,13 @@ public:
}
#if BEAST_COMPILER_SUPPORTS_MOVE_SEMANTICS
ScopedPointer (ScopedPointer&& other) noexcept
ScopedPointer (ScopedPointer&& other)
: object (other.object)
{
other.object = nullptr;
}
ScopedPointer& operator= (ScopedPointer&& other) noexcept
ScopedPointer& operator= (ScopedPointer&& other)
{
object = other.object;
other.object = nullptr;
@@ -160,28 +168,37 @@ public:
//==============================================================================
/** Returns the object that this ScopedPointer refers to. */
inline operator ObjectType*() const noexcept { return object; }
inline operator ObjectType*() const { return object; }
/** Returns the object that this ScopedPointer refers to. */
inline ObjectType* get() const noexcept { return object; }
inline ObjectType* get() const { return object; }
/** Returns the object that this ScopedPointer refers to. */
inline ObjectType& operator*() const noexcept { return *object; }
inline ObjectType& operator*() const { return *object; }
/** Lets you access methods and properties of the object that this ScopedPointer refers to. */
inline ObjectType* operator->() const noexcept { return object; }
inline ObjectType* operator->() const { return object; }
//==============================================================================
/** Removes the current object from this ScopedPointer without deleting it.
This will return the current object, and set the ScopedPointer to a null pointer.
*/
ObjectType* release() noexcept { ObjectType* const o = object; object = nullptr; return o; }
ObjectType* release() { ObjectType* const o = object; object = nullptr; return o; }
void reset (ObjectType* object_)
{
if (object != object_)
{
ContainerDeletePolicy <ObjectType>::destroy (object);
object = object_;
}
}
//==============================================================================
/** Swaps this object with that of another ScopedPointer.
The two objects simply exchange their pointers.
*/
void swapWith (ScopedPointer <ObjectType>& other) noexcept
void swapWith (ScopedPointer <ObjectType>& other)
{
// Two ScopedPointers should never be able to refer to the same object - if
// this happens, you must have done something dodgy!
@@ -200,7 +217,7 @@ private:
ObjectType* object;
// (Required as an alternative to the overloaded & operator).
const ScopedPointer* getAddress() const noexcept { return this; }
const ScopedPointer* getAddress() const { return this; }
#if ! BEAST_MSVC // (MSVC can't deal with multiple copy constructors)
/* The copy constructors are private to stop people accidentally copying a const ScopedPointer
@@ -227,7 +244,7 @@ private:
This can be handy for checking whether this is a null pointer.
*/
template <class ObjectType>
bool operator== (const ScopedPointer<ObjectType>& pointer1, ObjectType* const pointer2) noexcept
bool operator== (const ScopedPointer<ObjectType>& pointer1, ObjectType* const pointer2)
{
return static_cast <ObjectType*> (pointer1) == pointer2;
}
@@ -236,7 +253,7 @@ bool operator== (const ScopedPointer<ObjectType>& pointer1, ObjectType* const po
This can be handy for checking whether this is a null pointer.
*/
template <class ObjectType>
bool operator!= (const ScopedPointer<ObjectType>& pointer1, ObjectType* const pointer2) noexcept
bool operator!= (const ScopedPointer<ObjectType>& pointer1, ObjectType* const pointer2)
{
return static_cast <ObjectType*> (pointer1) != pointer2;
}
@@ -248,4 +265,7 @@ template <typename Type>
void deleteAndZero (ScopedPointer<Type>&) { static_bassert (sizeof (Type) == 12345); }
#endif
#endif // BEAST_SCOPEDPOINTER_H_INCLUDED
}
#endif

View File

@@ -24,6 +24,13 @@
#ifndef BEAST_SHAREDOBJECT_H_INCLUDED
#define BEAST_SHAREDOBJECT_H_INCLUDED
#include <atomic>
#include "../Config.h"
#include "../Uncopyable.h"
namespace beast {
//==============================================================================
/**
Adds reference-counting to an object.
@@ -65,7 +72,7 @@ public:
This is done automatically by the smart pointer, but is public just
in case it's needed for nefarious purposes.
*/
inline void incReferenceCount() const noexcept
void incReferenceCount() const noexcept
{
++refCount;
}
@@ -87,15 +94,16 @@ public:
}
/** Returns the object's current reference count. */
inline int getReferenceCount() const noexcept
int getReferenceCount() const noexcept
{
return refCount.get();
return refCount.load();
}
protected:
//==============================================================================
/** Creates the reference-counted object (with an initial ref count of zero). */
SharedObject()
: refCount (0)
{
}
@@ -119,79 +127,14 @@ protected:
*/
void resetReferenceCount() noexcept
{
refCount = 0;
refCount.store (0);
}
private:
//==============================================================================
Atomic <int> mutable refCount;
std::atomic <int> mutable refCount;
};
//==============================================================================
/**
Adds reference-counting to an object.
This is effectively a version of the SharedObject class, but which
uses a non-atomic counter, and so is not thread-safe (but which will be more
efficient).
For more details on how to use it, see the SharedObject class notes.
@see SharedObject, SharedPtr, SharedObjectArray
*/
class BEAST_API SingleThreadedSharedObject : public Uncopyable
{
public:
//==============================================================================
/** Increments the object's reference count.
This is done automatically by the smart pointer, but is public just
in case it's needed for nefarious purposes.
*/
inline void incReferenceCount() noexcept
{
++refCount;
}
/** Decreases the object's reference count.
If doDelete is true the object will be deleted when the reference
count drops to zero. The delete is performed using the regular
operator and does NOT go through the ContainerDeletePolicy.
The return value indicates if the reference count dropped to zero,
so callers who know the derived type can use the ContainerDeletePolicy.
*/
inline void decReferenceCount ()
{
bassert (getReferenceCount() > 0);
if (--refCount == 0)
destroy ();
}
/** Returns the object's current reference count. */
inline int getReferenceCount() const noexcept { return refCount; }
protected:
//==============================================================================
/** Creates the reference-counted object (with an initial ref count of zero). */
SingleThreadedSharedObject() : refCount (0) {}
/** Destructor. */
virtual ~SingleThreadedSharedObject()
{
// it's dangerous to delete an object that's still referenced by something else!
bassert (getReferenceCount() == 0);
}
virtual void destroy () const
{
delete this;
}
private:
//==============================================================================
int refCount;
};
}
#endif

View File

@@ -21,8 +21,13 @@
*/
//==============================================================================
#ifndef BEAST_CORE_SHAREDPTR_H_INCLUDED
#define BEAST_CORE_SHAREDPTR_H_INCLUDED
#ifndef BEAST_SMARTPTR_SHAREDPTR_H_INCLUDED
#define BEAST_SMARTPTR_SHAREDPTR_H_INCLUDED
#include "../Config.h"
#include "SharedObject.h"
namespace beast {
// Visual Studio doesn't seem to do very well when it comes
// to templated constructors and assignments so we provide
@@ -159,7 +164,7 @@ public:
template <class U>
SharedPtr (SharedPtr <U>&& sp) noexcept
: m_p (sp.swap <U> (nullptr))
: m_p (sp.template swap <U> (nullptr))
{
}
/** @} */
@@ -180,7 +185,7 @@ public:
template <class U>
SharedPtr& operator= (SharedPtr <U>&& sp)
{
return assign (sp.swap <U> (nullptr));
return assign (sp.template swap <U> (nullptr));
}
/** @} */
#endif
@@ -317,4 +322,6 @@ bool operator!= (T const* lhs, SharedPtr <U> const& rhs) noexcept
}
/** @} */
}
#endif

View File

@@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
/*
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 "BeastConfig.h"
#include "../Config.h"
#include "ContainerDeletePolicy.h"
#include "ScopedPointer.h"
#include "SharedObject.h"
#include "SharedPtr.h"
#include "../../modules/beast_core/beast_core.h" // for UnitTest
#include "impl/AbstractObject.cpp"

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