mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-28 13:28:43 +08:00
Merge remote-tracking branch 'origin/development'
# Conflicts: # include/etl/private/minmax_pop.h
This commit is contained in:
parent
08a52159f4
commit
37d2d9e084
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ALGORITHM__
|
||||
#define __ETL_ALGORITHM__
|
||||
#ifndef ETL_ALGORITHM_INCLUDED
|
||||
#define ETL_ALGORITHM_INCLUDED
|
||||
|
||||
///\defgroup algorithm algorithm
|
||||
/// Reverse engineered algorithms from C++ 0x11
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ALIGNEMENT__
|
||||
#define __ETL_ALIGNEMENT__
|
||||
#ifndef ETL_ALIGNEMENT_INCLUDED
|
||||
#define ETL_ALIGNEMENT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -43,7 +43,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace __private_alignment__
|
||||
namespace private_alignment
|
||||
{
|
||||
//***************************************************************************
|
||||
// Matcher.
|
||||
@ -99,7 +99,7 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename __private_alignment__::type_with_alignment_helper<ALIGNMENT, int_least8_t, int_least16_t, int32_t, int64_t, float, double, void*>::type type;
|
||||
typedef typename private_alignment::type_with_alignment_helper<ALIGNMENT, int_least8_t, int_least16_t, int32_t, int64_t, float, double, void*>::type type;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -183,7 +183,7 @@ namespace etl
|
||||
union
|
||||
{
|
||||
char data[LENGTH];
|
||||
typename etl::type_with_alignment<ALIGNMENT>::type __etl_alignment_type__; // A POD type that has the same alignment as ALIGNMENT.
|
||||
typename etl::type_with_alignment<ALIGNMENT>::type etl_alignment_type; // A POD type that has the same alignment as ALIGNMENT.
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ARRAY__
|
||||
#define __ETL_ARRAY__
|
||||
#ifndef ETL_ARRAY_INCLUDED
|
||||
#define ETL_ARRAY_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <functional>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ARRAY_VIEW__
|
||||
#define __ETL_ARRAY_VIEW__
|
||||
#ifndef ETL_ARRAY_VIEW_INCLUDED
|
||||
#define ETL_ARRAY_VIEW_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "memory.h"
|
||||
@ -832,7 +832,7 @@ namespace etl
|
||||
{
|
||||
size_t operator()(const etl::array_view<T>& view) const
|
||||
{
|
||||
return etl::__private_hash__::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&view[0]),
|
||||
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&view[0]),
|
||||
reinterpret_cast<const uint8_t*>(&view[view.size()]));
|
||||
}
|
||||
};
|
||||
@ -842,7 +842,7 @@ namespace etl
|
||||
{
|
||||
size_t operator()(const etl::const_array_view<T>& view) const
|
||||
{
|
||||
return etl::__private_hash__::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&view[0]),
|
||||
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&view[0]),
|
||||
reinterpret_cast<const uint8_t*>(&view[view.size()]));
|
||||
}
|
||||
};
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ARRAY_WRAPPER__
|
||||
#define __ETL_ARRAY_WRAPPER__
|
||||
#ifndef ETL_ARRAY_WRAPPER_INCLUDED
|
||||
#define ETL_ARRAY_WRAPPER_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "iterator.h"
|
||||
@ -396,7 +396,7 @@ namespace etl
|
||||
{
|
||||
size_t operator()(const etl::array_wrapper<T, SIZE, ARRAY>& aw) const
|
||||
{
|
||||
return etl::__private_hash__::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&aw[0]),
|
||||
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&aw[0]),
|
||||
reinterpret_cast<const uint8_t*>(&aw[aw.size()]));
|
||||
}
|
||||
};
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ATOMIC__
|
||||
#define __ETL_ATOMIC__
|
||||
#ifndef ETL_ATOMIC_INCLUDED
|
||||
#define ETL_ATOMIC_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ATOMIC_ARM__
|
||||
#define __ETL_ATOMIC_ARM__
|
||||
#ifndef ETL_ATOMIC_ARM_INCLUDED
|
||||
#define ETL_ATOMIC_ARM_INCLUDED
|
||||
|
||||
#include "atomic_gcc_sync.h"
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ATOMIC_GCC_SYNC__
|
||||
#define __ETL_ATOMIC_GCC_SYNC__
|
||||
#ifndef ETL_ATOMIC_GCC_SYNC_INCLUDED
|
||||
#define ETL_ATOMIC_GCC_SYNC_INCLUDED
|
||||
|
||||
#include "../platform.h"
|
||||
#include "../type_traits.h"
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ATOMIC_STD__
|
||||
#define __ETL_ATOMIC_STD__
|
||||
#ifndef ETL_ATOMIC_STD_INCLUDED
|
||||
#define ETL_ATOMIC_STD_INCLUDED
|
||||
|
||||
#include "../platform.h"
|
||||
#include "../nullptr.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_BASIC_STRING__
|
||||
#define __ETL_BASIC_STRING__
|
||||
#ifndef ETL_BASIC_STRING_INCLUDED
|
||||
#define ETL_BASIC_STRING_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
@ -55,13 +55,7 @@ SOFTWARE.
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup basic_string basic_string
|
||||
@ -2234,13 +2228,7 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,15 +28,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_BINARY__
|
||||
#define __ETL_BINARY__
|
||||
#ifndef ETL_BINARY_INCLUDED
|
||||
#define ETL_BINARY_INCLUDED
|
||||
|
||||
///\defgroup binary binary
|
||||
/// Binary utilities
|
||||
///\ingroup utilities
|
||||
|
||||
#include <limits>
|
||||
#include <assert.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "type_traits.h"
|
||||
@ -45,10 +44,42 @@ SOFTWARE.
|
||||
#include "log.h"
|
||||
#include "power.h"
|
||||
#include "smallest.h"
|
||||
#include "platform.h"
|
||||
#include "exception.h"
|
||||
#include "error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "50"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
/// Exception for binary functions.
|
||||
///\ingroup binary
|
||||
//***************************************************************************
|
||||
class binary_exception : public etl::exception
|
||||
{
|
||||
public:
|
||||
|
||||
binary_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
|
||||
: exception(reason_, file_name_, line_number_)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
/// Full exception 'for out of range' errors.
|
||||
///\ingroup binary
|
||||
//***************************************************************************
|
||||
class binary_out_of_range : public etl::binary_exception
|
||||
{
|
||||
public:
|
||||
|
||||
binary_out_of_range(string_type file_name_, numeric_type line_number_)
|
||||
: etl::binary_exception(ETL_ERROR_TEXT("binary:out of range", ETL_FILE"A"), file_name_, line_number_)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
/// Maximum value that can be contained in N bits.
|
||||
//***************************************************************************
|
||||
@ -270,16 +301,12 @@ namespace etl
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
|
||||
const TReturn negative = (TReturn(1) << (NBITS - 1));
|
||||
TReturn signed_value = value & ((1 << NBITS) - 1);
|
||||
|
||||
if ((signed_value & negative) != 0)
|
||||
struct S
|
||||
{
|
||||
const TReturn sign_bits = ~((TReturn(1) << NBITS) - 1);
|
||||
signed_value |= sign_bits;
|
||||
}
|
||||
signed value : NBITS;
|
||||
} s;
|
||||
|
||||
return signed_value;
|
||||
return (s.value = value);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -290,22 +317,18 @@ namespace etl
|
||||
template <typename TReturn, const size_t NBITS, const size_t SHIFT, typename TValue>
|
||||
TReturn sign_extend(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
STATIC_ASSERT(NBITS <= std::numeric_limits<TReturn>::digits, "NBITS too large for return type");
|
||||
STATIC_ASSERT(SHIFT <= std::numeric_limits<TReturn>::digits, "SHIFT too large");
|
||||
|
||||
const TReturn negative = (TReturn(1) << (NBITS - 1));
|
||||
TReturn signed_value = (value >> SHIFT) & ((1 << NBITS) - 1);
|
||||
|
||||
if ((signed_value & negative) != 0)
|
||||
struct S
|
||||
{
|
||||
const TReturn sign_bits = ~((TReturn(1) << NBITS) - 1);
|
||||
signed_value |= sign_bits;
|
||||
}
|
||||
signed value : NBITS;
|
||||
} s;
|
||||
|
||||
return signed_value;
|
||||
return (s.value = (value >> SHIFT));
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -318,18 +341,13 @@ namespace etl
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
assert(NBITS <= std::numeric_limits<TReturn>::digits);
|
||||
|
||||
const TReturn negative = (TReturn(1) << (NBITS - 1));
|
||||
TReturn signed_value = value & ((1 << NBITS) - 1);
|
||||
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
|
||||
|
||||
if ((signed_value & negative) != 0)
|
||||
{
|
||||
const TReturn sign_bits = ~((TReturn(1) << NBITS) - 1);
|
||||
signed_value |= sign_bits;
|
||||
}
|
||||
TReturn mask = TReturn(1U) << (NBITS - 1);
|
||||
value = value & ((1U << NBITS) - 1);
|
||||
|
||||
return signed_value;
|
||||
return TReturn((value ^ mask) - mask);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -340,21 +358,16 @@ namespace etl
|
||||
template <typename TReturn, typename TValue>
|
||||
TReturn sign_extend(TValue value, const size_t NBITS, const size_t SHIFT)
|
||||
{
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
|
||||
STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
assert(NBITS <= std::numeric_limits<TReturn>::digits);
|
||||
STATIC_ASSERT(etl::is_signed<TReturn>::value, "TReturn not a signed type");
|
||||
|
||||
const TReturn negative = (TReturn(1) << (NBITS - 1));
|
||||
TReturn signed_value = (value >> SHIFT) & ((1 << NBITS) - 1);
|
||||
ETL_ASSERT((NBITS <= std::numeric_limits<TReturn>::digits), ETL_ERROR(binary_out_of_range));
|
||||
|
||||
if ((signed_value & negative) != 0)
|
||||
{
|
||||
const TReturn sign_bits = ~((TReturn(1) << NBITS) - 1);
|
||||
signed_value |= sign_bits;
|
||||
}
|
||||
TReturn mask = TReturn(1U) << (NBITS - 1);
|
||||
value = (value >> SHIFT) & ((1U << NBITS) - 1);
|
||||
|
||||
return signed_value;
|
||||
return TReturn((value ^ mask) - mask);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -422,6 +435,140 @@ namespace etl
|
||||
template <const size_t POSITION>
|
||||
const typename bit<POSITION>::value_type bit<POSITION>::value;
|
||||
|
||||
//***************************************************************************
|
||||
/// Fills a value with a bit pattern. Compile time.
|
||||
//***************************************************************************
|
||||
template <typename TResult, typename TValue = void*, const TValue VALUE = (void*)0>
|
||||
class binary_fill
|
||||
{
|
||||
private:
|
||||
|
||||
STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
STATIC_ASSERT(VALUE <= etl::integral_limits<typename etl::make_unsigned<TValue>::type>::max, "Value is too large for specified type");
|
||||
|
||||
typedef typename etl::make_unsigned<TResult>::type unsigned_r_t;
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
|
||||
|
||||
public:
|
||||
|
||||
static const TResult value = TResult(unsigned_v_t(VALUE) * (unsigned_r_t(~unsigned_r_t(0U)) / unsigned_v_t(~unsigned_v_t(0U))));
|
||||
};
|
||||
|
||||
template <typename TResult, typename TValue, const TValue VALUE>
|
||||
const TResult binary_fill<TResult, TValue, VALUE>::value;
|
||||
|
||||
//***************************************************************************
|
||||
/// Fills a value with a bit pattern. Run time.
|
||||
//***************************************************************************
|
||||
template <typename TResult>
|
||||
class binary_fill<TResult, void*, (void*)0>
|
||||
{
|
||||
private:
|
||||
|
||||
typedef typename etl::make_unsigned<TResult>::type unsigned_r_t;
|
||||
|
||||
public:
|
||||
|
||||
template <typename TValue>
|
||||
static TResult value(TValue value)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
|
||||
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
|
||||
|
||||
return TResult(unsigned_v_t(value) * (unsigned_r_t(~unsigned_r_t(0U)) / unsigned_v_t(~unsigned_v_t(0U))));
|
||||
}
|
||||
};
|
||||
|
||||
#if ETL_8BIT_SUPPORT
|
||||
//***************************************************************************
|
||||
/// Detects the presence of zero bytes. Compile time.
|
||||
//***************************************************************************
|
||||
template <typename TValue = void*, const TValue VALUE = (void*)0>
|
||||
class has_zero_byte
|
||||
{
|
||||
private:
|
||||
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_t;
|
||||
|
||||
static const unsigned_t mask = etl::binary_fill<TValue, uint8_t, 0x7FU>::value;
|
||||
|
||||
public:
|
||||
|
||||
static const bool test = unsigned_t(~((((unsigned_t(VALUE) & mask) + mask) | unsigned_t(VALUE)) | mask)) != 0U;
|
||||
};
|
||||
|
||||
template <typename TValue, const TValue VALUE>
|
||||
const typename etl::make_unsigned<TValue>::type has_zero_byte<TValue, VALUE>::mask;
|
||||
|
||||
template <typename TValue, const TValue VALUE>
|
||||
const bool has_zero_byte<TValue, VALUE>::test;
|
||||
|
||||
//***************************************************************************
|
||||
/// Detects the presence of zero bytes. Run time.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class has_zero_byte<void*, (void*)0>
|
||||
{
|
||||
public:
|
||||
|
||||
template <typename TValue>
|
||||
static bool test(TValue value)
|
||||
{
|
||||
typedef typename etl::make_unsigned<TValue>::type unsigned_t;
|
||||
static const unsigned_t mask = etl::binary_fill<TValue, uint8_t, 0x7FU>::value;
|
||||
|
||||
const unsigned_t temp = unsigned_t(~((((unsigned_t(value) & mask) + mask) | unsigned_t(value)) | mask));
|
||||
|
||||
return (temp != 0U);
|
||||
}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
/// Detects the presence of a byte of value N. Compile time.
|
||||
//***************************************************************************
|
||||
template <const uint8_t N = 0, typename TValue = void*, const TValue VALUE = (void*)0>
|
||||
class has_byte_n
|
||||
{
|
||||
public:
|
||||
|
||||
static const bool test = etl::has_zero_byte<TValue, TValue(VALUE ^ etl::binary_fill<TValue, uint8_t, N>::value)>::test;
|
||||
};
|
||||
|
||||
template <const uint8_t N, typename TValue, const TValue VALUE>
|
||||
const bool has_byte_n<N, TValue, VALUE>::test;
|
||||
|
||||
//***************************************************************************
|
||||
/// Detects the presence of a byte of value N. Partial run time.
|
||||
//***************************************************************************
|
||||
template <const uint8_t N>
|
||||
class has_byte_n<N, void*, (void*)0>
|
||||
{
|
||||
public:
|
||||
|
||||
template <typename TValue>
|
||||
static bool test(TValue value)
|
||||
{
|
||||
return etl::has_zero_byte<>::test(TValue(value ^ etl::binary_fill<TValue, uint8_t, N>::value));
|
||||
}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
/// Detects the presence of a byte of value N. Run time.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class has_byte_n<0, void*, (void*)0>
|
||||
{
|
||||
public:
|
||||
|
||||
template <typename TValue>
|
||||
static bool test(TValue value, uint8_t n)
|
||||
{
|
||||
return etl::has_zero_byte<>::test(TValue(value ^ etl::binary_fill<TValue>::template value<uint8_t>(n)));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// 8 bit binary constants.
|
||||
//***************************************************************************
|
||||
@ -722,4 +869,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_BITSET__
|
||||
#define __ETL_BITSET__
|
||||
#ifndef ETL_BITSET_INCLUDED
|
||||
#define ETL_BITSET_INCLUDED
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
@ -46,9 +46,7 @@ SOFTWARE.
|
||||
#include "integral_limits.h"
|
||||
#include "binary.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include "error_handler.h"
|
||||
|
||||
@ -1018,8 +1016,6 @@ void swap(etl::bitset<MAXN>& lhs, etl::bitset<MAXN>& rhs)
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_BLOOM_FILTER__
|
||||
#define __ETL_BLOOM_FILTER__
|
||||
#ifndef ETL_BLOOM_FILTER_INCLUDED
|
||||
#define ETL_BLOOM_FILTER_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "parameter_type.h"
|
||||
@ -45,7 +45,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace __private_bloom_filter__
|
||||
namespace private_bloom_filter
|
||||
{
|
||||
// Placeholder null hash for defaulted template parameters.
|
||||
struct null_hash
|
||||
@ -71,14 +71,14 @@ namespace etl
|
||||
//***************************************************************************
|
||||
template <const size_t DESIRED_WIDTH,
|
||||
typename THash1,
|
||||
typename THash2 = __private_bloom_filter__::null_hash,
|
||||
typename THash3 = __private_bloom_filter__::null_hash>
|
||||
typename THash2 = private_bloom_filter::null_hash,
|
||||
typename THash3 = private_bloom_filter::null_hash>
|
||||
class bloom_filter
|
||||
{
|
||||
private:
|
||||
|
||||
typedef typename etl::parameter_type<typename THash1::argument_type>::type parameter_t;
|
||||
typedef __private_bloom_filter__::null_hash null_hash;
|
||||
typedef private_bloom_filter::null_hash null_hash;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_C_TIMER_FRAMEWORK__
|
||||
#define __ETL_C_TIMER_FRAMEWORK__
|
||||
#ifndef ETL_C_TIMER_FRAMEWORK_INCLUDED
|
||||
#define ETL_C_TIMER_FRAMEWORK_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CALLBACK_TIMER__
|
||||
#define __ETL_CALLBACK_TIMER__
|
||||
#ifndef ETL_CALLBACK_TIMER_INCLUDED
|
||||
#define ETL_CALLBACK_TIMER_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
@ -153,7 +153,7 @@ namespace etl
|
||||
callback_timer_data& operator =(const callback_timer_data& other);
|
||||
};
|
||||
|
||||
namespace __private_callback_timer__
|
||||
namespace private_callback_timer
|
||||
{
|
||||
//*************************************************************************
|
||||
/// A specialised intrusive linked list for timer data.
|
||||
@ -647,7 +647,7 @@ namespace etl
|
||||
callback_timer_data* const timer_array;
|
||||
|
||||
// The list of active timers.
|
||||
__private_callback_timer__::list active_list;
|
||||
private_callback_timer::list active_list;
|
||||
|
||||
volatile bool enabled;
|
||||
#if defined(ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK)
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CHAR_TRAITS__
|
||||
#define __ETL_CHAR_TRAITS__
|
||||
#ifndef ETL_CHAR_TRAITS_INCLUDED
|
||||
#define ETL_CHAR_TRAITS_INCLUDED
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CHECKSUM__
|
||||
#define __ETL_CHECKSUM__
|
||||
#ifndef ETL_CHECKSUM_INCLUDED
|
||||
#define ETL_CHECKSUM_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_COMBINATIONS__
|
||||
#define __ETL_COMBINATIONS__
|
||||
#ifndef ETL_COMBINATIONS_INCLUDED
|
||||
#define ETL_COMBINATIONS_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "permutations.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_COMPARE__
|
||||
#define __ETL_COMPARE__
|
||||
#ifndef ETL_COMPARE_INCLUDED
|
||||
#define ETL_COMPARE_INCLUDED
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CONSTANT__
|
||||
#define __ETL_CONSTANT__
|
||||
#ifndef ETL_CONSTANT_INCLUDED
|
||||
#define ETL_CONSTANT_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CONTAINER__
|
||||
#define __ETL_CONTAINER__
|
||||
#ifndef ETL_CONTAINER_INCLUDED
|
||||
#define ETL_CONTAINER_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC16__
|
||||
#define __ETL_CRC16__
|
||||
#ifndef ETL_CRC16_INCLUDED
|
||||
#define ETL_CRC16_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC16_CCITT__
|
||||
#define __ETL_CRC16_CCITT__
|
||||
#ifndef ETL_CRC16_CCITT_INCLUDED
|
||||
#define ETL_CRC16_CCITT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC16_KERMIT__
|
||||
#define __ETL_CRC16_KERMIT__
|
||||
#ifndef ETL_CRC16_KERMIT_INCLUDED
|
||||
#define ETL_CRC16_KERMIT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC32__
|
||||
#define __ETL_CRC32__
|
||||
#ifndef ETL_CRC32_INCLUDED
|
||||
#define ETL_CRC32_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC64_ECMA__
|
||||
#define __ETL_CRC64_ECMA__
|
||||
#ifndef ETL_CRC64_ECMA_INCLUDED
|
||||
#define ETL_CRC64_ECMA_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CRC8_CCITT__
|
||||
#define __ETL_CRC8_CCITT__
|
||||
#ifndef ETL_CRC8_CCITT_INCLUDED
|
||||
#define ETL_CRC8_CCITT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_STRING__
|
||||
#define __ETL_STRING__
|
||||
#ifndef ETL_STRING_INCLUDED
|
||||
#define ETL_STRING_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "basic_string.h"
|
||||
@ -39,9 +39,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -210,7 +208,7 @@ namespace etl
|
||||
{
|
||||
size_t operator()(const etl::istring& text) const
|
||||
{
|
||||
return etl::__private_hash__::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
|
||||
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
|
||||
reinterpret_cast<const uint8_t*>(&text[text.size()]));
|
||||
}
|
||||
};
|
||||
@ -220,15 +218,13 @@ namespace etl
|
||||
{
|
||||
size_t operator()(const etl::string<SIZE>& text) const
|
||||
{
|
||||
return etl::__private_hash__::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
|
||||
return etl::private_hash::generic_hash<size_t>(reinterpret_cast<const uint8_t*>(&text[0]),
|
||||
reinterpret_cast<const uint8_t*>(&text[text.size()]));
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_CYCLIC_VALUE__
|
||||
#define __ETL_CYCLIC_VALUE__
|
||||
#ifndef ETL_CYCLIC_VALUE_INCLUDED
|
||||
#define ETL_CYCLIC_VALUE_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_DEBOUNCE__
|
||||
#define __ETL_DEBOUNCE__
|
||||
#ifndef ETL_DEBOUNCE_INCLUDED
|
||||
#define ETL_DEBOUNCE_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -38,7 +38,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace __private_debounce__
|
||||
namespace private_debounce
|
||||
{
|
||||
class debounce_base
|
||||
{
|
||||
@ -431,7 +431,7 @@ namespace etl
|
||||
/// Fixed Valid/Hold/Repeating values.
|
||||
//***************************************************************************
|
||||
template <const uint16_t VALID_COUNT = 0, const uint16_t HOLD_COUNT = 0, const uint16_t REPEAT_COUNT = 0>
|
||||
class debounce : public __private_debounce__::debounce4
|
||||
class debounce : public private_debounce::debounce4
|
||||
{
|
||||
public:
|
||||
|
||||
@ -460,7 +460,7 @@ namespace etl
|
||||
/// Fixed Valid/Hold values.
|
||||
//***************************************************************************
|
||||
template <const uint16_t VALID_COUNT, const uint16_t HOLD_COUNT>
|
||||
class debounce<VALID_COUNT, HOLD_COUNT, 0> : public __private_debounce__::debounce3
|
||||
class debounce<VALID_COUNT, HOLD_COUNT, 0> : public private_debounce::debounce3
|
||||
{
|
||||
public:
|
||||
|
||||
@ -492,7 +492,7 @@ namespace etl
|
||||
/// Fixed Valid value.
|
||||
//***************************************************************************
|
||||
template <const uint16_t VALID_COUNT>
|
||||
class debounce<VALID_COUNT, 0, 0> : public __private_debounce__::debounce2
|
||||
class debounce<VALID_COUNT, 0, 0> : public private_debounce::debounce2
|
||||
{
|
||||
public:
|
||||
|
||||
@ -523,7 +523,7 @@ namespace etl
|
||||
/// Variable Valid/Hold/Repeating values.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class debounce<0, 0, 0> : public __private_debounce__::debounce4
|
||||
class debounce<0, 0, 0> : public private_debounce::debounce4
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_DEBUG_COUNT__
|
||||
#define __ETL_DEBUG_COUNT__
|
||||
#ifndef ETL_DEBUG_COUNT_INCLUDED
|
||||
#define ETL_DEBUG_COUNT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
@ -39,6 +39,15 @@ SOFTWARE.
|
||||
///\defgroup debug_count debug count
|
||||
///\ingroup utilities
|
||||
|
||||
#if defined(ETL_DEBUG_COUNT)
|
||||
|
||||
#define ETL_DECLARE_DEBUG_COUNT etl::debug_count etl_debug_count
|
||||
#define ETL_INCREMENT_DEBUG_COUNT ++etl_debug_count
|
||||
#define ETL_DECREMENT_DEBUG_COUNT --etl_debug_count
|
||||
#define ETL_ADD_DEBUG_COUNT(n) etl_debug_count += (n)
|
||||
#define ETL_SUBTRACT_DEBUG_COUNT(n) etl_debug_count -= (n)
|
||||
#define ETL_RESET_DEBUG_COUNT etl_debug_count.clear()
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -51,8 +60,7 @@ namespace etl
|
||||
class debug_count
|
||||
{
|
||||
public:
|
||||
|
||||
#if defined(ETL_DEBUG)
|
||||
|
||||
inline debug_count()
|
||||
: count(0)
|
||||
{
|
||||
@ -113,46 +121,16 @@ namespace etl
|
||||
private:
|
||||
|
||||
int32_t count;
|
||||
#else
|
||||
inline debug_count()
|
||||
{
|
||||
}
|
||||
|
||||
inline ~debug_count()
|
||||
{
|
||||
}
|
||||
|
||||
inline debug_count& operator ++()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline debug_count& operator --()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline debug_count& operator +=(int32_t /*n*/)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline debug_count& operator -=(int32_t /*n*/)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline operator int32_t()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void clear()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#else
|
||||
#define ETL_DECLARE_DEBUG_COUNT
|
||||
#define ETL_INCREMENT_DEBUG_COUNT
|
||||
#define ETL_DECREMENT_DEBUG_COUNT
|
||||
#define ETL_ADD_DEBUG_COUNT(n)
|
||||
#define ETL_SUBTRACT_DEBUG_COUNT(n)
|
||||
#define ETL_RESET_DEBUG_COUNT
|
||||
#endif // ETL_DEBUG_COUNT
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_DEQUE__
|
||||
#define __ETL_DEQUE__
|
||||
#ifndef ETL_DEQUE_INCLUDED
|
||||
#define ETL_DEQUE_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
@ -52,9 +52,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "1"
|
||||
@ -211,10 +209,10 @@ namespace etl
|
||||
{
|
||||
}
|
||||
|
||||
size_type current_size; ///< The current number of elements in the deque.
|
||||
const size_type CAPACITY; ///< The maximum number of elements in the deque.
|
||||
const size_type BUFFER_SIZE; ///< The number of elements in the buffer.
|
||||
etl::debug_count construct_count; ///< Internal debugging.
|
||||
size_type current_size; ///< The current number of elements in the deque.
|
||||
const size_type CAPACITY; ///< The maximum number of elements in the deque.
|
||||
const size_type BUFFER_SIZE; ///< The number of elements in the buffer.
|
||||
ETL_DECLARE_DEBUG_COUNT; ///< Internal debugging.
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -935,7 +933,7 @@ namespace etl
|
||||
--_begin;
|
||||
p = etl::addressof(*_begin);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _begin;
|
||||
}
|
||||
else if (insert_position == end())
|
||||
@ -943,7 +941,7 @@ namespace etl
|
||||
p = etl::addressof(*_end);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _end - 1;
|
||||
}
|
||||
else
|
||||
@ -1000,7 +998,7 @@ namespace etl
|
||||
--_begin;
|
||||
p = etl::addressof(*_begin);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _begin;
|
||||
}
|
||||
else if (insert_position == end())
|
||||
@ -1008,7 +1006,7 @@ namespace etl
|
||||
p = etl::addressof(*_end);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _end - 1;
|
||||
}
|
||||
else
|
||||
@ -1065,7 +1063,7 @@ namespace etl
|
||||
--_begin;
|
||||
p = etl::addressof(*_begin);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _begin;
|
||||
}
|
||||
else if (insert_position == end())
|
||||
@ -1073,7 +1071,7 @@ namespace etl
|
||||
p = etl::addressof(*_end);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _end - 1;
|
||||
}
|
||||
else
|
||||
@ -1130,7 +1128,7 @@ namespace etl
|
||||
--_begin;
|
||||
p = etl::addressof(*_begin);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _begin;
|
||||
}
|
||||
else if (insert_position == end())
|
||||
@ -1138,7 +1136,7 @@ namespace etl
|
||||
p = etl::addressof(*_end);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
position = _end - 1;
|
||||
}
|
||||
else
|
||||
@ -1538,7 +1536,7 @@ namespace etl
|
||||
::new (&(*_end)) T(value1);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1555,7 +1553,7 @@ namespace etl
|
||||
::new (&(*_end)) T(value1, value2);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1572,7 +1570,7 @@ namespace etl
|
||||
::new (&(*_end)) T(value1, value2, value3);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1589,7 +1587,7 @@ namespace etl
|
||||
::new (&(*_end)) T(value1, value2, value3, value4);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1645,7 +1643,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T(value1);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1662,7 +1660,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T(value1, value2);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1679,7 +1677,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T(value1, value2, value3);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1696,7 +1694,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T(value1, value2, value3, value4);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -1811,7 +1809,7 @@ namespace etl
|
||||
if ETL_IF_CONSTEXPR(etl::is_trivially_destructible<T>::value)
|
||||
{
|
||||
current_size = 0;
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1850,7 +1848,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T();
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -1882,7 +1880,7 @@ namespace etl
|
||||
::new (&(*item++)) T(*from);
|
||||
++from;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
} while (n-- != 0);
|
||||
}
|
||||
|
||||
@ -1894,7 +1892,7 @@ namespace etl
|
||||
::new (&(*_end)) T();
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -1905,7 +1903,7 @@ namespace etl
|
||||
--_begin;
|
||||
::new (&(*_begin)) T(value);
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -1916,7 +1914,7 @@ namespace etl
|
||||
::new (&(*_end)) T(value);
|
||||
++_end;
|
||||
++current_size;
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -1926,7 +1924,7 @@ namespace etl
|
||||
{
|
||||
(*_begin).~T();
|
||||
--current_size;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
++_begin;
|
||||
}
|
||||
|
||||
@ -1938,7 +1936,7 @@ namespace etl
|
||||
--_end;
|
||||
(*_end).~T();
|
||||
--current_size;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -2194,8 +2192,6 @@ bool operator >=(const etl::ideque<T>& lhs, const etl::ideque<T>& rhs)
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ENDIAN__
|
||||
#define __ETL_ENDIAN__
|
||||
#ifndef ETL_ENDIAN_INCLUDED
|
||||
#define ETL_ENDIAN_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ENUM_TYPE__
|
||||
#define __ETL_ENUM_TYPE__
|
||||
#ifndef ETL_ENUM_TYPE_INCLUDED
|
||||
#define ETL_ENUM_TYPE_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -29,8 +29,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ERROR_HANDLER__
|
||||
#define __ETL_ERROR_HANDLER__
|
||||
#ifndef ETL_ERROR_HANDLER_INCLUDED
|
||||
#define ETL_ERROR_HANDLER_INCLUDED
|
||||
|
||||
///\defgroup error_handler error_handler
|
||||
/// Error handler for when throwing exceptions is not required.
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_EXCEPTION__
|
||||
#define __ETL_EXCEPTION__
|
||||
#ifndef ETL_EXCEPTION_INCLUDED
|
||||
#define ETL_EXCEPTION_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FACTORIAL__
|
||||
#define __ETL_FACTORIAL__
|
||||
#ifndef ETL_FACTORIAL_INCLUDED
|
||||
#define ETL_FACTORIAL_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FIBONACCI__
|
||||
#define __ETL_FIBONACCI__
|
||||
#ifndef ETL_FIBONACCI_INCLUDED
|
||||
#define ETL_FIBONACCI_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
1
|
||||
1 deque
|
||||
2 flat_map
|
||||
3 flat_multimap
|
||||
4 flat_multiset
|
||||
@ -46,3 +46,5 @@
|
||||
46 queue_spsc_isr
|
||||
47 queue_spsc_atomic
|
||||
48 queue_mpmc_mutex
|
||||
49 type_select
|
||||
50 binary
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FIXED_ITERATOR__
|
||||
#define __ETL_FIXED_ITERATOR__
|
||||
#ifndef ETL_FIXED_ITERATOR_INCLUDED
|
||||
#define ETL_FIXED_ITERATOR_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FLAT_MAP__
|
||||
#define __ETL_FLAT_MAP__
|
||||
#ifndef ETL_FLAT_MAP_INCLUDED
|
||||
#define ETL_FLAT_MAP_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "reference_flat_map.h"
|
||||
@ -234,7 +234,7 @@ namespace etl
|
||||
{
|
||||
value_type* pvalue = storage.allocate<value_type>();
|
||||
::new (pvalue) value_type();
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
std::pair<iterator, bool> result = refmap_t::insert_at(i_element, *pvalue);
|
||||
i_element->second = result.first->second;
|
||||
@ -306,7 +306,7 @@ namespace etl
|
||||
|
||||
value_type* pvalue = storage.allocate<value_type>();
|
||||
::new (pvalue) value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (i_element->first != key)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -399,7 +399,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (i_element->first != key)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -431,7 +431,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (i_element->first != key)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -463,7 +463,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (i_element->first != key)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -495,7 +495,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (i_element->first != key)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -525,7 +525,7 @@ namespace etl
|
||||
i_element->~value_type();
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refmap_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -539,7 +539,7 @@ namespace etl
|
||||
i_element->~value_type();
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refmap_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -558,7 +558,7 @@ namespace etl
|
||||
itr->~value_type();
|
||||
storage.release(etl::addressof(*itr));
|
||||
++itr;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
refmap_t::erase(first, last);
|
||||
@ -585,7 +585,7 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
refmap_t::clear();
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ namespace etl
|
||||
storage_t& storage;
|
||||
|
||||
/// Internal debugging.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
|
||||
//*************************************************************************
|
||||
/// Destructor.
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FLAT_MULTMAP__
|
||||
#define __ETL_FLAT_MULTMAP__
|
||||
#ifndef ETL_FLAT_MULTMAP_INCLUDED
|
||||
#define ETL_FLAT_MULTMAP_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "reference_flat_multimap.h"
|
||||
@ -260,7 +260,7 @@ namespace etl
|
||||
|
||||
value_type* pvalue = storage.allocate<value_type>();
|
||||
::new (pvalue) value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refmap_t::insert_at(i_element, *pvalue);
|
||||
|
||||
return result;
|
||||
@ -313,7 +313,7 @@ namespace etl
|
||||
::new ((void*)etl::addressof(pvalue->first)) key_type(key);
|
||||
::new ((void*)etl::addressof(pvalue->second)) mapped_type(value);
|
||||
iterator i_element = lower_bound(key);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
@ -331,7 +331,7 @@ namespace etl
|
||||
::new ((void*)etl::addressof(pvalue->first)) key_type(key);
|
||||
::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1);
|
||||
iterator i_element = lower_bound(key);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
@ -349,7 +349,7 @@ namespace etl
|
||||
::new ((void*)etl::addressof(pvalue->first)) key_type(key);
|
||||
::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2);
|
||||
iterator i_element = lower_bound(key);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
@ -367,7 +367,7 @@ namespace etl
|
||||
::new ((void*)etl::addressof(pvalue->first)) key_type(key);
|
||||
::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3);
|
||||
iterator i_element = lower_bound(key);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
@ -385,7 +385,7 @@ namespace etl
|
||||
::new ((void*)etl::addressof(pvalue->first)) key_type(key);
|
||||
::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3, value4);
|
||||
iterator i_element = lower_bound(key);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return refmap_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
@ -420,7 +420,7 @@ namespace etl
|
||||
i_element->~value_type();
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refmap_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -439,7 +439,7 @@ namespace etl
|
||||
itr->~value_type();
|
||||
storage.release(etl::addressof(*itr));
|
||||
++itr;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
refmap_t::erase(first, last);
|
||||
@ -466,7 +466,7 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
refmap_t::clear();
|
||||
}
|
||||
|
||||
@ -646,7 +646,7 @@ namespace etl
|
||||
storage_t& storage;
|
||||
|
||||
/// Internal debugging.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
|
||||
//*************************************************************************
|
||||
/// Destructor.
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FLAT_MULTISET__
|
||||
#define __ETL_FLAT_MULTISET__
|
||||
#ifndef ETL_FLAT_MULTISET_INCLUDED
|
||||
#define ETL_FLAT_MULTISET_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "reference_flat_multiset.h"
|
||||
@ -236,7 +236,7 @@ namespace etl
|
||||
|
||||
value_type* pvalue = storage.allocate<value_type>();
|
||||
::new (pvalue) value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
|
||||
return result;
|
||||
@ -292,7 +292,7 @@ namespace etl
|
||||
|
||||
iterator i_element = lower_bound(*pvalue);
|
||||
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return std::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ namespace etl
|
||||
|
||||
iterator i_element = lower_bound(*pvalue);
|
||||
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return std::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
|
||||
}
|
||||
|
||||
@ -328,7 +328,7 @@ namespace etl
|
||||
|
||||
iterator i_element = lower_bound(*pvalue);
|
||||
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return std::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
|
||||
}
|
||||
|
||||
@ -346,7 +346,7 @@ namespace etl
|
||||
|
||||
iterator i_element = lower_bound(*pvalue);
|
||||
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return std::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*i_element));
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refset_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -399,7 +399,7 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*itr));
|
||||
storage.release(etl::addressof(*itr));
|
||||
++itr;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
refset_t::erase(first, last);
|
||||
@ -426,7 +426,7 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
refset_t::clear();
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ namespace etl
|
||||
storage_t& storage;
|
||||
|
||||
/// Internal debugging.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
|
||||
//*************************************************************************
|
||||
/// Destructor.
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FLAT_SET__
|
||||
#define __ETL_FLAT_SET__
|
||||
#ifndef ETL_FLAT_SET_INCLUDED
|
||||
#define ETL_FLAT_SET_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "reference_flat_set.h"
|
||||
@ -239,7 +239,7 @@ namespace etl
|
||||
|
||||
value_type* pvalue = storage.allocate<value_type>();
|
||||
::new (pvalue) value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
|
||||
@ -300,7 +300,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (*i_element != *pvalue)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -333,7 +333,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (*i_element != *pvalue)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -366,7 +366,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (*i_element != *pvalue)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -399,7 +399,7 @@ namespace etl
|
||||
// Doesn't already exist?
|
||||
if ((i_element == end() || (*i_element != *pvalue)))
|
||||
{
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
result = refset_t::insert_at(i_element, *pvalue);
|
||||
}
|
||||
else
|
||||
@ -431,7 +431,7 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*i_element));
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refset_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -445,7 +445,7 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*i_element));
|
||||
storage.release(etl::addressof(*i_element));
|
||||
refset_t::erase(i_element);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*********************************************************************
|
||||
@ -464,7 +464,7 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*itr));
|
||||
storage.release(etl::addressof(*itr));
|
||||
++itr;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
refset_t::erase(first, last);
|
||||
@ -488,11 +488,11 @@ namespace etl
|
||||
etl::destroy_at(etl::addressof(*itr));
|
||||
storage.release(etl::addressof(*itr));
|
||||
++itr;
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
refset_t::clear();
|
||||
}
|
||||
|
||||
@ -672,7 +672,7 @@ namespace etl
|
||||
storage_t& storage;
|
||||
|
||||
/// Internal debugging.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
|
||||
//*************************************************************************
|
||||
/// Destructor.
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FNV_1__
|
||||
#define __ETL_FNV_1__
|
||||
#ifndef ETL_FNV_1_INCLUDED
|
||||
#define ETL_FNV_1_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FORWARD_LIST__
|
||||
#define __ETL_FORWARD_LIST__
|
||||
#ifndef ETL_FORWARD_LIST_INCLUDED
|
||||
#define ETL_FORWARD_LIST_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "6"
|
||||
@ -275,10 +273,10 @@ namespace etl
|
||||
left->next = right;
|
||||
}
|
||||
|
||||
node_t start_node; ///< The node that acts as the forward_list start.
|
||||
etl::ipool* p_node_pool; ///< The pool of data nodes used in the list.
|
||||
const size_type MAX_SIZE; ///< The maximum size of the forward_list.
|
||||
etl::debug_count construct_count; ///< Internal debugging.
|
||||
node_t start_node; ///< The node that acts as the forward_list start.
|
||||
etl::ipool* p_node_pool; ///< The pool of data nodes used in the list.
|
||||
const size_type MAX_SIZE; ///< The maximum size of the forward_list.
|
||||
ETL_DECLARE_DEBUG_COUNT; ///< Internal debugging.
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -658,7 +656,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(start_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -673,7 +671,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(start_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -688,7 +686,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(start_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -703,7 +701,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3, value4);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(start_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -793,7 +791,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -809,7 +807,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -825,7 +823,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -841,7 +839,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3, value4);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node_after(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -1247,7 +1245,7 @@ namespace etl
|
||||
if ETL_IF_CONSTEXPR(etl::is_trivially_destructible<T>::value)
|
||||
{
|
||||
p_node_pool->release_all();
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1326,7 +1324,7 @@ namespace etl
|
||||
{
|
||||
data_node_t* p_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_node->value)) T(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return *p_node;
|
||||
}
|
||||
@ -1338,7 +1336,7 @@ namespace etl
|
||||
{
|
||||
node.value.~T();
|
||||
p_node_pool->release(&node);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
// Disable copy construction.
|
||||
@ -1536,9 +1534,7 @@ bool operator >=(const etl::iforward_list<T>& lhs, const etl::iforward_list<T>&
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -48,8 +48,8 @@ SOFTWARE.
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_FSM__
|
||||
#define __ETL_FSM__
|
||||
#ifndef ETL_FSM_INCLUDED
|
||||
#define ETL_FSM_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -66,9 +66,7 @@ SOFTWARE.
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "34"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -1215,8 +1213,6 @@ namespace etl
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -41,7 +41,7 @@ cog.outl("#endif")
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.outl("//***************************************************************************")
|
||||
cog.outl("// This file has been auto generated. Do not edit this file.")
|
||||
cog.outl("// THIS FILE HAS BEEN AUTO GENERATED. DO NOT EDIT THIS FILE.")
|
||||
cog.outl("//***************************************************************************")
|
||||
]]]*/
|
||||
/*[[[end]]]*/
|
||||
@ -60,8 +60,8 @@ cog.outl("//********************************************************************
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_FSM__
|
||||
#define __ETL_FSM__
|
||||
#ifndef ETL_FSM_INCLUDED
|
||||
#define ETL_FSM_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@ -78,9 +78,7 @@ cog.outl("//********************************************************************
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "34"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -538,8 +536,6 @@ namespace etl
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FUNCTION__
|
||||
#define __ETL_FUNCTION__
|
||||
#ifndef ETL_FUNCTION_INCLUDED
|
||||
#define ETL_FUNCTION_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_FUNCTIONAL__
|
||||
#define __ETL_FUNCTIONAL__
|
||||
#ifndef ETL_FUNCTIONAL_INCLUDED
|
||||
#define ETL_FUNCTIONAL_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -3,4 +3,5 @@ python -m cogapp -d -e -omessage_router.h -DHandlers=16 message_router_generator
|
||||
python -m cogapp -d -e -olargest.h -DNTypes=16 largest_generator.h
|
||||
python -m cogapp -d -e -osmallest.h -DNTypes=16 smallest_generator.h
|
||||
python -m cogapp -d -e -otype_traits.h -DIsOneOf=17 type_traits_generator.h
|
||||
python -m cogapp -d -e -otype_lookup.h -DNTypes=16 type_lookup_generator.h
|
||||
python -m cogapp -d -e -otype_lookup.h -DNTypes=16 type_lookup_generator.h
|
||||
python -m cogapp -d -e -otype_select.h -DNTypes=16 type_select_generator.h
|
||||
1
include/etl/generate_type_select.bat
Normal file
1
include/etl/generate_type_select.bat
Normal file
@ -0,0 +1 @@
|
||||
python -m cogapp -d -e -otype_select.h -DNTypes=16 type_select_generator.h
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_HASH__
|
||||
#define __ETL_HASH__
|
||||
#ifndef ETL_HASH_INCLUDED
|
||||
#define ETL_HASH_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@ -46,7 +46,7 @@ SOFTWARE.
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace __private_hash__
|
||||
namespace private_hash
|
||||
{
|
||||
//*************************************************************************
|
||||
/// Hash to use when size_t is 16 bits.
|
||||
@ -242,7 +242,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -264,7 +264,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -286,7 +286,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -308,7 +308,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -338,7 +338,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -368,7 +368,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -398,7 +398,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -428,7 +428,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
uint8_t* p = reinterpret_cast<uint8_t*>(&v);
|
||||
return __private_hash__::generic_hash<size_t>(p, p + sizeof(v));
|
||||
return private_hash::generic_hash<size_t>(p, p + sizeof(v));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_IHASH__
|
||||
#define __ETL_IHASH__
|
||||
#ifndef ETL_IHASH_INCLUDED
|
||||
#define ETL_IHASH_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INSTANCE_COUNT__
|
||||
#define __ETL_INSTANCE_COUNT__
|
||||
#ifndef ETL_INSTANCE_COUNT_INCLUDED
|
||||
#define ETL_INSTANCE_COUNT_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INTEGRAL_LIMITS__
|
||||
#define __ETL_INTEGRAL_LIMITS__
|
||||
#ifndef ETL_INTEGRAL_LIMITS_INCLUDED
|
||||
#define ETL_INTEGRAL_LIMITS_INCLUDED
|
||||
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
@ -37,10 +37,7 @@ SOFTWARE.
|
||||
#include "platform.h"
|
||||
#include "type_traits.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup integral_limits integral_limits
|
||||
@ -213,9 +210,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#endif
|
||||
|
||||
@ -28,14 +28,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INTRUSIVE_FORWARD_LIST__
|
||||
#define __ETL_INTRUSIVE_FORWARD_LIST__
|
||||
#ifndef ETL_INTRUSIVE_FORWARD_LIST_INCLUDED
|
||||
#define ETL_INTRUSIVE_FORWARD_LIST_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -1046,9 +1044,7 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INTRUSIVE_LINKS__
|
||||
#define __ETL_INTRUSIVE_LINKS__
|
||||
#ifndef ETL_INTRUSIVE_LINKS_INCLUDED
|
||||
#define ETL_INTRUSIVE_LINKS_INCLUDED
|
||||
|
||||
#include <assert.h>
|
||||
#include <utility>
|
||||
|
||||
@ -28,14 +28,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INTRUSIVE_LIST__
|
||||
#define __ETL_INTRUSIVE_LIST__
|
||||
#ifndef ETL_INTRUSIVE_LIST_INCLUDED
|
||||
#define ETL_INTRUSIVE_LIST_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -1078,9 +1076,7 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_INTRUSIVE_QUEUE__
|
||||
#define __ETL_INTRUSIVE_QUEUE__
|
||||
#ifndef ETL_INTRUSIVE_QUEUE_INCLUDED
|
||||
#define ETL_INTRUSIVE_QUEUE_INCLUDED
|
||||
|
||||
#include <stddef.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_STACK__
|
||||
#define __ETL_INTRUSIVE_STACK__
|
||||
#ifndef ETL_INTRUSIVE_STACK_INCLUDED
|
||||
#define ETL_INTRUSIVE_STACK_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_IO_PORT__
|
||||
#define __ETL_IO_PORT__
|
||||
#ifndef ETL_IO_PORT_INCLUDED
|
||||
#define ETL_IO_PORT_INCLUDED
|
||||
|
||||
///\defgroup io_port io port
|
||||
/// IO port access
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_ITERATOR__
|
||||
#define __ETL_ITERATOR__
|
||||
#ifndef ETL_ITERATOR_INCLUDED
|
||||
#define ETL_ITERATOR_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_JENKINS__
|
||||
#define __ETL_JENKINS__
|
||||
#ifndef ETL_JENKINS_INCLUDED
|
||||
#define ETL_JENKINS_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iterator>
|
||||
|
||||
@ -50,8 +50,8 @@ SOFTWARE.
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_LARGEST__
|
||||
#define __ETL_LARGEST__
|
||||
#ifndef ETL_LARGEST_INCLUDED
|
||||
#define ETL_LARGEST_INCLUDED
|
||||
|
||||
///\defgroup largest largest
|
||||
///\ingroup utilities
|
||||
|
||||
@ -43,7 +43,7 @@ cog.outl("#endif")
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.outl("//***************************************************************************")
|
||||
cog.outl("// This file has been auto generated. Do not edit this file.")
|
||||
cog.outl("// THIS FILE HAS BEEN AUTO GENERATED. DO NOT EDIT THIS FILE.")
|
||||
cog.outl("//***************************************************************************")
|
||||
]]]*/
|
||||
/*[[[end]]]*/
|
||||
@ -62,8 +62,8 @@ cog.outl("//********************************************************************
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_LARGEST__
|
||||
#define __ETL_LARGEST__
|
||||
#ifndef ETL_LARGEST_INCLUDED
|
||||
#define ETL_LARGEST_INCLUDED
|
||||
|
||||
///\defgroup largest largest
|
||||
///\ingroup utilities
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_LIST__
|
||||
#define __ETL_LIST__
|
||||
#ifndef ETL_LIST_INCLUDED
|
||||
#define ETL_LIST_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
@ -51,9 +51,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "7"
|
||||
@ -317,10 +315,10 @@ namespace etl
|
||||
{
|
||||
}
|
||||
|
||||
etl::ipool* p_node_pool; ///< The pool of data nodes used in the list.
|
||||
node_t terminal_node; ///< The node that acts as the list start and end.
|
||||
const size_type MAX_SIZE; ///< The maximum size of the list.
|
||||
etl::debug_count construct_count; ///< Internal debugging.
|
||||
etl::ipool* p_node_pool; ///< The pool of data nodes used in the list.
|
||||
node_t terminal_node; ///< The node that acts as the list start and end.
|
||||
const size_type MAX_SIZE; ///< The maximum size of the list.
|
||||
ETL_DECLARE_DEBUG_COUNT; ///< Internal debugging.
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -789,7 +787,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(get_head(), *p_data_node);
|
||||
}
|
||||
|
||||
@ -804,7 +802,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(get_head(), *p_data_node);
|
||||
}
|
||||
|
||||
@ -819,7 +817,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(get_head(), *p_data_node);
|
||||
}
|
||||
|
||||
@ -834,7 +832,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3, value4);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(get_head(), *p_data_node);
|
||||
}
|
||||
|
||||
@ -880,7 +878,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(terminal_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -895,7 +893,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(terminal_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -910,7 +908,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(terminal_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -925,7 +923,7 @@ namespace etl
|
||||
#endif
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3, value4);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(terminal_node, *p_data_node);
|
||||
}
|
||||
|
||||
@ -964,7 +962,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -980,7 +978,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -996,7 +994,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -1012,7 +1010,7 @@ namespace etl
|
||||
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value1, value2, value3, value4);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
insert_node(*position.p_node, *p_data_node);
|
||||
|
||||
return iterator(*p_data_node);
|
||||
@ -1456,7 +1454,7 @@ namespace etl
|
||||
if ETL_IF_CONSTEXPR(etl::is_trivially_destructible<T>::value)
|
||||
{
|
||||
p_node_pool->release_all();
|
||||
construct_count.clear();
|
||||
ETL_RESET_DEBUG_COUNT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1549,7 +1547,7 @@ namespace etl
|
||||
{
|
||||
data_node_t* p_data_node = p_node_pool->allocate<data_node_t>();
|
||||
::new (&(p_data_node->value)) T(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
|
||||
return *p_data_node;
|
||||
}
|
||||
@ -1561,7 +1559,7 @@ namespace etl
|
||||
{
|
||||
node.value.~T();
|
||||
p_node_pool->release(&node);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
// Disable copy construction.
|
||||
@ -1768,9 +1766,7 @@ bool operator >=(const etl::ilist<T>& lhs, const etl::ilist<T>& rhs)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_LOG__
|
||||
#define __ETL_LOG__
|
||||
#ifndef ETL_LOG_INCLUDED
|
||||
#define ETL_LOG_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MAP__
|
||||
#define __ETL_MAP__
|
||||
#ifndef ETL_MAP_INCLUDED
|
||||
#define ETL_MAP_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <iterator>
|
||||
@ -51,9 +51,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "8"
|
||||
@ -342,7 +340,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void rotate_3node(Node*& position, uint_least8_t dir, uint_least8_t third)
|
||||
{
|
||||
// __A__ __E__ __A__ __D__
|
||||
// --A-- --E-- --A-- --D--
|
||||
// _B_ C -> B A OR B _C_ -> A C
|
||||
// D E D F G C D E B F G E
|
||||
// F G F G
|
||||
@ -453,7 +451,7 @@ namespace etl
|
||||
size_type current_size; ///< The number of the used nodes.
|
||||
const size_type CAPACITY; ///< The maximum size of the map.
|
||||
Node* root_node; ///< The node that acts as the map root.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -1263,7 +1261,7 @@ namespace etl
|
||||
{
|
||||
Data_Node& node = *p_node_pool->allocate<Data_Node>();
|
||||
::new (&node.value) const value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -1274,7 +1272,7 @@ namespace etl
|
||||
{
|
||||
node.value.~value_type();
|
||||
p_node_pool->release(&node);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -2186,9 +2184,7 @@ bool operator >=(const etl::imap<TKey, TMapped, TKeyCompare>& lhs, const etl::im
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MEMORY__
|
||||
#define __ETL_MEMORY__
|
||||
#ifndef ETL_MEMORY_INCLUDED
|
||||
#define ETL_MEMORY_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
|
||||
46
include/etl/memory_model.h
Normal file
46
include/etl/memory_model.h
Normal file
@ -0,0 +1,46 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ETL_MEMORY_MODEL_INCLUDED
|
||||
#define ETL_MEMORY_MODEL_INCLUDED
|
||||
|
||||
#include "user_type.h"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
ETL_DECLARE_USER_TYPE(memory_model, int)
|
||||
ETL_USER_TYPE(MM_SMALL, 0)
|
||||
ETL_USER_TYPE(MM_MEDIUM, 1)
|
||||
ETL_USER_TYPE(MM_LARGE, 2)
|
||||
ETL_END_USER_TYPE(memory_model)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MESSAGE__
|
||||
#define __ETL_MESSAGE__
|
||||
#ifndef ETL_MESSAGE_INCLUDED
|
||||
#define ETL_MESSAGE_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MESSAGE_BUS_
|
||||
#define __ETL_MESSAGE_BUS_
|
||||
#ifndef ETL_MESSAGE_BUS_
|
||||
#define ETL_MESSAGE_BUS_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
|
||||
@ -48,8 +48,8 @@ SOFTWARE.
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_MESSAGE_ROUTER__
|
||||
#define __ETL_MESSAGE_ROUTER__
|
||||
#ifndef ETL_MESSAGE_ROUTER_INCLUDED
|
||||
#define ETL_MESSAGE_ROUTER_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ cog.outl("#endif")
|
||||
/*[[[cog
|
||||
import cog
|
||||
cog.outl("//***************************************************************************")
|
||||
cog.outl("// This file has been auto generated. Do not edit this file.")
|
||||
cog.outl("// THIS FILE HAS BEEN AUTO GENERATED. DO NOT EDIT THIS FILE.")
|
||||
cog.outl("//***************************************************************************")
|
||||
]]]*/
|
||||
/*[[[end]]]*/
|
||||
@ -60,8 +60,8 @@ cog.outl("//********************************************************************
|
||||
// See generate.bat
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef __ETL_MESSAGE_ROUTER__
|
||||
#define __ETL_MESSAGE_ROUTER__
|
||||
#ifndef ETL_MESSAGE_ROUTER_INCLUDED
|
||||
#define ETL_MESSAGE_ROUTER_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MESSAGE_TIMER__
|
||||
#define __ETL_MESSAGE_TIMER__
|
||||
#ifndef ETL_MESSAGE_TIMER_INCLUDED
|
||||
#define ETL_MESSAGE_TIMER_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
@ -148,7 +148,7 @@ namespace etl
|
||||
message_timer_data& operator =(const message_timer_data& other);
|
||||
};
|
||||
|
||||
namespace __private_message_timer__
|
||||
namespace private_message_timer
|
||||
{
|
||||
//*************************************************************************
|
||||
/// A specialised intrusive linked list for timer data.
|
||||
@ -623,7 +623,7 @@ namespace etl
|
||||
message_timer_data* const timer_array;
|
||||
|
||||
// The list of active timers.
|
||||
__private_message_timer__::list active_list;
|
||||
private_message_timer::list active_list;
|
||||
|
||||
volatile bool enabled;
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MESSAGE_DEFS__
|
||||
#define __ETL_MESSAGE_DEFS__
|
||||
#ifndef ETL_MESSAGE_DEFS_INCLUDED
|
||||
#define ETL_MESSAGE_DEFS_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MULTIMAP__
|
||||
#define __ETL_MULTIMAP__
|
||||
#ifndef ETL_MULTIMAP_INCLUDED
|
||||
#define ETL_MULTIMAP_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <iterator>
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "9"
|
||||
@ -347,7 +345,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void rotate_3node(Node*& position, uint_least8_t dir, uint_least8_t third)
|
||||
{
|
||||
// __A__ __E__ __A__ __D__
|
||||
// --A-- --E-- --A-- --D--
|
||||
// _B_ C -> B A OR B _C_ -> A C
|
||||
// D E D F G C D E B F G E
|
||||
// F G F G
|
||||
@ -609,7 +607,7 @@ namespace etl
|
||||
size_type current_size; ///< The number of the used nodes.
|
||||
const size_type CAPACITY; ///< The maximum size of the map.
|
||||
Node* root_node; ///< The node that acts as the multimap root.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -1356,7 +1354,7 @@ namespace etl
|
||||
{
|
||||
Data_Node& node = *p_node_pool->allocate<Data_Node>();
|
||||
::new (&node.value) const value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -1367,7 +1365,7 @@ namespace etl
|
||||
{
|
||||
node.value.~value_type();
|
||||
p_node_pool->release(&node);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -2071,9 +2069,7 @@ bool operator >=(const etl::imultimap<TKey, TMapped, TKeyCompare>& lhs, const et
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MULTISET__
|
||||
#define __ETL_MULTISET__
|
||||
#ifndef ETL_MULTISET_INCLUDED
|
||||
#define ETL_MULTISET_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <iterator>
|
||||
@ -50,9 +50,7 @@ SOFTWARE.
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#undef min
|
||||
#endif
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "10"
|
||||
@ -555,7 +553,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void rotate_3node(Node*& position, uint_least8_t dir, uint_least8_t third)
|
||||
{
|
||||
// __A__ __E__ __A__ __D__
|
||||
// --A-- --E-- --A-- --D--
|
||||
// _B_ C -> B A OR B _C_ -> A C
|
||||
// D E D F G C D E B F G E
|
||||
// F G F G
|
||||
@ -609,7 +607,7 @@ namespace etl
|
||||
size_type current_size; ///< The number of the used nodes.
|
||||
const size_type CAPACITY; ///< The maximum size of the set.
|
||||
Node* root_node; ///< The node that acts as the multiset root.
|
||||
etl::debug_count construct_count;
|
||||
ETL_DECLARE_DEBUG_COUNT;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
@ -1337,7 +1335,7 @@ namespace etl
|
||||
{
|
||||
Data_Node& node = *p_node_pool->allocate<Data_Node>();
|
||||
::new ((void*)&node.value) value_type(value);
|
||||
++construct_count;
|
||||
ETL_INCREMENT_DEBUG_COUNT;
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -1348,7 +1346,7 @@ namespace etl
|
||||
{
|
||||
node.value.~value_type();
|
||||
p_node_pool->release(&node);
|
||||
--construct_count;
|
||||
ETL_DECREMENT_DEBUG_COUNT;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -2051,9 +2049,7 @@ bool operator >=(const etl::imultiset<T, TCompare>& lhs, const etl::imultiset<T,
|
||||
return !(lhs < rhs);
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MURMUR3__
|
||||
#define __ETL_MURMUR3__
|
||||
#ifndef ETL_MURMUR3_INCLUDED
|
||||
#define ETL_MURMUR3_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MUTEX__
|
||||
#define __ETL_MUTEX__
|
||||
#ifndef ETL_MUTEX_INCLUDED
|
||||
#define ETL_MUTEX_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MUTEX_ARM__
|
||||
#define __ETL_MUTEX_ARM__
|
||||
#ifndef ETL_MUTEX_ARM_INCLUDED
|
||||
#define ETL_MUTEX_ARM_INCLUDED
|
||||
|
||||
#include "mutex_gcc_sync.h"
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MUTEX_GCC_SYNC__
|
||||
#define __ETL_MUTEX_GCC_SYNC__
|
||||
#ifndef ETL_MUTEX_GCC_SYNC_INCLUDED
|
||||
#define ETL_MUTEX_GCC_SYNC_INCLUDED
|
||||
|
||||
#include "../platform.h"
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_MUTEX_STD__
|
||||
#define __ETL_MUTEX_STD__
|
||||
#ifndef ETL_MUTEX_STD_INCLUDED
|
||||
#define ETL_MUTEX_STD_INCLUDED
|
||||
|
||||
#include "../platform.h"
|
||||
|
||||
|
||||
50
include/etl/null_type.h
Normal file
50
include/etl/null_type.h
Normal file
@ -0,0 +1,50 @@
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ETL_NULL_TYPE_INCLUDED
|
||||
#define ETL_NULL_TYPE_INCLUDED
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "50"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
template <size_t N>
|
||||
class null_type
|
||||
{
|
||||
private:
|
||||
|
||||
null_type();
|
||||
null_type(const null_type&);
|
||||
null_type& operator=(const null_type&);
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_NULLPTR__
|
||||
#define __ETL_NULLPTR__
|
||||
#ifndef ETL_NULLPTR_INCLUDED
|
||||
#define ETL_NULLPTR_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_NUMERIC__
|
||||
#define __ETL_NUMERIC__
|
||||
#ifndef ETL_NUMERIC_INCLUDED
|
||||
#define ETL_NUMERIC_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_OBSERVER__
|
||||
#define __ETL_OBSERVER__
|
||||
#ifndef ETL_OBSERVER_INCLUDED
|
||||
#define ETL_OBSERVER_INCLUDED
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup observer observer
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_OPTIONAL__
|
||||
#define __ETL_OPTIONAL__
|
||||
#ifndef ETL_OPTIONAL_INCLUDED
|
||||
#define ETL_OPTIONAL_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "alignment.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_PACKET__
|
||||
#define __ETL_PACKET__
|
||||
#ifndef ETL_PACKET_INCLUDED
|
||||
#define ETL_PACKET_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "static_assert.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_PARAMETER__
|
||||
#define __ETL_PARAMETER__
|
||||
#ifndef ETL_PARAMETER_INCLUDED
|
||||
#define ETL_PARAMETER_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "type_traits.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_PEARSON__
|
||||
#define __ETL_PEARSON__
|
||||
#ifndef ETL_PEARSON_INCLUDED
|
||||
#define ETL_PEARSON_INCLUDED
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_PERMUTATIONS__
|
||||
#define __ETL_PERMUTATIONS__
|
||||
#ifndef ETL_PERMUTATIONS_INCLUDED
|
||||
#define ETL_PERMUTATIONS_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
@ -30,8 +30,8 @@ SOFTWARE.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __ETL_PLATFORM__
|
||||
#define __ETL_PLATFORM__
|
||||
#ifndef ETL_PLATFORM_INCLUDED
|
||||
#define ETL_PLATFORM_INCLUDED
|
||||
|
||||
// Some targets do not support 8bit types.
|
||||
#define ETL_8BIT_SUPPORT (CHAR_BIT == 8)
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_POOL__
|
||||
#define __ETL_POOL__
|
||||
#ifndef ETL_POOL_INCLUDED
|
||||
#define ETL_POOL_INCLUDED
|
||||
|
||||
#include "platform.h"
|
||||
#include "error_handler.h"
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_POW__
|
||||
#define __ETL_POW__
|
||||
#ifndef ETL_POW_INCLUDED
|
||||
#define ETL_POW_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@ -28,8 +28,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_PRIORITY_QUEUE__
|
||||
#define __ETL_PRIORITY_QUEUE__
|
||||
#ifndef ETL_PRIORITY_QUEUE_INCLUDED
|
||||
#define ETL_PRIORITY_QUEUE_INCLUDED
|
||||
|
||||
#include <stddef.h>
|
||||
#include <functional>
|
||||
|
||||
@ -28,10 +28,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ETL_IVECTOR_POINTER__
|
||||
#define __ETL_IVECTOR_POINTER__
|
||||
#ifndef ETL_IVECTOR_POINTER_INCLUDED
|
||||
#define ETL_IVECTOR_POINTER_INCLUDED
|
||||
|
||||
#ifndef __ETL_IN_VECTOR_H__
|
||||
#ifndef ETL_IN_VECTOR_H
|
||||
#error This header is a private element of etl::ivector
|
||||
#endif
|
||||
|
||||
|
||||
39
include/etl/private/minmax_pop.h
Normal file
39
include/etl/private/minmax_pop.h
Normal file
@ -0,0 +1,39 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#pragma pop_macro("min")
|
||||
#pragma pop_macro("max")
|
||||
#endif
|
||||
41
include/etl/private/minmax_push.h
Normal file
41
include/etl/private/minmax_push.h
Normal file
@ -0,0 +1,41 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2018 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#ifdef ETL_COMPILER_MICROSOFT
|
||||
#pragma push_macro("min")
|
||||
#pragma push_macro("max")
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user