Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59812 - in sandbox/tokenmap/libs: . tokenmap tokenmap/doc tokenmap/example
From: sl_at_[hidden]
Date: 2010-02-21 11:40:34


Author: sl_
Date: 2010-02-21 11:40:33 EST (Sun, 21 Feb 2010)
New Revision: 59812
URL: http://svn.boost.org/trac/boost/changeset/59812

Log:
added doc dir
Added:
   sandbox/tokenmap/libs/
   sandbox/tokenmap/libs/tokenmap/
   sandbox/tokenmap/libs/tokenmap/doc/
   sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk (contents, props changed)
   sandbox/tokenmap/libs/tokenmap/example/
   sandbox/tokenmap/libs/tokenmap/example/simple_bimap.cpp (contents, props changed)

Added: sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk
==============================================================================
--- (empty file)
+++ sandbox/tokenmap/libs/tokenmap/doc/tokenmap.qbk 2010-02-21 11:40:33 EST (Sun, 21 Feb 2010)
@@ -0,0 +1,147 @@
+[library Boost.Tokenmap
+ [quickbook 1.4]
+ [authors [Lisznianski, Slawomir]]
+ [copyright 2006-2007 Slawomir Lisznianski]
+ [category container]
+ [id tokenmap]
+ [dirname tokenmap]
+ [purpose
+ Perfect hashmap with auto-generated pseudo-random keys.
+ ]
+ [source-mode c++]
+ [license
+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])
+ ]
+]
+
+[/ QuickBook Document version 1.4 ]
+
+[/ Logos ]
+
+[def __BOOST_TOKENMAP_LOGO__ [$images/tokenmap/boost.tokenmap.logo.png]]
+[def __GOOGLE_SOC_2006__ [$images/extern/googlesoc.png]]
+
+[/ Helpers ]
+
+[/ People ]
+
+[def __SLAWOMIR_PHOTO__ [$images/people/slawomir.png]]
+
+[/ Icons ]
+
+[def __NOTE__ [$images/note.png]]
+[def __ALERT__ [$images/caution.png]]
+[def __DETAIL__ [$images/note.png]]
+[def __TIP__ [$images/tip.png]]
+[def __QUESTION_MARK__ [$images/question.png]]
+
+
+[/ Boost Libraries ]
+
+[def __BOOST_MULTI_INDEX__ [@http://www.boost.org/libs/multi_index/doc/index.html [*Boost.MultiIndex]]]
+[def __BOOST_MPL__ [@http://www.boost.org/libs/mpl/doc/index.html [*Boost.MPL]]]
+[def __BOOST_TYPE_TRAITS__ [@http://www.boost.org/doc/html/boost_typetraits.html [*Boost.TypeTraits]]]
+[def __BOOST_ENABLE_IF__ [@http://www.boost.org/libs/utility/enable_if.html [*Boost.enable_if]]]
+[def __BOOST_ITERATORS__ [@http://www.boost.org/libs/iterator/doc/index.html [*Boost.Iterators]]]
+[def __BOOST_CALL_TRAITS__ [@http://www.boost.org/libs/utility/call_traits.htm [*Boost.call_traits]]]
+[def __BOOST_STATIC_ASSERT__ [@http://www.boost.org/doc/html/boost_staticassert.html [*Boost.StaticAssert]]]
+
+[def __BOOST_SERIALIZATION__ [@http://www.boost.org/libs/serialization/doc/index.html [*Boost.Serialization]]]
+[def __BOOST_HASH__ [@http://www.boost.org/doc/html/hash.html [*Boost.Hash]]]
+[def __BOOST_ASSIGN__ [@http://www.boost.org/libs/assign/doc/index.html [*Boost.Assign]]]
+[def __BOOST_LAMBDA__ [@http://www.boost.org/doc/html/lambda.html [*Boost.Lambda]]]
+[def __BOOST_PROPERTY_MAP__ [@http://www.boost.org/doc/html/property_map.html [*Boost.PropertyMap]]]
+[def __BOOST_RANGE__ [@http://www.boost.org/doc/html/range.html [*Boost.Range]]]
+[def __BOOST_FOREACH__ [@http://www.boost.org/doc/html/foreach.html [*Boost.Foreach]]]
+[def __BOOST_TEST__ [@http://www.boost.org/libs/test/doc/index.html [*Boost.Test]]]
+[def __BOOST_TYPEOF__ [@http://www.boost.org/libs/typeof/doc/index.html [*Boost.Typeof]]]
+[def __BOOST_XPRESSIVE__ [@http://www.boost.org/libs/xpressive/doc/index.html [*Boost.Xpressive]]]
+
+
+[/ Extern Links ]
+
+[def __CPP_STANDARD_LIBRARY_TECHNICAL_REPORT__ [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1836.pdf C++ Standard Library Technical Report]]
+[def __CPP_DEFECT_REPORT_130__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#130 Defect Report 130]]
+[def __TR1_ISSUES_LIST__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1837.pdf Issues List]]
+
+[def __BOOST_HASH_FUNCTION__ [@http://www.boost.org/regression-logs/cs-win32_metacomm/doc/html/hash.html boost::hash]]
+
+[def __BOOST_PERMUTATION_ITERATOR__ [@http://www.boost.org/libs/iterator/doc/permutation_iterator.html `permutation_iterator`]]
+
+[def __BOOST_ASSERT_MACRO__ [@where_it_is `BOOST_ASSERT`]]
+[def __BOOST_MPL_FORWARD_SEQUENCE__ [@http://www.boost.org/libs/mpl/doc/refmanual/forward-sequence.html MPL Forward Sequence]]
+[def __BOOST_MPL_RANDOM_ACCESS_SEQUENCE__ [@http://www.boost.org/libs/mpl/doc/refmanual/random-access-sequence.html MPL Random Access Sequence]]
+[def __BOOST_MPL_EXTENSIBLE_SEQUENCE__ [@http://www.boost.org/libs/mpl/doc/refmanual/extensible-sequence.html MPL Extensible Sequence]]
+
+[def __SGI_UNARY_FUNCTION__ [@http://www.sgi.com/tech/stl/UnaryFunction.html Unary Function]]
+[def __SGI_BINARY_FUNCTION__ [@http://www.sgi.com/tech/stl/BinaryFunction.html Binary Function]]
+
+[def __SGI_ASSIGNABLE__ [@http://www.sgi.com/tech/stl/Assignable.html Assignable]]
+[def __SGI_DEFAULT_CONSTRUCTIBLE__ [@http://www.sgi.com/tech/stl/DefaultConstructible.html Default Constructible]]
+[def __SGI_BINARY_PREDICATE__ [@http://www.sgi.com/tech/stl/BinaryPredicate.html Binary Predicate]]
+[def __SGI_CONTAINER__ [@http://www.sgi.com/tech/stl/Container.html Container]]
+[def __SGI_SORTED_ASSOCIATIVE_CONTAINER__ [@http://www.sgi.com/tech/stl/SortedAssociativeContainer.html Sorted Associative Container]]
+[def __SGI_UNIQUE_ASSOCIATIVE_CONTAINER__ [@http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html Unique Associative Container]]
+[def __SGI_REVERSIBLE_CONTAINER__ [@http://www.sgi.com/tech/stl/ReversibleContainer.html Reversible Container]]
+[def __SGI_RANDOM_ACCESS_CONTAINER__ [@http://www.sgi.com/tech/stl/RandomAccessContainer.html Random Access Container]]
+[def __SGI_FRONT_INSERTION_SEQUENCE__ [@http://www.sgi.com/tech/stl/FrontInsertionSequence.html Front Insertion Sequence]]
+[def __SGI_BACK_INSERTION_SEQUENCE__ [@http://www.sgi.com/tech/stl/BackInsertionSequence.html Back Insertion Sequence]]
+[def __SGI_INPUT_ITERATOR__ [@http://www.sgi.com/tech/stl/InputIterator.html Input Iterator]]
+[def __SGI_FORWARD_ITERATOR__ [@http://www.sgi.com/tech/stl/ForwardIterator.html Forward Iterator]]
+[def __SGI_STRICT_WEAK_ORDERING__ [@http://www.sgi.com/tech/stl/StrictWeakOrdering.html Strict Weak Ordering]]
+
+[def __EIFFEL__ [@http://www.eiffel.com/ Eiffel]]
+[def __SAFE_STL__ [@http://www.horstmann.com/safestl.html Safe STL]]
+[def __STL_PORT_DEBUG_MODE__ [@http://www.stlport.com/doc/debug_mode.html STLport Debug Mode]]
+
+[def __CGAL__ [@http://www.cgal.org/ CGAL]]
+[def __MYSQLPP__ [@http://tangentsoft.net/mysql++/ MySQL++]]
+
+
+[def __STL_TREE_H__ [@http://www.sgi.com/tech/stl/stl_tree.h stl_tree.h]]
+[def __ORDER_STATISTICS_TREE__ [@http://pine.cs.yale.edu/pinewiki/OrderStatisticsTree ['order-statistics trees]]]
+
+[def __GENERIC_PROGRAMMING_MOVE_CONSTRUCTORS__ [@http://www.ddj.com/dept/cpp/184403855 "Generic<Programming>: Move Constructors]]
+[def __CLARIFICATION_OF_INITIALIZATION__ [@http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2004/n1610.html "Clarification of Initialization of Class Objects by rvalues"]]
+
+
+[/ Code snippets ]
+
+[import ../example/simple_tokenmap.cpp]
+
+[section Preface]
+
+[heading Description]
+
+__BOOST_TOKENMAP_LOGO__
+
+Boost.Tokenmap is a bidirectional maps library for C++. With Boost.Tokenmap you can create associative containers in which both types can be used as key. A `tokenmap<X,Y>`
+can be thought of as a combination of a `std::map<X,Y>` and a `std::map<Y,X>`.
+The learning curve of tokenmap is almost flat if you know how to use standard
+containers. A great deal of effort has been put into mapping the naming scheme of the
+STL in Boost.Tokenmap. The library is designed to match the common STL containers.
+
+[heading Influences and Related Work]
+
+The design of Boost.Tokenmap interface follows the standard template library.
+It has been strongly influenced by Joaquin Lopez Muñoz's Boost.MultiIndex library
+(the heart of tokenmaps) and codeproject::tokenmap library.
+
+[endsect]
+
+[include introduction.qbk]
+[include quick_tutorial.qbk]
+[include tutorial.qbk]
+[include tokenmap_and_boost.qbk]
+[include reference.qbk]
+[include compiler_specifics.qbk]
+[include performance.qbk]
+[include examples.qbk]
+[include test_suite.qbk]
+[include future_work.qbk]
+[include release_notes.qbk]
+[include rationale.qbk]
+[include history.qbk]
+[include acknowledgements.qbk]

Added: sandbox/tokenmap/libs/tokenmap/example/simple_bimap.cpp
==============================================================================
--- (empty file)
+++ sandbox/tokenmap/libs/tokenmap/example/simple_bimap.cpp 2010-02-21 11:40:33 EST (Sun, 21 Feb 2010)
@@ -0,0 +1,60 @@
+// Boost.Tokenmap
+//
+// Copyright (c) 2009 Slawomir Lisznianski
+//
+// 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)
+
+// VC++ 8.0 warns on usage of certain Standard Library and API functions that
+// can cause buffer overruns or other possible security issues if misused.
+// See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
+// But the wording of the warning is misleading and unsettling, there are no
+// portable alternative functions, and VC++ 8.0's own libraries use the
+// functions in question. So turn off the warnings.
+#define _CRT_SECURE_NO_DEPRECATE
+#define _SCL_SECURE_NO_DEPRECATE
+
+// Boost.Tokenmap Example
+//-----------------------------------------------------------------------------
+
+#include <boost/config.hpp>
+
+//[ code_simple_tokenmap
+
+#include <boost/tokenmap.hpp>
+
+// holds session information (ie. connected client's context)
+struct session { };
+
+int main()
+{
+ typedef boost::tokenmap<session, uint32_t> tokenamp_type;
+
+ tokenamp_type sessions(2000, // hint on number of concurrent sessions
+ 0.7, // load factor, if exceeded, the container resizes
+ time(NULL) // seed for the pseudo-random number generator
+ );
+
+ // insert by-value; on return v1 holds a std::pair<token, session*>
+ tokenamp_type::value_type v1 =
+ sessions.insert( session() );
+
+ // insert by-auto_ptr
+ tokenamp_type::value_type v2 =
+ sessions.insert( std::auto_ptr<session>(new session()) );
+
+ // search for session instance
+ tokenamp_type::mapped_type * m1 = sessions.find( v1.first );
+
+ // pop (remove) element from the container
+ std::auto_ptr<map_type::mapped_type> e1 =
+ sessions.pop( v1.first );
+
+ // checks if element identified by token exists
+ bool found = sessions.exists( v1.first );
+
+ return 0;
+}
+//]
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk