From a144f2267956a2a70b8b7efe9d34ea32e47d1cf1 Mon Sep 17 00:00:00 2001 From: jwellbelove Date: Tue, 9 May 2017 09:02:02 +0100 Subject: [PATCH 1/2] Renamed 'intrusive' flat maps & sets to 'reference' to better reflect their true nature. --- src/file_error_numbers.txt | 8 +- ...rusive_flat_map.h => reference_flat_map.h} | 192 +++++++++--------- ...t_multimap.h => reference_flat_multimap.h} | 152 +++++++------- ...t_multiset.h => reference_flat_multiset.h} | 176 ++++++++-------- ...rusive_flat_set.h => reference_flat_set.h} | 176 ++++++++-------- ...at_map.cpp => test_reference_flat_map.cpp} | 18 +- ...p.cpp => test_reference_flat_multimap.cpp} | 16 +- ...t.cpp => test_reference_flat_multiset.cpp} | 12 +- ...at_set.cpp => test_reference_flat_set.cpp} | 12 +- 9 files changed, 381 insertions(+), 381 deletions(-) rename src/{intrusive_flat_map.h => reference_flat_map.h} (82%) rename src/{intrusive_flat_multimap.h => reference_flat_multimap.h} (83%) rename src/{intrusive_flat_multiset.h => reference_flat_multiset.h} (80%) rename src/{intrusive_flat_set.h => reference_flat_set.h} (81%) rename test/{test_intrusive_flat_map.cpp => test_reference_flat_map.cpp} (98%) rename test/{test_intrusive_flat_multimap.cpp => test_reference_flat_multimap.cpp} (98%) rename test/{test_intrusive_flat_multiset.cpp => test_reference_flat_multiset.cpp} (98%) rename test/{test_intrusive_flat_set.cpp => test_reference_flat_set.cpp} (98%) diff --git a/src/file_error_numbers.txt b/src/file_error_numbers.txt index 99ba704b..4f8684fb 100644 --- a/src/file_error_numbers.txt +++ b/src/file_error_numbers.txt @@ -27,7 +27,7 @@ 27 string_base 28 intrusive_stack 29 intrusive_queue -30 intrusive_flat_map -31 intrusive_flat_multimap -32 intrusive_flat_set -33 intrusive_flat_multiset \ No newline at end of file +30 reference_flat_map +31 reference_flat_multimap +32 reference_flat_set +33 reference_flat_multiset \ No newline at end of file diff --git a/src/intrusive_flat_map.h b/src/reference_flat_map.h similarity index 82% rename from src/intrusive_flat_map.h rename to src/reference_flat_map.h index 5f0108b8..a0d6d098 100644 --- a/src/intrusive_flat_map.h +++ b/src/reference_flat_map.h @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef __ETL_INTRUSIVE_FLAT_MAP__ -#define __ETL_INTRUSIVE_FLAT_MAP__ +#ifndef __ETL_REFERENCE_FLAT_MAP__ +#define __ETL_REFERENCE_FLAT_MAP__ #include @@ -41,8 +41,8 @@ SOFTWARE. #define ETL_FILE "30" //***************************************************************************** -///\defgroup intrusive_flat_map intrusive_flat_map -/// An intrusive_flat_map with the capacity defined at compile time. +///\defgroup reference_flat_map reference_flat_map +/// An reference_flat_map with the capacity defined at compile time. /// Has insertion of O(N) and search of O(logN) /// Duplicate entries are not allowed. ///\ingroup containers @@ -51,54 +51,54 @@ SOFTWARE. namespace etl { //*************************************************************************** - ///\ingroup intrusive_flat_map - /// Exception base for intrusive_flat_maps + ///\ingroup reference_flat_map + /// Exception base for reference_flat_maps //*************************************************************************** - class intrusive_flat_map_exception : public exception + class reference_flat_map_exception : public exception { public: - intrusive_flat_map_exception(string_type what, string_type file_name, numeric_type line_number) + reference_flat_map_exception(string_type what, string_type file_name, numeric_type line_number) : exception(what, file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_map + ///\ingroup reference_flat_map /// Vector full exception. //*************************************************************************** - class intrusive_flat_map_full : public intrusive_flat_map_exception + class reference_flat_map_full : public reference_flat_map_exception { public: - intrusive_flat_map_full(string_type file_name, numeric_type line_number) - : intrusive_flat_map_exception(ETL_ERROR_TEXT("intrusive_flat_map: full", ETL_FILE"A"), file_name, line_number) + reference_flat_map_full(string_type file_name, numeric_type line_number) + : reference_flat_map_exception(ETL_ERROR_TEXT("reference_flat_map: full", ETL_FILE"A"), file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_map + ///\ingroup reference_flat_map /// Vector out of bounds exception. //*************************************************************************** - class intrusive_flat_map_out_of_bounds : public intrusive_flat_map_exception + class reference_flat_map_out_of_bounds : public reference_flat_map_exception { public: - intrusive_flat_map_out_of_bounds(string_type file_name, numeric_type line_number) - : intrusive_flat_map_exception(ETL_ERROR_TEXT("intrusive_flat_map:bounds", ETL_FILE"B"), file_name, line_number) + reference_flat_map_out_of_bounds(string_type file_name, numeric_type line_number) + : reference_flat_map_exception(ETL_ERROR_TEXT("reference_flat_map:bounds", ETL_FILE"B"), file_name, line_number) { } }; //*************************************************************************** - /// The base class for specifically sized intrusive_flat_maps. - /// Can be used as a reference type for all intrusive_flat_maps containing a specific type. - ///\ingroup intrusive_flat_map + /// The base class for specifically sized reference_flat_maps. + /// Can be used as a reference type for all reference_flat_maps containing a specific type. + ///\ingroup reference_flat_map //*************************************************************************** template > - class iintrusive_flat_map + class ireference_flat_map { public: @@ -124,7 +124,7 @@ namespace etl { public: - friend class iintrusive_flat_map; + friend class ireference_flat_map; iterator() { @@ -222,7 +222,7 @@ namespace etl { public: - friend class iintrusive_flat_map; + friend class ireference_flat_map; const_iterator() { @@ -342,8 +342,8 @@ namespace etl public: //********************************************************************* - /// Returns an iterator to the beginning of the intrusive_flat_map. - ///\return An iterator to the beginning of the intrusive_flat_map. + /// Returns an iterator to the beginning of the reference_flat_map. + ///\return An iterator to the beginning of the reference_flat_map. //********************************************************************* iterator begin() { @@ -351,8 +351,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_map. - ///\return A const iterator to the beginning of the intrusive_flat_map. + /// Returns a const_iterator to the beginning of the reference_flat_map. + ///\return A const iterator to the beginning of the reference_flat_map. //********************************************************************* const_iterator begin() const { @@ -360,8 +360,8 @@ namespace etl } //********************************************************************* - /// Returns an iterator to the end of the intrusive_flat_map. - ///\return An iterator to the end of the intrusive_flat_map. + /// Returns an iterator to the end of the reference_flat_map. + ///\return An iterator to the end of the reference_flat_map. //********************************************************************* iterator end() { @@ -369,8 +369,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_map. - ///\return A const iterator to the end of the intrusive_flat_map. + /// Returns a const_iterator to the end of the reference_flat_map. + ///\return A const iterator to the end of the reference_flat_map. //********************************************************************* const_iterator end() const { @@ -378,8 +378,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_map. - ///\return A const iterator to the beginning of the intrusive_flat_map. + /// Returns a const_iterator to the beginning of the reference_flat_map. + ///\return A const iterator to the beginning of the reference_flat_map. //********************************************************************* const_iterator cbegin() const { @@ -387,8 +387,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_map. - ///\return A const iterator to the end of the intrusive_flat_map. + /// Returns a const_iterator to the end of the reference_flat_map. + ///\return A const iterator to the end of the reference_flat_map. //********************************************************************* const_iterator cend() const { @@ -396,8 +396,8 @@ namespace etl } //********************************************************************* - /// Returns an reverse iterator to the reverse beginning of the intrusive_flat_map. - ///\return Iterator to the reverse beginning of the intrusive_flat_map. + /// Returns an reverse iterator to the reverse beginning of the reference_flat_map. + ///\return Iterator to the reverse beginning of the reference_flat_map. //********************************************************************* reverse_iterator rbegin() { @@ -405,8 +405,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_map. - ///\return Const iterator to the reverse beginning of the intrusive_flat_map. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_map. + ///\return Const iterator to the reverse beginning of the reference_flat_map. //********************************************************************* const_reverse_iterator rbegin() const { @@ -414,8 +414,8 @@ namespace etl } //********************************************************************* - /// Returns a reverse iterator to the end + 1 of the intrusive_flat_map. - ///\return Reverse iterator to the end + 1 of the intrusive_flat_map. + /// Returns a reverse iterator to the end + 1 of the reference_flat_map. + ///\return Reverse iterator to the end + 1 of the reference_flat_map. //********************************************************************* reverse_iterator rend() { @@ -423,8 +423,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_map. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_map. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_map. + ///\return Const reverse iterator to the end + 1 of the reference_flat_map. //********************************************************************* const_reverse_iterator rend() const { @@ -432,8 +432,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_map. - ///\return Const reverse iterator to the reverse beginning of the intrusive_flat_map. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_map. + ///\return Const reverse iterator to the reverse beginning of the reference_flat_map. //********************************************************************* const_reverse_iterator crbegin() const { @@ -441,8 +441,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_map. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_map. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_map. + ///\return Const reverse iterator to the end + 1 of the reference_flat_map. //********************************************************************* const_reverse_iterator crend() const { @@ -458,7 +458,7 @@ namespace etl { iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), ETL_ERROR(intrusive_flat_map_out_of_bounds)); + ETL_ASSERT(i_element != end(), ETL_ERROR(reference_flat_map_out_of_bounds)); return i_element->second; } @@ -472,7 +472,7 @@ namespace etl { iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), ETL_ERROR(intrusive_flat_map_out_of_bounds)); + ETL_ASSERT(i_element != end(), ETL_ERROR(reference_flat_map_out_of_bounds)); return i_element->second; } @@ -487,7 +487,7 @@ namespace etl { iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), ETL_ERROR(intrusive_flat_map_out_of_bounds)); + ETL_ASSERT(i_element != end(), ETL_ERROR(reference_flat_map_out_of_bounds)); return i_element->second; } @@ -502,14 +502,14 @@ namespace etl { const_iterator i_element = lower_bound(key); - ETL_ASSERT(i_element != end(), ETL_ERROR(intrusive_flat_map_out_of_bounds)); + ETL_ASSERT(i_element != end(), ETL_ERROR(reference_flat_map_out_of_bounds)); return i_element->second; } //********************************************************************* - /// Assigns values to the intrusive_flat_map. - /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined, emits flat_map_full if the intrusive_flat_map does not have enough free space. + /// Assigns values to the reference_flat_map. + /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined, emits flat_map_full if the reference_flat_map does not have enough free space. /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined, emits flat_map_iterator if the iterators are reversed. ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. @@ -519,7 +519,7 @@ namespace etl { #if defined(ETL_DEBUG) difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(intrusive_flat_map_full)); + ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(reference_flat_map_full)); #endif clear(); @@ -531,8 +531,8 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_map. - /// If asserts or exceptions are enabled, emits flat_map_full if the intrusive_flat_map is already full. + /// Inserts a value to the reference_flat_map. + /// If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map is already full. ///\param value The value to insert. //********************************************************************* std::pair insert(value_type& value) @@ -543,8 +543,8 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_map. - /// If asserts or exceptions are enabled, emits flat_map_full if the intrusive_flat_map is already full. + /// Inserts a value to the reference_flat_map. + /// If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map is already full. ///\param position The position to insert at. ///\param value The value to insert. //********************************************************************* @@ -554,8 +554,8 @@ namespace etl } //********************************************************************* - /// Inserts a range of values to the intrusive_flat_map. - /// If asserts or exceptions are enabled, emits flat_map_full if the intrusive_flat_map does not have enough free space. + /// Inserts a range of values to the reference_flat_map. + /// If asserts or exceptions are enabled, emits flat_map_full if the reference_flat_map does not have enough free space. ///\param position The position to insert at. ///\param first The first element to add. ///\param last The last + 1 element to add. @@ -611,7 +611,7 @@ namespace etl } //************************************************************************* - /// Clears the intrusive_flat_map. + /// Clears the reference_flat_map. //************************************************************************* void clear() { @@ -741,8 +741,8 @@ namespace etl } //************************************************************************* - /// Gets the current size of the intrusive_flat_map. - ///\return The current size of the intrusive_flat_map. + /// Gets the current size of the reference_flat_map. + ///\return The current size of the reference_flat_map. //************************************************************************* size_type size() const { @@ -750,7 +750,7 @@ namespace etl } //************************************************************************* - /// Checks the 'empty' state of the intrusive_flat_map. + /// Checks the 'empty' state of the reference_flat_map. ///\return true if empty. //************************************************************************* bool empty() const @@ -759,7 +759,7 @@ namespace etl } //************************************************************************* - /// Checks the 'full' state of the intrusive_flat_map. + /// Checks the 'full' state of the reference_flat_map. ///\return true if full. //************************************************************************* bool full() const @@ -768,8 +768,8 @@ namespace etl } //************************************************************************* - /// Returns the capacity of the intrusive_flat_map. - ///\return The capacity of the intrusive_flat_map. + /// Returns the capacity of the reference_flat_map. + ///\return The capacity of the reference_flat_map. //************************************************************************* size_type capacity() const { @@ -777,8 +777,8 @@ namespace etl } //************************************************************************* - /// Returns the maximum possible size of the intrusive_flat_map. - ///\return The maximum size of the intrusive_flat_map. + /// Returns the maximum possible size of the reference_flat_map. + ///\return The maximum size of the reference_flat_map. //************************************************************************* size_type max_size() const { @@ -799,7 +799,7 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iintrusive_flat_map(lookup_t& lookup_) + ireference_flat_map(lookup_t& lookup_) : lookup(lookup_) { } @@ -807,7 +807,7 @@ namespace etl private: //********************************************************************* - /// Inserts a value to the intrusive_flat_map. + /// Inserts a value to the reference_flat_map. ///\param i_element The place to insert. ///\param value The value to insert. //********************************************************************* @@ -818,7 +818,7 @@ namespace etl if (i_element == end()) { // At the end. - ETL_ASSERT(!lookup.full(), ETL_ERROR(intrusive_flat_map_full)); + ETL_ASSERT(!lookup.full(), ETL_ERROR(reference_flat_map_full)); lookup.push_back(&value); result.first = --end(); @@ -833,7 +833,7 @@ namespace etl if (value.first != i_element->first) { // A new one. - ETL_ASSERT(!lookup.full(), ETL_ERROR(intrusive_flat_map_full)); + ETL_ASSERT(!lookup.full(), ETL_ERROR(reference_flat_map_full)); lookup.insert(i_element.ilookup, &value); result.second = true; } @@ -843,48 +843,48 @@ namespace etl } // Disable copy construction and assignment. - iintrusive_flat_map(const iintrusive_flat_map&); - iintrusive_flat_map& operator = (const iintrusive_flat_map&); + ireference_flat_map(const ireference_flat_map&); + ireference_flat_map& operator = (const ireference_flat_map&); lookup_t& lookup; }; //*************************************************************************** /// Equal operator. - ///\param lhs Reference to the first intrusive_flat_map. - ///\param rhs Reference to the second intrusive_flat_map. + ///\param lhs Reference to the first reference_flat_map. + ///\param rhs Reference to the second reference_flat_map. ///\return true if the arrays are equal, otherwise false - ///\ingroup intrusive_flat_map + ///\ingroup reference_flat_map //*************************************************************************** template - bool operator ==(const etl::iintrusive_flat_map& lhs, const etl::iintrusive_flat_map& rhs) + bool operator ==(const etl::ireference_flat_map& lhs, const etl::ireference_flat_map& rhs) { return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** /// Not equal operator. - ///\param lhs Reference to the first intrusive_flat_map. - ///\param rhs Reference to the second intrusive_flat_map. + ///\param lhs Reference to the first reference_flat_map. + ///\param rhs Reference to the second reference_flat_map. ///\return true if the arrays are not equal, otherwise false - ///\ingroup intrusive_flat_map + ///\ingroup reference_flat_map //*************************************************************************** template - bool operator !=(const etl::iintrusive_flat_map& lhs, const etl::iintrusive_flat_map& rhs) + bool operator !=(const etl::ireference_flat_map& lhs, const etl::ireference_flat_map& rhs) { return !(lhs == rhs); } //*************************************************************************** - /// A intrusive_flat_map implementation that uses a fixed size buffer. + /// A reference_flat_map implementation that uses a fixed size buffer. ///\tparam TKey The key type. ///\tparam TValue The value type. ///\tparam TCompare The type to compare keys. Default = std::less ///\tparam MAX_SIZE_ The maximum number of elements that can be stored. - ///\ingroup intrusive_flat_map + ///\ingroup reference_flat_map //*************************************************************************** template > - class intrusive_flat_map : public iintrusive_flat_map + class reference_flat_map : public ireference_flat_map { public: @@ -893,8 +893,8 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - intrusive_flat_map() - : iintrusive_flat_map(lookup) + reference_flat_map() + : ireference_flat_map(lookup) { } @@ -905,28 +905,28 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - intrusive_flat_map(TIterator first, TIterator last) - : iintrusive_flat_map(lookup) + reference_flat_map(TIterator first, TIterator last) + : ireference_flat_map(lookup) { - iintrusive_flat_map::assign(first, last); + ireference_flat_map::assign(first, last); } //************************************************************************* /// Destructor. //************************************************************************* - ~intrusive_flat_map() + ~reference_flat_map() { - iintrusive_flat_map::clear(); + ireference_flat_map::clear(); } //************************************************************************* /// Assignment operator. //************************************************************************* - intrusive_flat_map& operator = (const intrusive_flat_map& rhs) + reference_flat_map& operator = (const reference_flat_map& rhs) { if (&rhs != this) { - iintrusive_flat_map::assign(rhs.cbegin(), rhs.cend()); + ireference_flat_map::assign(rhs.cbegin(), rhs.cend()); } return *this; @@ -934,9 +934,9 @@ namespace etl private: - intrusive_flat_map(const intrusive_flat_map&); + reference_flat_map(const reference_flat_map&); - typedef typename iintrusive_flat_map::value_type node_t; + typedef typename ireference_flat_map::value_type node_t; // The vector that stores pointers to the nodes. etl::vector lookup; diff --git a/src/intrusive_flat_multimap.h b/src/reference_flat_multimap.h similarity index 83% rename from src/intrusive_flat_multimap.h rename to src/reference_flat_multimap.h index 3e4ff28f..b48b5435 100644 --- a/src/intrusive_flat_multimap.h +++ b/src/reference_flat_multimap.h @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef __ETL_INTRUSIVE_FLAT_MULTIMAP_BASE__ -#define __ETL_INTRUSIVE_FLAT_MULTIMAP_BASE__ +#ifndef __ETL_REFERENCE_FLAT_MULTIMAP_BASE__ +#define __ETL_REFERENCE_FLAT_MULTIMAP_BASE__ #include @@ -44,40 +44,40 @@ SOFTWARE. namespace etl { //*************************************************************************** - ///\ingroup intrusive_flat_multimap - /// Exception base for intrusive_flat_multimaps + ///\ingroup reference_flat_multimap + /// Exception base for reference_flat_multimaps //*************************************************************************** - class intrusive_flat_multimap_exception : public exception + class reference_flat_multimap_exception : public exception { public: - intrusive_flat_multimap_exception(string_type what, string_type file_name, numeric_type line_number) + reference_flat_multimap_exception(string_type what, string_type file_name, numeric_type line_number) : exception(what, file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_multimap + ///\ingroup reference_flat_multimap /// Vector full exception. //*************************************************************************** - class intrusive_flat_multimap_full : public intrusive_flat_multimap_exception + class reference_flat_multimap_full : public reference_flat_multimap_exception { public: - intrusive_flat_multimap_full(string_type file_name, numeric_type line_number) - : intrusive_flat_multimap_exception(ETL_ERROR_TEXT("intrusive_flat_multimap:full", ETL_FILE"A"), file_name, line_number) + reference_flat_multimap_full(string_type file_name, numeric_type line_number) + : reference_flat_multimap_exception(ETL_ERROR_TEXT("reference_flat_multimap:full", ETL_FILE"A"), file_name, line_number) { } }; //*************************************************************************** - /// The base class for specifically sized intrusive_flat_multimaps. - /// Can be used as a reference type for all intrusive_flat_multimaps containing a specific type. - ///\ingroup intrusive_flat_multimap + /// The base class for specifically sized reference_flat_multimaps. + /// Can be used as a reference type for all reference_flat_multimaps containing a specific type. + ///\ingroup reference_flat_multimap //*************************************************************************** template > - class iintrusive_flat_multimap + class ireference_flat_multimap { public: @@ -103,7 +103,7 @@ namespace etl { public: - friend class iintrusive_flat_multimap; + friend class ireference_flat_multimap; iterator() { @@ -201,7 +201,7 @@ namespace etl { public: - friend class iintrusive_flat_multimap; + friend class ireference_flat_multimap; const_iterator() { @@ -321,8 +321,8 @@ namespace etl public: //********************************************************************* - /// Returns an iterator to the beginning of the intrusive_flat_multimap. - ///\return An iterator to the beginning of the intrusive_flat_multimap. + /// Returns an iterator to the beginning of the reference_flat_multimap. + ///\return An iterator to the beginning of the reference_flat_multimap. //********************************************************************* iterator begin() { @@ -330,8 +330,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_multimap. - ///\return A const iterator to the beginning of the intrusive_flat_multimap. + /// Returns a const_iterator to the beginning of the reference_flat_multimap. + ///\return A const iterator to the beginning of the reference_flat_multimap. //********************************************************************* const_iterator begin() const { @@ -339,8 +339,8 @@ namespace etl } //********************************************************************* - /// Returns an iterator to the end of the intrusive_flat_multimap. - ///\return An iterator to the end of the intrusive_flat_multimap. + /// Returns an iterator to the end of the reference_flat_multimap. + ///\return An iterator to the end of the reference_flat_multimap. //********************************************************************* iterator end() { @@ -348,8 +348,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_multimap. - ///\return A const iterator to the end of the intrusive_flat_multimap. + /// Returns a const_iterator to the end of the reference_flat_multimap. + ///\return A const iterator to the end of the reference_flat_multimap. //********************************************************************* const_iterator end() const { @@ -357,8 +357,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_multimap. - ///\return A const iterator to the beginning of the intrusive_flat_multimap. + /// Returns a const_iterator to the beginning of the reference_flat_multimap. + ///\return A const iterator to the beginning of the reference_flat_multimap. //********************************************************************* const_iterator cbegin() const { @@ -366,8 +366,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_multimap. - ///\return A const iterator to the end of the intrusive_flat_multimap. + /// Returns a const_iterator to the end of the reference_flat_multimap. + ///\return A const iterator to the end of the reference_flat_multimap. //********************************************************************* const_iterator cend() const { @@ -375,8 +375,8 @@ namespace etl } //********************************************************************* - /// Returns an reverse iterator to the reverse beginning of the intrusive_flat_multimap. - ///\return Iterator to the reverse beginning of the intrusive_flat_multimap. + /// Returns an reverse iterator to the reverse beginning of the reference_flat_multimap. + ///\return Iterator to the reverse beginning of the reference_flat_multimap. //********************************************************************* reverse_iterator rbegin() { @@ -384,8 +384,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_multimap. - ///\return Const iterator to the reverse beginning of the intrusive_flat_multimap. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_multimap. + ///\return Const iterator to the reverse beginning of the reference_flat_multimap. //********************************************************************* const_reverse_iterator rbegin() const { @@ -393,8 +393,8 @@ namespace etl } //********************************************************************* - /// Returns a reverse iterator to the end + 1 of the intrusive_flat_multimap. - ///\return Reverse iterator to the end + 1 of the intrusive_flat_multimap. + /// Returns a reverse iterator to the end + 1 of the reference_flat_multimap. + ///\return Reverse iterator to the end + 1 of the reference_flat_multimap. //********************************************************************* reverse_iterator rend() { @@ -402,8 +402,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_multimap. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_multimap. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_multimap. + ///\return Const reverse iterator to the end + 1 of the reference_flat_multimap. //********************************************************************* const_reverse_iterator rend() const { @@ -411,8 +411,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_multimap. - ///\return Const reverse iterator to the reverse beginning of the intrusive_flat_multimap. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_multimap. + ///\return Const reverse iterator to the reverse beginning of the reference_flat_multimap. //********************************************************************* const_reverse_iterator crbegin() const { @@ -420,8 +420,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_multimap. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_multimap. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_multimap. + ///\return Const reverse iterator to the end + 1 of the reference_flat_multimap. //********************************************************************* const_reverse_iterator crend() const { @@ -429,9 +429,9 @@ namespace etl } //********************************************************************* - /// Assigns values to the intrusive_flat_multimap. - /// If asserts or exceptions are enabled, emits intrusive_flat_multimap_full if the intrusive_flat_multimap does not have enough free space. - /// If asserts or exceptions are enabled, emits intrusive_flat_multimap_iterator if the iterators are reversed. + /// Assigns values to the reference_flat_multimap. + /// If asserts or exceptions are enabled, emits reference_flat_multimap_full if the reference_flat_multimap does not have enough free space. + /// If asserts or exceptions are enabled, emits reference_flat_multimap_iterator if the iterators are reversed. ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //********************************************************************* @@ -440,7 +440,7 @@ namespace etl { #if defined(ETL_DEBUG) difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(intrusive_flat_multimap_full)); + ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(reference_flat_multimap_full)); #endif clear(); @@ -452,13 +452,13 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_multimap. - /// If asserts or exceptions are enabled, emits intrusive_flat_multimap_full if the intrusive_flat_multimap is already full. + /// Inserts a value to the reference_flat_multimap. + /// If asserts or exceptions are enabled, emits reference_flat_multimap_full if the reference_flat_multimap is already full. ///\param value The value to insert. //********************************************************************* std::pair insert(value_type& value) { - ETL_ASSERT(!lookup.full(), ETL_ERROR(intrusive_flat_multimap_full)); + ETL_ASSERT(!lookup.full(), ETL_ERROR(reference_flat_multimap_full)); std::pair result(end(), false); @@ -479,8 +479,8 @@ namespace etl } //********************************************************************* - /// Inserts a range of values to the intrusive_flat_multimap. - /// If asserts or exceptions are enabled, emits intrusive_flat_multimap_full if the intrusive_flat_multimap does not have enough free space. + /// Inserts a range of values to the reference_flat_multimap. + /// If asserts or exceptions are enabled, emits reference_flat_multimap_full if the reference_flat_multimap does not have enough free space. ///\param position The position to insert at. ///\param first The first element to add. ///\param last The last + 1 element to add. @@ -537,7 +537,7 @@ namespace etl } //************************************************************************* - /// Clears the intrusive_flat_multimap. + /// Clears the reference_flat_multimap. //************************************************************************* void clear() { @@ -727,7 +727,7 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iintrusive_flat_multimap(lookup_t& lookup_) + ireference_flat_multimap(lookup_t& lookup_) : lookup(lookup_) { } @@ -735,7 +735,7 @@ namespace etl private: //********************************************************************* - /// Inserts a value to the intrusive_flat_multimap. + /// Inserts a value to the reference_flat_multimap. ///\param i_element The place to insert. ///\param value The value to insert. //********************************************************************* @@ -762,48 +762,48 @@ namespace etl } // Disable copy construction and assignment. - iintrusive_flat_multimap(const iintrusive_flat_multimap&); - iintrusive_flat_multimap& operator = (const iintrusive_flat_multimap&); + ireference_flat_multimap(const ireference_flat_multimap&); + ireference_flat_multimap& operator = (const ireference_flat_multimap&); lookup_t& lookup; }; //*************************************************************************** /// Equal operator. - ///\param lhs Reference to the first intrusive_flat_multimap. - ///\param rhs Reference to the second intrusive_flat_multimap. + ///\param lhs Reference to the first reference_flat_multimap. + ///\param rhs Reference to the second reference_flat_multimap. ///\return true if the arrays are equal, otherwise false - ///\ingroup intrusive_flat_multimap + ///\ingroup reference_flat_multimap //*************************************************************************** template - bool operator ==(const etl::iintrusive_flat_multimap& lhs, const etl::iintrusive_flat_multimap& rhs) + bool operator ==(const etl::ireference_flat_multimap& lhs, const etl::ireference_flat_multimap& rhs) { return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** /// Not equal operator. - ///\param lhs Reference to the first intrusive_flat_multimap. - ///\param rhs Reference to the second intrusive_flat_multimap. + ///\param lhs Reference to the first reference_flat_multimap. + ///\param rhs Reference to the second reference_flat_multimap. ///\return true if the arrays are not equal, otherwise false - ///\ingroup intrusive_flat_multimap + ///\ingroup reference_flat_multimap //*************************************************************************** template - bool operator !=(const etl::iintrusive_flat_multimap& lhs, const etl::iintrusive_flat_multimap& rhs) + bool operator !=(const etl::ireference_flat_multimap& lhs, const etl::ireference_flat_multimap& rhs) { return !(lhs == rhs); } template > //*************************************************************************** - /// A intrusive_flat_multimap implementation that uses a fixed size buffer. + /// A reference_flat_multimap implementation that uses a fixed size buffer. ///\tparam TKey The key type. ///\tparam TValue The value type. ///\tparam TCompare The type to compare keys. Default = std::less ///\tparam MAX_SIZE_ The maximum number of elements that can be stored. - ///\ingroup intrusive_flat_multimap + ///\ingroup reference_flat_multimap //*************************************************************************** - class intrusive_flat_multimap : public iintrusive_flat_multimap + class reference_flat_multimap : public ireference_flat_multimap { public: @@ -812,18 +812,18 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - intrusive_flat_multimap() - : iintrusive_flat_multimap(lookup) + reference_flat_multimap() + : ireference_flat_multimap(lookup) { } //************************************************************************* /// Copy constructor. //************************************************************************* - intrusive_flat_multimap(const intrusive_flat_multimap& other) - : iintrusive_flat_multimap(lookup) + reference_flat_multimap(const reference_flat_multimap& other) + : ireference_flat_multimap(lookup) { - iintrusive_flat_multimap::assign(other.cbegin(), other.cend()); + ireference_flat_multimap::assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -833,23 +833,23 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - intrusive_flat_multimap(TIterator first, TIterator last) - : iintrusive_flat_multimap(lookup) + reference_flat_multimap(TIterator first, TIterator last) + : ireference_flat_multimap(lookup) { - iintrusive_flat_multimap::assign(first, last); + ireference_flat_multimap::assign(first, last); } //************************************************************************* /// Destructor. //************************************************************************* - ~intrusive_flat_multimap() + ~reference_flat_multimap() { - iintrusive_flat_multimap::clear(); + ireference_flat_multimap::clear(); } private: - typedef typename iintrusive_flat_multimap::value_type node_t; + typedef typename ireference_flat_multimap::value_type node_t; // The vector that stores pointers to the nodes. etl::vector lookup; diff --git a/src/intrusive_flat_multiset.h b/src/reference_flat_multiset.h similarity index 80% rename from src/intrusive_flat_multiset.h rename to src/reference_flat_multiset.h index b13b985c..f5f01256 100644 --- a/src/intrusive_flat_multiset.h +++ b/src/reference_flat_multiset.h @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef __ETL_INTRUSIVE_FLAT_MULTISET__ -#define __ETL_INTRUSIVE_FLAT_MULTISET__ +#ifndef __ETL_REFERENCE_FLAT_MULTISET__ +#define __ETL_REFERENCE_FLAT_MULTISET__ #include #include @@ -50,54 +50,54 @@ SOFTWARE. namespace etl { //*************************************************************************** - ///\ingroup intrusive_flat_multiset - /// Exception base for intrusive_flat_multisets + ///\ingroup reference_flat_multiset + /// Exception base for reference_flat_multisets //*************************************************************************** - class intrusive_flat_multiset_exception : public exception + class reference_flat_multiset_exception : public exception { public: - intrusive_flat_multiset_exception(string_type what, string_type file_name, numeric_type line_number) + reference_flat_multiset_exception(string_type what, string_type file_name, numeric_type line_number) : exception(what, file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_multiset + ///\ingroup reference_flat_multiset /// Vector full exception. //*************************************************************************** - class intrusive_flat_multiset_full : public intrusive_flat_multiset_exception + class reference_flat_multiset_full : public reference_flat_multiset_exception { public: - intrusive_flat_multiset_full(string_type file_name, numeric_type line_number) - : intrusive_flat_multiset_exception(ETL_ERROR_TEXT("intrusive_flat_multiset:full", ETL_FILE"A"), file_name, line_number) + reference_flat_multiset_full(string_type file_name, numeric_type line_number) + : reference_flat_multiset_exception(ETL_ERROR_TEXT("reference_flat_multiset:full", ETL_FILE"A"), file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_multiset + ///\ingroup reference_flat_multiset /// Vector iterator exception. //*************************************************************************** - class intrusive_flat_multiset_iterator : public intrusive_flat_multiset_exception + class reference_flat_multiset_iterator : public reference_flat_multiset_exception { public: - intrusive_flat_multiset_iterator(string_type file_name, numeric_type line_number) - : intrusive_flat_multiset_exception(ETL_ERROR_TEXT("intrusive_flat_multiset:iterator", ETL_FILE"C"), file_name, line_number) + reference_flat_multiset_iterator(string_type file_name, numeric_type line_number) + : reference_flat_multiset_exception(ETL_ERROR_TEXT("reference_flat_multiset:iterator", ETL_FILE"C"), file_name, line_number) { } }; //*************************************************************************** - /// The base class for specifically sized intrusive_flat_multisets. - /// Can be used as a reference type for all intrusive_flat_multisets containing a specific type. - ///\ingroup intrusive_flat_multiset + /// The base class for specifically sized reference_flat_multisets. + /// Can be used as a reference type for all reference_flat_multisets containing a specific type. + ///\ingroup reference_flat_multiset //*************************************************************************** template > - class iintrusive_flat_multiset + class ireference_flat_multiset { public: @@ -121,7 +121,7 @@ namespace etl { public: - friend class iintrusive_flat_multiset; + friend class ireference_flat_multiset; iterator() { @@ -219,7 +219,7 @@ namespace etl { public: - friend class iintrusive_flat_multiset; + friend class ireference_flat_multiset; const_iterator() { @@ -315,8 +315,8 @@ namespace etl typedef typename std::iterator_traits::difference_type difference_type; //********************************************************************* - /// Returns an iterator to the beginning of the intrusive_flat_multiset. - ///\return An iterator to the beginning of the intrusive_flat_multiset. + /// Returns an iterator to the beginning of the reference_flat_multiset. + ///\return An iterator to the beginning of the reference_flat_multiset. //********************************************************************* iterator begin() { @@ -324,8 +324,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_multiset. - ///\return A const iterator to the beginning of the intrusive_flat_multiset. + /// Returns a const_iterator to the beginning of the reference_flat_multiset. + ///\return A const iterator to the beginning of the reference_flat_multiset. //********************************************************************* const_iterator begin() const { @@ -333,8 +333,8 @@ namespace etl } //********************************************************************* - /// Returns an iterator to the end of the intrusive_flat_multiset. - ///\return An iterator to the end of the intrusive_flat_multiset. + /// Returns an iterator to the end of the reference_flat_multiset. + ///\return An iterator to the end of the reference_flat_multiset. //********************************************************************* iterator end() { @@ -342,8 +342,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_multiset. - ///\return A const iterator to the end of the intrusive_flat_multiset. + /// Returns a const_iterator to the end of the reference_flat_multiset. + ///\return A const iterator to the end of the reference_flat_multiset. //********************************************************************* const_iterator end() const { @@ -351,8 +351,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_multiset. - ///\return A const iterator to the beginning of the intrusive_flat_multiset. + /// Returns a const_iterator to the beginning of the reference_flat_multiset. + ///\return A const iterator to the beginning of the reference_flat_multiset. //********************************************************************* const_iterator cbegin() const { @@ -360,8 +360,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_multiset. - ///\return A const iterator to the end of the intrusive_flat_multiset. + /// Returns a const_iterator to the end of the reference_flat_multiset. + ///\return A const iterator to the end of the reference_flat_multiset. //********************************************************************* const_iterator cend() const { @@ -369,8 +369,8 @@ namespace etl } //********************************************************************* - /// Returns an reverse iterator to the reverse beginning of the intrusive_flat_multiset. - ///\return Iterator to the reverse beginning of the intrusive_flat_multiset. + /// Returns an reverse iterator to the reverse beginning of the reference_flat_multiset. + ///\return Iterator to the reverse beginning of the reference_flat_multiset. //********************************************************************* reverse_iterator rbegin() { @@ -378,8 +378,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_multiset. - ///\return Const iterator to the reverse beginning of the intrusive_flat_multiset. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_multiset. + ///\return Const iterator to the reverse beginning of the reference_flat_multiset. //********************************************************************* const_reverse_iterator rbegin() const { @@ -387,8 +387,8 @@ namespace etl } //********************************************************************* - /// Returns a reverse iterator to the end + 1 of the intrusive_flat_multiset. - ///\return Reverse iterator to the end + 1 of the intrusive_flat_multiset. + /// Returns a reverse iterator to the end + 1 of the reference_flat_multiset. + ///\return Reverse iterator to the end + 1 of the reference_flat_multiset. //********************************************************************* reverse_iterator rend() { @@ -396,8 +396,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_multiset. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_multiset. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_multiset. + ///\return Const reverse iterator to the end + 1 of the reference_flat_multiset. //********************************************************************* const_reverse_iterator rend() const { @@ -405,8 +405,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_multiset. - ///\return Const reverse iterator to the reverse beginning of the intrusive_flat_multiset. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_multiset. + ///\return Const reverse iterator to the reverse beginning of the reference_flat_multiset. //********************************************************************* const_reverse_iterator crbegin() const { @@ -414,8 +414,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_multiset. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_multiset. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_multiset. + ///\return Const reverse iterator to the end + 1 of the reference_flat_multiset. //********************************************************************* const_reverse_iterator crend() const { @@ -423,9 +423,9 @@ namespace etl } //********************************************************************* - /// Assigns values to the intrusive_flat_multiset. - /// If asserts or exceptions are enabled, emits intrusive_flat_multiset_full if the intrusive_flat_multiset does not have enough free space. - /// If asserts or exceptions are enabled, emits intrusive_flat_multiset_iterator if the iterators are reversed. + /// Assigns values to the reference_flat_multiset. + /// If asserts or exceptions are enabled, emits reference_flat_multiset_full if the reference_flat_multiset does not have enough free space. + /// If asserts or exceptions are enabled, emits reference_flat_multiset_iterator if the iterators are reversed. ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //********************************************************************* @@ -434,7 +434,7 @@ namespace etl { #if defined(ETL_DEBUG) difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(intrusive_flat_multiset_full)); + ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(reference_flat_multiset_full)); #endif clear(); @@ -446,15 +446,15 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_multiset. - /// If asserts or exceptions are enabled, emits intrusive_flat_multiset_full if the intrusive_flat_multiset is already full. + /// Inserts a value to the reference_flat_multiset. + /// If asserts or exceptions are enabled, emits reference_flat_multiset_full if the reference_flat_multiset is already full. ///\param value The value to insert. //********************************************************************* std::pair insert(value_type& value) { std::pair result(end(), false); - ETL_ASSERT(!lookup.full(), ETL_ERROR(intrusive_flat_multiset_full)); + ETL_ASSERT(!lookup.full(), ETL_ERROR(reference_flat_multiset_full)); iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare()); @@ -477,8 +477,8 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_multiset. - /// If asserts or exceptions are enabled, emits intrusive_flat_multiset_full if the intrusive_flat_multiset is already full. + /// Inserts a value to the reference_flat_multiset. + /// If asserts or exceptions are enabled, emits reference_flat_multiset_full if the reference_flat_multiset is already full. ///\param position The position to insert at. ///\param value The value to insert. //********************************************************************* @@ -488,8 +488,8 @@ namespace etl } //********************************************************************* - /// Inserts a range of values to the intrusive_flat_multiset. - /// If asserts or exceptions are enabled, emits intrusive_flat_multiset_full if the intrusive_flat_multiset does not have enough free space. + /// Inserts a range of values to the reference_flat_multiset. + /// If asserts or exceptions are enabled, emits reference_flat_multiset_full if the reference_flat_multiset does not have enough free space. ///\param position The position to insert at. ///\param first The first element to add. ///\param last The last + 1 element to add. @@ -546,7 +546,7 @@ namespace etl } //************************************************************************* - /// Clears the intrusive_flat_multiset. + /// Clears the reference_flat_multiset. //************************************************************************* void clear() { @@ -674,8 +674,8 @@ namespace etl } //************************************************************************* - /// Gets the current size of the intrusive_flat_multiset. - ///\return The current size of the intrusive_flat_multiset. + /// Gets the current size of the reference_flat_multiset. + ///\return The current size of the reference_flat_multiset. //************************************************************************* size_type size() const { @@ -683,7 +683,7 @@ namespace etl } //************************************************************************* - /// Checks the 'empty' state of the intrusive_flat_multiset. + /// Checks the 'empty' state of the reference_flat_multiset. ///\return true if empty. //************************************************************************* bool empty() const @@ -692,7 +692,7 @@ namespace etl } //************************************************************************* - /// Checks the 'full' state of the intrusive_flat_multiset. + /// Checks the 'full' state of the reference_flat_multiset. ///\return true if full. //************************************************************************* bool full() const @@ -701,8 +701,8 @@ namespace etl } //************************************************************************* - /// Returns the capacity of the intrusive_flat_multiset. - ///\return The capacity of the intrusive_flat_multiset. + /// Returns the capacity of the reference_flat_multiset. + ///\return The capacity of the reference_flat_multiset. //************************************************************************* size_type capacity() const { @@ -710,8 +710,8 @@ namespace etl } //************************************************************************* - /// Returns the maximum possible size of the intrusive_flat_multiset. - ///\return The maximum size of the intrusive_flat_multiset. + /// Returns the maximum possible size of the reference_flat_multiset. + ///\return The maximum size of the reference_flat_multiset. //************************************************************************* size_type max_size() const { @@ -732,7 +732,7 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iintrusive_flat_multiset(lookup_t& lookup_) + ireference_flat_multiset(lookup_t& lookup_) : lookup(lookup_) { } @@ -740,18 +740,18 @@ namespace etl private: // Disable copy construction. - iintrusive_flat_multiset(const iintrusive_flat_multiset&); - iintrusive_flat_multiset& operator =(const iintrusive_flat_multiset&); + ireference_flat_multiset(const ireference_flat_multiset&); + ireference_flat_multiset& operator =(const ireference_flat_multiset&); lookup_t& lookup; }; //*************************************************************************** - /// An intrusive flat set - ///\ingroup intrusive_flat_multiset + /// An reference flat set + ///\ingroup reference_flat_multiset //*************************************************************************** template > - class intrusive_flat_multiset : public iintrusive_flat_multiset + class reference_flat_multiset : public ireference_flat_multiset { public: @@ -760,18 +760,18 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - intrusive_flat_multiset() - : iintrusive_flat_multiset(lookup) + reference_flat_multiset() + : ireference_flat_multiset(lookup) { } //************************************************************************* /// Copy constructor. //************************************************************************* - intrusive_flat_multiset(const intrusive_flat_multiset& other) - : iintrusive_flat_multiset(lookup) + reference_flat_multiset(const reference_flat_multiset& other) + : ireference_flat_multiset(lookup) { - iintrusive_flat_multiset::assign(other.cbegin(), other.cend()); + ireference_flat_multiset::assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -781,18 +781,18 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - intrusive_flat_multiset(TIterator first, TIterator last) - : iintrusive_flat_multiset(lookup) + reference_flat_multiset(TIterator first, TIterator last) + : ireference_flat_multiset(lookup) { - iintrusive_flat_multiset::assign(first, last); + ireference_flat_multiset::assign(first, last); } //************************************************************************* /// Destructor. //************************************************************************* - ~intrusive_flat_multiset() + ~reference_flat_multiset() { - iintrusive_flat_multiset::clear(); + ireference_flat_multiset::clear(); } private: @@ -805,26 +805,26 @@ namespace etl //*************************************************************************** /// Equal operator. - ///\param lhs Reference to the first intrusive_flat_multiset. - ///\param rhs Reference to the second intrusive_flat_multiset. + ///\param lhs Reference to the first reference_flat_multiset. + ///\param rhs Reference to the second reference_flat_multiset. ///\return true if the arrays are equal, otherwise false - ///\ingroup intrusive_flat_multiset + ///\ingroup reference_flat_multiset //*************************************************************************** template - bool operator ==(const etl::iintrusive_flat_multiset& lhs, const etl::iintrusive_flat_multiset& rhs) + bool operator ==(const etl::ireference_flat_multiset& lhs, const etl::ireference_flat_multiset& rhs) { return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** /// Not equal operator. - ///\param lhs Reference to the first intrusive_flat_multiset. - ///\param rhs Reference to the second intrusive_flat_multiset. + ///\param lhs Reference to the first reference_flat_multiset. + ///\param rhs Reference to the second reference_flat_multiset. ///\return true if the arrays are not equal, otherwise false - ///\ingroup intrusive_flat_multiset + ///\ingroup reference_flat_multiset //*************************************************************************** template - bool operator !=(const etl::iintrusive_flat_multiset& lhs, const etl::iintrusive_flat_multiset& rhs) + bool operator !=(const etl::ireference_flat_multiset& lhs, const etl::ireference_flat_multiset& rhs) { return !(lhs == rhs); } diff --git a/src/intrusive_flat_set.h b/src/reference_flat_set.h similarity index 81% rename from src/intrusive_flat_set.h rename to src/reference_flat_set.h index f307ed87..e5a9e6a9 100644 --- a/src/intrusive_flat_set.h +++ b/src/reference_flat_set.h @@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ -#ifndef __ETL_INTRUSIVE_FLAT_SET__ -#define __ETL_INTRUSIVE_FLAT_SET__ +#ifndef __ETL_REFERENCE_FLAT_SET__ +#define __ETL_REFERENCE_FLAT_SET__ #include #include @@ -50,54 +50,54 @@ SOFTWARE. namespace etl { //*************************************************************************** - ///\ingroup intrusive_flat_set - /// Exception base for intrusive_flat_sets + ///\ingroup reference_flat_set + /// Exception base for reference_flat_sets //*************************************************************************** - class intrusive_flat_set_exception : public exception + class reference_flat_set_exception : public exception { public: - intrusive_flat_set_exception(string_type what, string_type file_name, numeric_type line_number) + reference_flat_set_exception(string_type what, string_type file_name, numeric_type line_number) : exception(what, file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_set + ///\ingroup reference_flat_set /// Vector full exception. //*************************************************************************** - class intrusive_flat_set_full : public intrusive_flat_set_exception + class reference_flat_set_full : public reference_flat_set_exception { public: - intrusive_flat_set_full(string_type file_name, numeric_type line_number) - : intrusive_flat_set_exception(ETL_ERROR_TEXT("intrusive_flat_set:full", ETL_FILE"A"), file_name, line_number) + reference_flat_set_full(string_type file_name, numeric_type line_number) + : reference_flat_set_exception(ETL_ERROR_TEXT("reference_flat_set:full", ETL_FILE"A"), file_name, line_number) { } }; //*************************************************************************** - ///\ingroup intrusive_flat_set + ///\ingroup reference_flat_set /// Vector iterator exception. //*************************************************************************** - class intrusive_flat_set_iterator : public intrusive_flat_set_exception + class reference_flat_set_iterator : public reference_flat_set_exception { public: - intrusive_flat_set_iterator(string_type file_name, numeric_type line_number) - : intrusive_flat_set_exception(ETL_ERROR_TEXT("intrusive_flat_set:iterator", ETL_FILE"C"), file_name, line_number) + reference_flat_set_iterator(string_type file_name, numeric_type line_number) + : reference_flat_set_exception(ETL_ERROR_TEXT("reference_flat_set:iterator", ETL_FILE"C"), file_name, line_number) { } }; //*************************************************************************** - /// The base class for specifically sized intrusive_flat_sets. - /// Can be used as a reference type for all intrusive_flat_sets containing a specific type. - ///\ingroup intrusive_flat_set + /// The base class for specifically sized reference_flat_sets. + /// Can be used as a reference type for all reference_flat_sets containing a specific type. + ///\ingroup reference_flat_set //*************************************************************************** template > - class iintrusive_flat_set + class ireference_flat_set { public: @@ -121,7 +121,7 @@ namespace etl { public: - friend class iintrusive_flat_set; + friend class ireference_flat_set; iterator() { @@ -219,7 +219,7 @@ namespace etl { public: - friend class iintrusive_flat_set; + friend class ireference_flat_set; const_iterator() { @@ -319,8 +319,8 @@ namespace etl typedef typename std::iterator_traits::difference_type difference_type; //********************************************************************* - /// Returns an iterator to the beginning of the intrusive_flat_set. - ///\return An iterator to the beginning of the intrusive_flat_set. + /// Returns an iterator to the beginning of the reference_flat_set. + ///\return An iterator to the beginning of the reference_flat_set. //********************************************************************* iterator begin() { @@ -328,8 +328,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_set. - ///\return A const iterator to the beginning of the intrusive_flat_set. + /// Returns a const_iterator to the beginning of the reference_flat_set. + ///\return A const iterator to the beginning of the reference_flat_set. //********************************************************************* const_iterator begin() const { @@ -337,8 +337,8 @@ namespace etl } //********************************************************************* - /// Returns an iterator to the end of the intrusive_flat_set. - ///\return An iterator to the end of the intrusive_flat_set. + /// Returns an iterator to the end of the reference_flat_set. + ///\return An iterator to the end of the reference_flat_set. //********************************************************************* iterator end() { @@ -346,8 +346,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_set. - ///\return A const iterator to the end of the intrusive_flat_set. + /// Returns a const_iterator to the end of the reference_flat_set. + ///\return A const iterator to the end of the reference_flat_set. //********************************************************************* const_iterator end() const { @@ -355,8 +355,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the beginning of the intrusive_flat_set. - ///\return A const iterator to the beginning of the intrusive_flat_set. + /// Returns a const_iterator to the beginning of the reference_flat_set. + ///\return A const iterator to the beginning of the reference_flat_set. //********************************************************************* const_iterator cbegin() const { @@ -364,8 +364,8 @@ namespace etl } //********************************************************************* - /// Returns a const_iterator to the end of the intrusive_flat_set. - ///\return A const iterator to the end of the intrusive_flat_set. + /// Returns a const_iterator to the end of the reference_flat_set. + ///\return A const iterator to the end of the reference_flat_set. //********************************************************************* const_iterator cend() const { @@ -373,8 +373,8 @@ namespace etl } //********************************************************************* - /// Returns an reverse iterator to the reverse beginning of the intrusive_flat_set. - ///\return Iterator to the reverse beginning of the intrusive_flat_set. + /// Returns an reverse iterator to the reverse beginning of the reference_flat_set. + ///\return Iterator to the reverse beginning of the reference_flat_set. //********************************************************************* reverse_iterator rbegin() { @@ -382,8 +382,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_set. - ///\return Const iterator to the reverse beginning of the intrusive_flat_set. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_set. + ///\return Const iterator to the reverse beginning of the reference_flat_set. //********************************************************************* const_reverse_iterator rbegin() const { @@ -391,8 +391,8 @@ namespace etl } //********************************************************************* - /// Returns a reverse iterator to the end + 1 of the intrusive_flat_set. - ///\return Reverse iterator to the end + 1 of the intrusive_flat_set. + /// Returns a reverse iterator to the end + 1 of the reference_flat_set. + ///\return Reverse iterator to the end + 1 of the reference_flat_set. //********************************************************************* reverse_iterator rend() { @@ -400,8 +400,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_set. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_set. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_set. + ///\return Const reverse iterator to the end + 1 of the reference_flat_set. //********************************************************************* const_reverse_iterator rend() const { @@ -409,8 +409,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the reverse beginning of the intrusive_flat_set. - ///\return Const reverse iterator to the reverse beginning of the intrusive_flat_set. + /// Returns a const reverse iterator to the reverse beginning of the reference_flat_set. + ///\return Const reverse iterator to the reverse beginning of the reference_flat_set. //********************************************************************* const_reverse_iterator crbegin() const { @@ -418,8 +418,8 @@ namespace etl } //********************************************************************* - /// Returns a const reverse iterator to the end + 1 of the intrusive_flat_set. - ///\return Const reverse iterator to the end + 1 of the intrusive_flat_set. + /// Returns a const reverse iterator to the end + 1 of the reference_flat_set. + ///\return Const reverse iterator to the end + 1 of the reference_flat_set. //********************************************************************* const_reverse_iterator crend() const { @@ -427,9 +427,9 @@ namespace etl } //********************************************************************* - /// Assigns values to the intrusive_flat_set. - /// If asserts or exceptions are enabled, emits intrusive_flat_set_full if the intrusive_flat_set does not have enough free space. - /// If asserts or exceptions are enabled, emits intrusive_flat_set_iterator if the iterators are reversed. + /// Assigns values to the reference_flat_set. + /// If asserts or exceptions are enabled, emits reference_flat_set_full if the reference_flat_set does not have enough free space. + /// If asserts or exceptions are enabled, emits reference_flat_set_iterator if the iterators are reversed. ///\param first The iterator to the first element. ///\param last The iterator to the last element + 1. //********************************************************************* @@ -438,7 +438,7 @@ namespace etl { #if defined(ETL_DEBUG) difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(intrusive_flat_set_full)); + ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(reference_flat_set_full)); #endif clear(); @@ -450,15 +450,15 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_set. - /// If asserts or exceptions are enabled, emits intrusive_flat_set_full if the intrusive_flat_set is already full. + /// Inserts a value to the reference_flat_set. + /// If asserts or exceptions are enabled, emits reference_flat_set_full if the reference_flat_set is already full. ///\param value The value to insert. //********************************************************************* std::pair insert(value_type& value) { std::pair result(end(), false); - ETL_ASSERT(!lookup.full(), ETL_ERROR(intrusive_flat_set_full)); + ETL_ASSERT(!lookup.full(), ETL_ERROR(reference_flat_set_full)); iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare()); @@ -490,8 +490,8 @@ namespace etl } //********************************************************************* - /// Inserts a value to the intrusive_flat_set. - /// If asserts or exceptions are enabled, emits intrusive_flat_set_full if the intrusive_flat_set is already full. + /// Inserts a value to the reference_flat_set. + /// If asserts or exceptions are enabled, emits reference_flat_set_full if the reference_flat_set is already full. ///\param position The position to insert at. ///\param value The value to insert. //********************************************************************* @@ -501,8 +501,8 @@ namespace etl } //********************************************************************* - /// Inserts a range of values to the intrusive_flat_set. - /// If asserts or exceptions are enabled, emits intrusive_flat_set_full if the intrusive_flat_set does not have enough free space. + /// Inserts a range of values to the reference_flat_set. + /// If asserts or exceptions are enabled, emits reference_flat_set_full if the reference_flat_set does not have enough free space. ///\param position The position to insert at. ///\param first The first element to add. ///\param last The last + 1 element to add. @@ -558,7 +558,7 @@ namespace etl } //************************************************************************* - /// Clears the intrusive_flat_set. + /// Clears the reference_flat_set. //************************************************************************* void clear() { @@ -684,8 +684,8 @@ namespace etl } //************************************************************************* - /// Gets the current size of the intrusive_flat_set. - ///\return The current size of the intrusive_flat_set. + /// Gets the current size of the reference_flat_set. + ///\return The current size of the reference_flat_set. //************************************************************************* size_type size() const { @@ -693,7 +693,7 @@ namespace etl } //************************************************************************* - /// Checks the 'empty' state of the intrusive_flat_set. + /// Checks the 'empty' state of the reference_flat_set. ///\return true if empty. //************************************************************************* bool empty() const @@ -702,7 +702,7 @@ namespace etl } //************************************************************************* - /// Checks the 'full' state of the intrusive_flat_set. + /// Checks the 'full' state of the reference_flat_set. ///\return true if full. //************************************************************************* bool full() const @@ -711,8 +711,8 @@ namespace etl } //************************************************************************* - /// Returns the capacity of the intrusive_flat_set. - ///\return The capacity of the intrusive_flat_set. + /// Returns the capacity of the reference_flat_set. + ///\return The capacity of the reference_flat_set. //************************************************************************* size_type capacity() const { @@ -720,8 +720,8 @@ namespace etl } //************************************************************************* - /// Returns the maximum possible size of the intrusive_flat_set. - ///\return The maximum size of the intrusive_flat_set. + /// Returns the maximum possible size of the reference_flat_set. + ///\return The maximum size of the reference_flat_set. //************************************************************************* size_type max_size() const { @@ -742,7 +742,7 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iintrusive_flat_set(lookup_t& lookup_) + ireference_flat_set(lookup_t& lookup_) : lookup(lookup_) { } @@ -750,18 +750,18 @@ namespace etl private: // Disable copy construction. - iintrusive_flat_set(const iintrusive_flat_set&); - iintrusive_flat_set& operator =(const iintrusive_flat_set&); + ireference_flat_set(const ireference_flat_set&); + ireference_flat_set& operator =(const ireference_flat_set&); lookup_t& lookup; }; //*************************************************************************** - /// An intrusive flat set - ///\ingroup intrusive_flat_set + /// An reference flat set + ///\ingroup reference_flat_set //*************************************************************************** template > - class intrusive_flat_set : public iintrusive_flat_set + class reference_flat_set : public ireference_flat_set { public: @@ -770,18 +770,18 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - intrusive_flat_set() - : iintrusive_flat_set(lookup) + reference_flat_set() + : ireference_flat_set(lookup) { } //************************************************************************* /// Copy constructor. //************************************************************************* - intrusive_flat_set(const intrusive_flat_set& other) - : iintrusive_flat_set(lookup) + reference_flat_set(const reference_flat_set& other) + : ireference_flat_set(lookup) { - iintrusive_flat_set::assign(other.cbegin(), other.cend()); + ireference_flat_set::assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -791,18 +791,18 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - intrusive_flat_set(TIterator first, TIterator last) - : iintrusive_flat_set(lookup) + reference_flat_set(TIterator first, TIterator last) + : ireference_flat_set(lookup) { - iintrusive_flat_set::assign(first, last); + ireference_flat_set::assign(first, last); } //************************************************************************* /// Destructor. //************************************************************************* - ~intrusive_flat_set() + ~reference_flat_set() { - iintrusive_flat_set::clear(); + ireference_flat_set::clear(); } private: @@ -815,26 +815,26 @@ namespace etl //*************************************************************************** /// Equal operator. - ///\param lhs Reference to the first intrusive_flat_set. - ///\param rhs Reference to the second intrusive_flat_set. + ///\param lhs Reference to the first reference_flat_set. + ///\param rhs Reference to the second reference_flat_set. ///\return true if the arrays are equal, otherwise false - ///\ingroup intrusive_flat_set + ///\ingroup reference_flat_set //*************************************************************************** template - bool operator ==(const etl::iintrusive_flat_set& lhs, const etl::iintrusive_flat_set& rhs) + bool operator ==(const etl::ireference_flat_set& lhs, const etl::ireference_flat_set& rhs) { return (lhs.size() == rhs.size()) && std::equal(lhs.begin(), lhs.end(), rhs.begin()); } //*************************************************************************** /// Not equal operator. - ///\param lhs Reference to the first intrusive_flat_set. - ///\param rhs Reference to the second intrusive_flat_set. + ///\param lhs Reference to the first reference_flat_set. + ///\param rhs Reference to the second reference_flat_set. ///\return true if the arrays are not equal, otherwise false - ///\ingroup intrusive_flat_set + ///\ingroup reference_flat_set //*************************************************************************** template - bool operator !=(const etl::iintrusive_flat_set& lhs, const etl::iintrusive_flat_set& rhs) + bool operator !=(const etl::ireference_flat_set& lhs, const etl::ireference_flat_set& rhs) { return !(lhs == rhs); } diff --git a/test/test_intrusive_flat_map.cpp b/test/test_reference_flat_map.cpp similarity index 98% rename from test/test_intrusive_flat_map.cpp rename to test/test_reference_flat_map.cpp index 8939aa2e..90047c0e 100644 --- a/test/test_intrusive_flat_map.cpp +++ b/test/test_reference_flat_map.cpp @@ -40,7 +40,7 @@ SOFTWARE. #include "data.h" -#include "intrusive_flat_map.h" +#include "reference_flat_map.h" namespace { @@ -52,10 +52,10 @@ namespace typedef std::pair ElementDC; typedef std::pair ElementNDC; - typedef etl::intrusive_flat_map DataDC; - typedef etl::intrusive_flat_map DataNDC; - typedef etl::iintrusive_flat_map IDataDC; - typedef etl::iintrusive_flat_map IDataNDC; + typedef etl::reference_flat_map DataDC; + typedef etl::reference_flat_map DataNDC; + typedef etl::ireference_flat_map IDataDC; + typedef etl::ireference_flat_map IDataNDC; typedef std::map Compare_DataDC; typedef std::map Compare_DataNDC; @@ -344,7 +344,7 @@ namespace { DataNDC data(initial_data.begin(), initial_data.end()); - CHECK_THROW(data.at(10), etl::intrusive_flat_map_out_of_bounds); + CHECK_THROW(data.at(10), etl::reference_flat_map_out_of_bounds); } //************************************************************************* @@ -370,7 +370,7 @@ namespace { const DataNDC data(initial_data.begin(), initial_data.end()); - CHECK_THROW(data.at(10), etl::intrusive_flat_map_out_of_bounds); + CHECK_THROW(data.at(10), etl::reference_flat_map_out_of_bounds); } @@ -514,7 +514,7 @@ namespace DataNDC data(initial_data.begin(), initial_data.end()); DataNDC::value_type item10(10, N10); - CHECK_THROW(data.insert(item10), etl::intrusive_flat_map_full); + CHECK_THROW(data.insert(item10), etl::reference_flat_map_full); } //************************************************************************* @@ -538,7 +538,7 @@ namespace { DataNDC data; - CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::intrusive_flat_map_full); + CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::reference_flat_map_full); } //************************************************************************* diff --git a/test/test_intrusive_flat_multimap.cpp b/test/test_reference_flat_multimap.cpp similarity index 98% rename from test/test_intrusive_flat_multimap.cpp rename to test/test_reference_flat_multimap.cpp index 6e52bfd9..b12e0c51 100644 --- a/test/test_intrusive_flat_multimap.cpp +++ b/test/test_reference_flat_multimap.cpp @@ -38,7 +38,7 @@ SOFTWARE. #include "data.h" -#include "intrusive_flat_multimap.h" +#include "reference_flat_multimap.h" namespace { @@ -50,10 +50,10 @@ namespace typedef std::pair ElementDC; typedef std::pair ElementNDC; - typedef etl::intrusive_flat_multimap DataDC; - typedef etl::intrusive_flat_multimap DataNDC; - typedef etl::iintrusive_flat_multimap IDataDC; - typedef etl::iintrusive_flat_multimap IDataNDC; + typedef etl::reference_flat_multimap DataDC; + typedef etl::reference_flat_multimap DataNDC; + typedef etl::ireference_flat_multimap IDataDC; + typedef etl::ireference_flat_multimap IDataNDC; typedef std::multimap Compare_DataDC; typedef std::multimap Compare_DataNDC; @@ -134,7 +134,7 @@ namespace return os; } - SUITE(test_intrusive_flat_multimap) + SUITE(test_reference_flat_multimap) { //************************************************************************* struct SetupFixture @@ -336,7 +336,7 @@ namespace DataNDC data(initial_data.begin(), initial_data.end()); DataNDC::value_type item10(10, N10); - CHECK_THROW(data.insert(item10), etl::intrusive_flat_multimap_full); + CHECK_THROW(data.insert(item10), etl::reference_flat_multimap_full); CHECK(std::is_sorted(data.begin(), data.end())); } @@ -364,7 +364,7 @@ namespace { DataNDC data; - CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::intrusive_flat_multimap_full); + CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::reference_flat_multimap_full); CHECK(std::is_sorted(data.begin(), data.end())); } diff --git a/test/test_intrusive_flat_multiset.cpp b/test/test_reference_flat_multiset.cpp similarity index 98% rename from test/test_intrusive_flat_multiset.cpp rename to test/test_reference_flat_multiset.cpp index e0e7da64..4873c0d6 100644 --- a/test/test_intrusive_flat_multiset.cpp +++ b/test/test_reference_flat_multiset.cpp @@ -38,7 +38,7 @@ SOFTWARE. #include "data.h" -#include "intrusive_flat_multiset.h" +#include "reference_flat_multiset.h" namespace { @@ -47,9 +47,9 @@ namespace typedef TestDataDC DC; typedef TestDataNDC NDC; - typedef etl::intrusive_flat_multiset DataDC; - typedef etl::intrusive_flat_multiset DataNDC; - typedef etl::iintrusive_flat_multiset IDataNDC; + typedef etl::reference_flat_multiset DataDC; + typedef etl::reference_flat_multiset DataNDC; + typedef etl::ireference_flat_multiset IDataNDC; typedef std::multiset Compare_DataDC; typedef std::multiset Compare_DataNDC; @@ -305,7 +305,7 @@ namespace { DataNDC data(initial_data.begin(), initial_data.end()); - CHECK_THROW(data.insert(N10), etl::intrusive_flat_multiset_full); + CHECK_THROW(data.insert(N10), etl::reference_flat_multiset_full); CHECK(std::is_sorted(data.begin(), data.end())); } @@ -333,7 +333,7 @@ namespace { DataNDC data; - CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::intrusive_flat_multiset_full); + CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::reference_flat_multiset_full); CHECK(std::is_sorted(data.begin(), data.end())); } diff --git a/test/test_intrusive_flat_set.cpp b/test/test_reference_flat_set.cpp similarity index 98% rename from test/test_intrusive_flat_set.cpp rename to test/test_reference_flat_set.cpp index 967b331d..b1fc13c6 100644 --- a/test/test_intrusive_flat_set.cpp +++ b/test/test_reference_flat_set.cpp @@ -38,7 +38,7 @@ SOFTWARE. #include "data.h" -#include "intrusive_flat_set.h" +#include "reference_flat_set.h" namespace { @@ -47,9 +47,9 @@ namespace typedef TestDataDC DC; typedef TestDataNDC NDC; - typedef etl::intrusive_flat_set DataDC; - typedef etl::intrusive_flat_set DataNDC; - typedef etl::iintrusive_flat_set IDataNDC; + typedef etl::reference_flat_set DataDC; + typedef etl::reference_flat_set DataNDC; + typedef etl::ireference_flat_set IDataNDC; typedef std::set Compare_DataDC; typedef std::set Compare_DataNDC; @@ -297,7 +297,7 @@ namespace { DataNDC data(initial_data.begin(), initial_data.end()); - CHECK_THROW(data.insert(N10), etl::intrusive_flat_set_full); + CHECK_THROW(data.insert(N10), etl::reference_flat_set_full); CHECK(std::is_sorted(data.begin(), data.end())); } @@ -325,7 +325,7 @@ namespace { DataNDC data; - CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::intrusive_flat_set_full); + CHECK_THROW(data.insert(excess_data.begin(), excess_data.end()), etl::reference_flat_set_full); CHECK(std::is_sorted(data.begin(), data.end())); } From b46616d3be70c5b03ac2bb10b610d58ff56328bb Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 9 May 2017 20:53:53 +0100 Subject: [PATCH 2/2] Updated VS2017 & Code::Blocks projects. --- test/codeblocks/ETL.cbp | 12 +- test/codeblocks/ETL.depend | 100 ++++++++++++- test/codeblocks/ETL.layout | 240 +++++++++++++++----------------- test/vs2017/etl.vcxproj | 18 ++- test/vs2017/etl.vcxproj.filters | 32 ++--- 5 files changed, 236 insertions(+), 166 deletions(-) diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index 61bbedcc..5b2f4af8 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -219,6 +219,10 @@ + + + + @@ -271,10 +275,6 @@ - - - - @@ -299,6 +299,10 @@ + + + + diff --git a/test/codeblocks/ETL.depend b/test/codeblocks/ETL.depend index e5fb5a82..f3bcb39a 100644 --- a/test/codeblocks/ETL.depend +++ b/test/codeblocks/ETL.depend @@ -3289,7 +3289,7 @@ "CurrentTest.h" "ReportAssertImpl.h" -1494277861 source:d:\users\john\documents\programming\github\etl\test\test_algorithm.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_algorithm.cpp "UnitTest++.h" "algorithm.h" "container.h" @@ -3726,7 +3726,7 @@ 1482623723 v_1.h" -1494279862 source:d:\users\john\documents\programming\github\etl\test\test_forward_list.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_forward_list.cpp "UnitTest++.h" "ExtraCheckMacros.h" "data.h" @@ -3843,7 +3843,7 @@ 1450265856 d:\users\john\documents\programming\github\etl\largest.h "type_traits.h" -1494279862 source:d:\users\john\documents\programming\github\etl\test\test_list.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_list.cpp "UnitTest++.h" "ExtraCheckMacros.h" "list.h" @@ -5230,7 +5230,7 @@ 1452516033 /home/jwellbelove/Programming/etl/visitor.h -1494279862 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_forward_list.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_forward_list.cpp "UnitTest++.h" "ExtraCheckMacros.h" "data.h" @@ -6087,7 +6087,7 @@ 1482358550 trusive_links.h" -1494278815 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_list.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_list.cpp "UnitTest++.h" "ExtraCheckMacros.h" "data.h" @@ -7970,7 +7970,7 @@ "UnitTest++.h" "iterator.h" -1494278993 source:d:\users\john\documents\programming\github\etl\test\test_memory.cpp +1494283539 source:d:\users\john\documents\programming\github\etl\test\test_memory.cpp "UnitTest++.h" "memory.h" "debug_count.h" @@ -8173,3 +8173,91 @@ "HelperMacros.h" +1494362778 source:d:\users\john\documents\programming\github\etl\test\test_reference_flat_map.cpp + "UnitTest++.h" + + + + + + + + + "data.h" + "reference_flat_map.h" + +1494362778 d:\users\john\documents\programming\github\etl\src\reference_flat_map.h + + "exception.h" + "vector.h" + "error_handler.h" + +1494362778 source:d:\users\john\documents\programming\github\etl\test\test_reference_flat_multimap.cpp + "UnitTest++.h" + + + + + + + + "data.h" + "reference_flat_multimap.h" + +1494362778 d:\users\john\documents\programming\github\etl\src\reference_flat_multimap.h + + "exception.h" + "error_handler.h" + "debug_count.h" + "vector.h" + +1494362778 source:d:\users\john\documents\programming\github\etl\test\test_reference_flat_multiset.cpp + "UnitTest++.h" + + + + + + + + "data.h" + "reference_flat_multiset.h" + +1494362778 d:\users\john\documents\programming\github\etl\src\reference_flat_multiset.h + + + + + + "platform.h" + "type_traits.h" + "vector.h" + "pool.h" + "error_handler.h" + "exception.h" + +1494362778 source:d:\users\john\documents\programming\github\etl\test\test_reference_flat_set.cpp + "UnitTest++.h" + + + + + + + + "data.h" + "reference_flat_set.h" + +1494362778 d:\users\john\documents\programming\github\etl\src\reference_flat_set.h + + + + + + "platform.h" + "type_traits.h" + "pool.h" + "error_handler.h" + "exception.h" + "vector.h" + diff --git a/test/codeblocks/ETL.layout b/test/codeblocks/ETL.layout index 8ecd9372..c0d3ac7a 100644 --- a/test/codeblocks/ETL.layout +++ b/test/codeblocks/ETL.layout @@ -2,134 +2,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + - - - - - - + - + @@ -137,24 +27,29 @@ - + - + - + - + - + - + - + - + + + + + + @@ -162,9 +57,49 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -172,24 +107,69 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 334efe0c..19d99833 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -197,10 +197,6 @@ - - - - @@ -238,6 +234,10 @@ + + + + @@ -336,12 +336,6 @@ - - false - - - - false @@ -388,6 +382,10 @@ true + + + + true diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 4cc3568c..e37d92fc 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -423,24 +423,24 @@ ETL\Utilities - - ETL\Containers - - - ETL\Containers - - - ETL\Containers - - - ETL\Containers - ETL\Patterns ETL\Patterns + + ETL\Containers + + + ETL\Containers + + + ETL\Containers + + + ETL\Containers + @@ -752,16 +752,16 @@ Source Files - + Source Files - + Source Files - + Source Files - + Source Files