Some minor changes in options doc
authorkhizmax <libcds.dev@gmail.com>
Sat, 21 Nov 2015 09:57:39 +0000 (12:57 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 21 Nov 2015 09:57:39 +0000 (12:57 +0300)
cds/opt/buffer.h
cds/opt/compare.h
cds/opt/hash.h
cds/opt/permutation.h
cds/opt/value_cleaner.h

index 9dca22ff3ed17783d4f30dd3d2f4e8848648af74..1563f233d268b708a1085a4c09b3cb13081b7658 100644 (file)
@@ -19,8 +19,8 @@ namespace cds { namespace opt {
         The template parameter \p Type should be rebindable.
 
         Implementations:
-            - opt::v::static_buffer
-            - opt::v::dynamic_buffer
+            - \p opt::v::static_buffer
+            - \p opt::v::dynamic_buffer
     */
     template <typename Type>
     struct buffer {
@@ -34,9 +34,9 @@ namespace cds { namespace opt {
 
     namespace v {
 
-        /// Static buffer (see \p cds::opt::buffer option)
+        /// Static buffer
         /**
-            One of available type for opt::buffer type-option.
+            One of available type for \p opt::buffer option.
 
             This buffer maintains static array. No dynamic memory allocation performed.
 
@@ -60,30 +60,31 @@ namespace cds { namespace opt {
             struct rebind {
                 typedef static_buffer<Q, Capacity2, Exp22> other   ;   ///< Rebind result type
             };
+
+            // Capacity must be power of 2
+            static_assert(!c_bExp2 || (c_nCapacity & (c_nCapacity - 1)) == 0, "Capacity must be power of two");
+
         private:
             //@cond
             value_type  m_buffer[c_nCapacity];
             //@endcond
         public:
             /// Construct static buffer
-            static_buffer()
-            {
-                // Capacity must be power of 2
-                static_assert( !c_bExp2 || (c_nCapacity & (c_nCapacity - 1)) == 0, "Capacity must be power of two" );
-            }
+            static_buffer() CDS_NOEXCEPT
+            {}
             /// Construct buffer of given capacity
             /**
                 This ctor ignores \p nCapacity argument. The capacity of static buffer
                 is defined by template argument \p Capacity
             */
-            static_buffer( size_t nCapacity )
+            static_buffer( size_t nCapacity ) CDS_NOEXCEPT
             {
                 CDS_UNUSED( nCapacity );
-                // Capacity must be power of 2
-                static_assert( !c_bExp2 || (c_nCapacity & (c_nCapacity - 1)) == 0,  "Capacity must be power of two");
-                //assert( c_nCapacity == nCapacity );
             }
 
+            static_buffer( const static_buffer& ) = delete;
+            static_buffer& operator =( const static_buffer& ) = delete;
+
             /// Get item \p i
             value_type& operator []( size_t i )
             {
@@ -111,29 +112,22 @@ namespace cds { namespace opt {
             }
 
             /// Returns pointer to buffer array
-            value_type * buffer()
+            value_type * buffer() CDS_NOEXCEPT
             {
                 return m_buffer;
             }
 
-            /// Returns pointer to buffer array (const version)
-            value_type * buffer() const
+            /// Returns pointer to buffer array
+            value_type * buffer() const CDS_NOEXCEPT
             {
                 return m_buffer;
             }
-
-        private:
-            //@cond
-            // non-copyable
-            static_buffer(const static_buffer&);
-            void operator =(const static_buffer&);
-            //@endcond
         };
 
 
         /// Dynamically allocated buffer
         /**
-            One of available \p cds::opt::buffer type-option.
+            One of available type for \p opt::buffer option.
 
             This buffer maintains dynamically allocated array.
             Allocation is performed at construction time.
@@ -191,6 +185,9 @@ namespace cds { namespace opt {
                 a.Delete( m_buffer, m_nCapacity );
             }
 
+            dynamic_buffer( const dynamic_buffer& ) = delete;
+            dynamic_buffer& operator =( const dynamic_buffer& ) = delete;
+
             /// Get item \p i
             value_type& operator []( size_t i )
             {
@@ -218,23 +215,16 @@ namespace cds { namespace opt {
             }
 
             /// Returns pointer to buffer array
-            value_type * buffer()
+            value_type * buffer() CDS_NOEXCEPT
             {
                 return m_buffer;
             }
 
-            /// Returns pointer to buffer array (const version)
-            value_type * buffer() const
+            /// Returns pointer to buffer array
+            value_type * buffer() const CDS_NOEXCEPT
             {
                 return m_buffer;
             }
-
-        private:
-            //@cond
-            // non-copyable
-            dynamic_buffer(const dynamic_buffer&);
-            void operator =(const dynamic_buffer&);
-            //@endcond
         };
 
     }   // namespace v
index 24e5775e67ff91701e1d006d43a1b60eecc8b3ea..d332b0d3d92b8baa74d729a94794dc011d396684 100644 (file)
@@ -19,9 +19,9 @@ namespace cds { namespace opt {
     /**
         The option sets a type of a functor to compare keys.
         For comparing two keys \p k1 and \p k2 the functor must return:
-        - 1 if k1 > k2
-        - 0 if k1 == k2
-        - -1 if k1 < k2
+        - 1 if <tt> k1 > k2 </tt>
+        - 0 if <tt> k1 == k2 </tt>
+        - -1 if <tt> k1 < k2 </tt>
 
         \p Functor is a functor with following interface:
         \code
@@ -36,12 +36,12 @@ namespace cds { namespace opt {
         Note that the functor must return \p int, not a \p bool value.
 
         There are predefined type for \p Functor:
-        - the functor v::less_comparator that implements comparing functor through \p std::less predicate.
-        - the specialization of v::less_comparator functor intended for the string comparison
+        - the functor \p opt::v::less_comparator that implements comparing functor through \p std::less predicate.
+        - the specialization of \p opt::v::less_comparator functor intended for the string comparison
 
         You may implement your own comparing functor that satisfies \p Functor interface.
 
-        About relation between \ref opt::less and \ref opt::compare option setters see opt::less description.
+        About relation between \p %opt::less and \p %opt::compare option setters see \p opt::less description.
     */
     template <typename Functor>
     struct compare {
@@ -75,7 +75,7 @@ namespace cds { namespace opt {
 
         /// Comparator specialization for \p std::string
         /**
-            This functor uses \p std::string::compare method instead of \p std::less predicate.
+            This functor uses \p std::string::compare() method instead of \p std::less predicate.
         */
         template <typename T, typename Traits, typename Alloc>
         struct less_comparator< std::basic_string<T, Traits, Alloc> >
@@ -121,11 +121,11 @@ namespace cds { namespace opt {
 
         Generally, the default type for \p Functor is \p std::less but it depends on the container used.
 
-        \par Relation between \p opt::less and opt::compare option setters
-        Unless otherwise specified, \p compare option setter has high priority. If opt::compare and opt::less options are specified
-        for a container, the opt::compare option is used:
+        \par Relation between opt::less and opt::compare option setters
+        Unless otherwise specified, \p opt::compare option setter has high priority.
+        If \p %opt::compare and \p %opt::less options are specified for a container, the \p %opt::compare option is used:
         \code
-        // Suppose, hypothetical map_type allows to specify
+        // Suppose, hypothetical map_type allows to specify
         // cds::opt::less and cds::opt::compare options
 
         typedef map_type< std::string, int,
@@ -210,7 +210,7 @@ namespace cds { namespace opt {
     }   // namespace details
     //@endcond
 
-    /// [type-option] Option setter for \p equal_to predicate
+    /// [type-option] Option setter for \p opt::equal_to predicate
     /**
         The option sets a binary predicate that tests whether a value of a specified type is equal to another value of that type.
         \p Functor interface is similar to \p std::equal_to predicate interface.
index 5d93bf26fc1f7a19073263bf0d6183c0111a031d..5e309e80494e82b64022289a1b76686c9ac251bf 100644 (file)
@@ -111,7 +111,7 @@ namespace cds { namespace opt {
     template <typename Functor> struct hash< std::tuple<Functor> >;
     //@endcond
 
-    /// Multi-functor hash option setter - specialization for std::tuple
+    /// Multi-functor hash option setter - specialization for \p std::tuple
     template <typename... Functors>
     struct hash< std::tuple<Functors...> >
     {
index 861254a94fda22b8e9f4de6c92c12166a10d7e29..43d5afee9f2ed5378d4d3d7ac4b3751cd59621a0 100644 (file)
@@ -34,7 +34,8 @@ namespace cds { namespace opt {
         };
         \endcode
 
-        Usage example:
+        <b>Usage example</b>
+
         The permutation generator is intended for <tt>do {} while</tt> loop:
         \code
         permutation_generator gen( 16 );
@@ -53,10 +54,10 @@ namespace cds { namespace opt {
         \endcode
 
         The following \p Generator defined:
-        - opt::v::random_permutation
-        - opt::v::random2_permutation
-        - opt::v::random_shuffle_permutation
-        - opt::v::skew_permutation
+        - \p opt::v::random_permutation
+        - \p opt::v::random2_permutation
+        - \p opt::v::random_shuffle_permutation
+        - \p opt::v::skew_permutation
     */
     template <typename Generator>
     struct permutation_generator {
index 414c5eb3d649ee7173fb1c250dbdeb9f24246003..768abe48b0c7461879ab142f64be192ef2278c49 100644 (file)
@@ -42,7 +42,7 @@ namespace cds { namespace opt {
 
         /// Empty cleaner
         /**
-            One of available type for opt::value_cleaner option.
+            One of available type for \p opt::value_cleaner option.
             This cleaner is empty, i.e. it does not do any cleaning.
         */
         struct empty_cleaner
@@ -56,7 +56,7 @@ namespace cds { namespace opt {
 
         /// Cleaner that calls destructor of type \p T
         /**
-            One of available type for opt::value_cleaner option.
+            One of available type for \p opt::value_cleaner option.
         */
         struct destruct_cleaner
         {