mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 22:59:47 +08:00
Merge remote-tracking branch 'origin/development'
This commit is contained in:
commit
57011fc1f3
1
Doxyfile
1
Doxyfile
@ -34,6 +34,7 @@ DOXYFILE_ENCODING = UTF-8
|
||||
|
||||
PROJECT_NAME = "Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
13
array.h
13
array.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -55,8 +56,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
array_exception(const char* what)
|
||||
: exception(what)
|
||||
array_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -69,8 +70,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
array_out_of_range()
|
||||
: array_exception("array: out of range")
|
||||
array_out_of_range(string_type file_name, numeric_type line_number)
|
||||
: array_exception("array:range", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -115,7 +116,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
reference at(size_t i)
|
||||
{
|
||||
ETL_ASSERT(i < SIZE, array_out_of_range());
|
||||
ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range));
|
||||
|
||||
return _buffer[i];
|
||||
}
|
||||
@ -126,7 +127,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
const_reference at(size_t i) const
|
||||
{
|
||||
ETL_ASSERT(i < SIZE, array_out_of_range());
|
||||
ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range));
|
||||
|
||||
return _buffer[i];
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
1
binary.h
1
binary.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
3
bitset.h
3
bitset.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -137,7 +138,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
bitset<N>& set(const char* text)
|
||||
{
|
||||
if (ETL_ASSERT(text != 0, etl::bitset_nullptr()))
|
||||
if (ETL_ASSERT(text != 0, ETL_ERROR(bitset_nullptr)))
|
||||
{
|
||||
ibitset::set(text);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
crc16.h
1
crc16.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
crc32.h
1
crc32.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
deque.h
1
deque.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -27,6 +28,7 @@ SOFTWARE.
|
||||
|
||||
///\defgroup etl Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
///\defgroup containers Containers
|
||||
///\ingroup etl
|
||||
|
||||
1
endian.h
1
endian.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -53,10 +54,10 @@ namespace etl
|
||||
//*************************************************************************
|
||||
/// Callback class for free handler functions.
|
||||
//*************************************************************************
|
||||
struct free_function : public function<void, const exception&>
|
||||
struct free_function : public function<void, const etl::exception&>
|
||||
{
|
||||
free_function(void (*p_function)(const exception&))
|
||||
: function<void, const exception&>(p_function)
|
||||
free_function(void (*p_function)(const etl::exception&))
|
||||
: etl::function<void, const etl::exception&>(p_function)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -65,46 +66,58 @@ namespace etl
|
||||
/// Callback class for member handler functions.
|
||||
//*************************************************************************
|
||||
template <typename TObject>
|
||||
struct member_function : public function<TObject, const exception&>
|
||||
struct member_function : public etl::function<TObject, const etl::exception&>
|
||||
{
|
||||
member_function(TObject& object, void(TObject::*p_function)(const exception&))
|
||||
: function<TObject, const exception&>(object, p_function)
|
||||
member_function(TObject& object, void(TObject::*p_function)(const etl::exception&))
|
||||
: etl::function<TObject, const etl::exception&>(object, p_function)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static void set_callback(ifunction<const exception&>& f);
|
||||
static void error(const exception& e);
|
||||
static void set_callback(ifunction<const etl::exception&>& f);
|
||||
static void error(const etl::exception& e);
|
||||
|
||||
private:
|
||||
|
||||
static ifunction<const exception&>* p_ifunction;
|
||||
static ifunction<const etl::exception&>* p_ifunction;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
/// Asserts a coondition.
|
||||
/// Versions of the macro that return a constant value of 'true' will allow the compiler to optimise away
|
||||
/// any 'if' statements that it is contained within.
|
||||
/// If ETL_NO_CHECKS is defined then no runtime checks are executed at all.
|
||||
/// If ETL_THROW_EXCEPTIONS is defined then the error is thrown if the assert fails. The return value is always 'true'.
|
||||
/// If ETL_LOG_ERRORS is defined then the error is logged if the assert fails. The return value is the value of the boolean test.
|
||||
/// Otherwise 'assert' is called. The return value is always 'true'.
|
||||
///\ingroup error_handler
|
||||
//***************************************************************************
|
||||
#if defined(ETL_NO_CHECKS)
|
||||
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
|
||||
#elif defined(ETL_THROW_EXCEPTIONS)
|
||||
#define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'.
|
||||
#elif defined (ETL_LOG_ERRORS)
|
||||
#define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition.
|
||||
#else
|
||||
#if defined(NDEBUG)
|
||||
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
|
||||
#elif
|
||||
#define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'.
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Asserts a coondition.
|
||||
/// Versions of the macro that return a constant value of 'true' will allow the compiler to optimise away
|
||||
/// any 'if' statements that it is contained within.
|
||||
/// If ETL_NO_CHECKS is defined then no runtime checks are executed at all.
|
||||
/// If ETL_THROW_EXCEPTIONS is defined then the error is thrown if the assert fails. The return value is always 'true'.
|
||||
/// If ETL_LOG_ERRORS is defined then the error is logged if the assert fails. The return value is the value of the boolean test.
|
||||
/// Otherwise 'assert' is called. The return value is always 'true'.
|
||||
///\ingroup error_handler
|
||||
//***************************************************************************
|
||||
#if defined(ETL_NO_CHECKS)
|
||||
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
|
||||
#elif defined(ETL_THROW_EXCEPTIONS)
|
||||
#define ETL_ASSERT(b, e) (((b) ? true : throw((e))), true) // Throws an exception if the condition fails. Evaluates to 'true'.
|
||||
#elif defined(ETL_LOG_ERRORS)
|
||||
#define ETL_ASSERT(b, e) (((b) ? true : etl::error_handler::error((e))), (b)) // Logs the error if the condition fails. Evaluates to the result of the condition.
|
||||
#else
|
||||
#if defined(NDEBUG)
|
||||
#define ETL_ASSERT(b, e) (true) // Does nothing. Evaluates to 'true'.
|
||||
#elif
|
||||
#define ETL_ASSERT(b, e) ((assert((b))), true) // Asserts if the condition fails. Evaluates to 'true'.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ETL_VERBOSE_ERRORS)
|
||||
#define ETL_ERROR(e) (e(__FILE__, __LINE__)) // Make an exception with the file name and line number.
|
||||
#else
|
||||
#define ETL_ERROR(e) (e("", __LINE__)) // Make an exception with the line number.
|
||||
#endif
|
||||
|
||||
#if defined(ETL_VERBOSE_ERRORS)
|
||||
#define ETL_ERROR_TEXT(verbose_text, terse_text) (verbose_text) // Use the verbose text.
|
||||
#else
|
||||
#define ETL_ERROR_TEXT(verbose_text, terse_text) (terse_text) // Use the terse text.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
52
exception.h
52
exception.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -44,28 +45,69 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
typedef const char* value_type;
|
||||
typedef const char* string_type;
|
||||
typedef int numeric_type;
|
||||
|
||||
#if defined(ETL_VERBOSE_ERRORS)
|
||||
//*************************************************************************
|
||||
/// Constructor.
|
||||
//*************************************************************************
|
||||
exception(value_type reason)
|
||||
: reason(reason)
|
||||
exception(string_type reason, string_type file, numeric_type line)
|
||||
: reason(reason),
|
||||
file(file),
|
||||
line(line)
|
||||
{
|
||||
}
|
||||
#else
|
||||
//*************************************************************************
|
||||
/// Constructor.
|
||||
//*************************************************************************
|
||||
exception(string_type reason, string_type file, numeric_type line)
|
||||
: reason(reason),
|
||||
line(line)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// Gets the reason for the exception.
|
||||
/// \return const char* to the reason.
|
||||
//***************************************************************************
|
||||
value_type what() const
|
||||
string_type what() const
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
/// Gets the file for the exception.
|
||||
/// \return const char* to the file.
|
||||
//***************************************************************************
|
||||
string_type file_name() const
|
||||
{
|
||||
#if defined(ETL_VERBOSE_ERRORS)
|
||||
return file;
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Gets the line for the exception.
|
||||
/// \return const char* to the line.
|
||||
//***************************************************************************
|
||||
numeric_type line_number() const
|
||||
{
|
||||
return line;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
value_type reason; ///< The reason for the exception.
|
||||
string_type reason; ///< The reason for the exception.
|
||||
#if defined(ETL_VERBOSE_ERRORS)
|
||||
string_type file; ///< The file for the exception.
|
||||
#endif
|
||||
numeric_type line; ///< The line for the exception.
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
1
fnv_1.h
1
fnv_1.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
hash.h
1
hash.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -51,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
bitset_exception(const char* what)
|
||||
: exception(what)
|
||||
bitset_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -65,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
bitset_nullptr()
|
||||
: bitset_exception("bitset: nullptr")
|
||||
bitset_nullptr(string_type file_name, numeric_type line_number)
|
||||
: bitset_exception("bitset: nullptr", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
27
ideque.h
27
ideque.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -491,7 +492,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void assign(size_type n, const value_type& value)
|
||||
{
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, deque_full()))
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(deque_full)))
|
||||
{
|
||||
initialise();
|
||||
|
||||
@ -513,7 +514,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
reference at(size_t index)
|
||||
{
|
||||
ETL_ASSERT(index < current_size, deque_out_of_bounds());
|
||||
ETL_ASSERT(index < current_size, ETL_ERROR(deque_out_of_bounds));
|
||||
|
||||
iterator result(_begin);
|
||||
result += index;
|
||||
@ -528,7 +529,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
const_reference at(size_t index) const
|
||||
{
|
||||
ETL_ASSERT(index < current_size, deque_out_of_bounds());
|
||||
ETL_ASSERT(index < current_size, ETL_ERROR(deque_out_of_bounds));
|
||||
|
||||
iterator result(_begin);
|
||||
result += index;
|
||||
@ -710,7 +711,7 @@ namespace etl
|
||||
{
|
||||
iterator position(insert_position.index, *this, p_buffer);
|
||||
|
||||
if (ETL_ASSERT(!full(), deque_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(deque_full)))
|
||||
{
|
||||
if (insert_position == begin())
|
||||
{
|
||||
@ -764,7 +765,7 @@ namespace etl
|
||||
{
|
||||
iterator position;
|
||||
|
||||
if (ETL_ASSERT((current_size + n) <= MAX_SIZE, deque_full()))
|
||||
if (ETL_ASSERT((current_size + n) <= MAX_SIZE, ETL_ERROR(deque_full)))
|
||||
{
|
||||
if (insert_position == begin())
|
||||
{
|
||||
@ -878,7 +879,7 @@ namespace etl
|
||||
|
||||
difference_type n = std::distance(range_begin, range_end);
|
||||
|
||||
if (ETL_ASSERT((current_size + n) <= MAX_SIZE, deque_full()))
|
||||
if (ETL_ASSERT((current_size + n) <= MAX_SIZE, ETL_ERROR(deque_full)))
|
||||
{
|
||||
if (insert_position == begin())
|
||||
{
|
||||
@ -980,7 +981,7 @@ namespace etl
|
||||
{
|
||||
iterator position(erase_position.index, *this, p_buffer);
|
||||
|
||||
if (ETL_ASSERT(distance(position) <= difference_type(current_size), deque_out_of_bounds()))
|
||||
if (ETL_ASSERT(distance(position) <= difference_type(current_size), ETL_ERROR(deque_out_of_bounds)))
|
||||
{
|
||||
if (position == _begin)
|
||||
{
|
||||
@ -1022,7 +1023,7 @@ namespace etl
|
||||
{
|
||||
iterator position(range_begin.index, *this, p_buffer);
|
||||
|
||||
if (ETL_ASSERT((distance(range_begin) <= difference_type(current_size)) && (distance(range_end) <= difference_type(current_size)), deque_out_of_bounds()))
|
||||
if (ETL_ASSERT((distance(range_begin) <= difference_type(current_size)) && (distance(range_end) <= difference_type(current_size)), ETL_ERROR(deque_out_of_bounds)))
|
||||
{
|
||||
// How many to erase?
|
||||
size_t length = std::distance(range_begin, range_end);
|
||||
@ -1087,7 +1088,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_back(parameter_t item)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), deque_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(deque_full)))
|
||||
{
|
||||
create_element_back(item);
|
||||
}
|
||||
@ -1102,7 +1103,7 @@ namespace etl
|
||||
{
|
||||
reference r = *_end;
|
||||
|
||||
if (ETL_ASSERT(!full(), deque_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(deque_full)))
|
||||
{
|
||||
create_element_back();
|
||||
}
|
||||
@ -1128,7 +1129,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_front(parameter_t item)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), deque_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(deque_full)))
|
||||
{
|
||||
create_element_front(item);
|
||||
}
|
||||
@ -1141,7 +1142,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
reference push_front()
|
||||
{
|
||||
if (ETL_ASSERT(!full(), deque_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(deque_full)))
|
||||
{
|
||||
create_element_front();
|
||||
}
|
||||
@ -1168,7 +1169,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void resize(size_t new_size, const value_type& value = value_type())
|
||||
{
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, deque_out_of_bounds()))
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(deque_out_of_bounds)))
|
||||
{
|
||||
// Make it smaller?
|
||||
if (new_size < current_size)
|
||||
|
||||
13
iflat_map.h
13
iflat_map.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -240,7 +241,7 @@ namespace etl
|
||||
{
|
||||
iterator i_element = lower_bound(key);
|
||||
|
||||
ETL_ASSERT(i_element != end(), flat_map_out_of_bounds());
|
||||
ETL_ASSERT(i_element != end(), ETL_ERROR(flat_map_out_of_bounds));
|
||||
|
||||
return i_element->second;
|
||||
}
|
||||
@ -255,7 +256,7 @@ namespace etl
|
||||
{
|
||||
typename buffer_t::const_iterator i_element = lower_bound(key);
|
||||
|
||||
ETL_ASSERT(i_element != end(), flat_map_out_of_bounds());
|
||||
ETL_ASSERT(i_element != end(), ETL_ERROR(flat_map_out_of_bounds));
|
||||
|
||||
return i_element->second;
|
||||
}
|
||||
@ -273,8 +274,8 @@ namespace etl
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
|
||||
ETL_ASSERT(count >= 0, flat_map_iterator());
|
||||
ETL_ASSERT(count <= difference_type(capacity()), flat_map_full());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(flat_map_iterator));
|
||||
ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_map_full));
|
||||
#endif
|
||||
|
||||
clear();
|
||||
@ -299,7 +300,7 @@ namespace etl
|
||||
if (i_element == end())
|
||||
{
|
||||
// At the end.
|
||||
if (ETL_ASSERT(!buffer.full(), flat_map_full()))
|
||||
if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_map_full)))
|
||||
{
|
||||
buffer.push_back(value);
|
||||
result.first = end() - 1;
|
||||
@ -320,7 +321,7 @@ namespace etl
|
||||
else
|
||||
{
|
||||
// A new one.
|
||||
if (ETL_ASSERT(!buffer.full(), flat_map_full()))
|
||||
if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_map_full)))
|
||||
{
|
||||
buffer.insert(i_element, value);
|
||||
result.first = i_element;
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -223,7 +224,7 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, flat_multimap_iterator());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(flat_multimap_iterator));
|
||||
#endif
|
||||
|
||||
clear();
|
||||
@ -245,7 +246,7 @@ namespace etl
|
||||
|
||||
iterator i_element = lower_bound(value.first);
|
||||
|
||||
if (ETL_ASSERT(!buffer.full(), flat_multimap_full()))
|
||||
if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_multimap_full)))
|
||||
{
|
||||
if (i_element == end())
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -200,7 +201,7 @@ namespace etl
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
|
||||
ETL_ASSERT(count >= 0, flat_multiset_iterator());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(flat_multiset_iterator));
|
||||
#endif
|
||||
|
||||
clear();
|
||||
@ -220,7 +221,7 @@ namespace etl
|
||||
{
|
||||
std::pair<iterator, bool> result(end(), false);
|
||||
|
||||
if (ETL_ASSERT(!buffer.full(), flat_multiset_full()))
|
||||
if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_multiset_full)))
|
||||
{
|
||||
iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare());
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -199,7 +200,7 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, flat_set_iterator());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(flat_set_iterator));
|
||||
#endif
|
||||
|
||||
clear();
|
||||
@ -219,7 +220,7 @@ namespace etl
|
||||
{
|
||||
std::pair<iterator, bool> result(end(), false);
|
||||
|
||||
if (ETL_ASSERT(!buffer.full(), flat_set_full()))
|
||||
if (ETL_ASSERT(!buffer.full(), ETL_ERROR(flat_set_full)))
|
||||
{
|
||||
iterator i_element = std::lower_bound(begin(), end(), value, TKeyCompare());
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -363,7 +364,7 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, forward_list_iterator());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(forward_list_iterator));
|
||||
#endif
|
||||
|
||||
initialise();
|
||||
@ -373,7 +374,7 @@ namespace etl
|
||||
// Add all of the elements.
|
||||
while (first != last)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), forward_list_iterator()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_iterator)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(*first++);
|
||||
join(p_last_node, &data_node);
|
||||
@ -389,7 +390,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void assign(size_t n, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, forward_list_full()))
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
initialise();
|
||||
|
||||
@ -412,7 +413,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_front()
|
||||
{
|
||||
if (ETL_ASSERT(!full(), forward_list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(T());
|
||||
insert_node_after(start_node, data_node);
|
||||
@ -424,7 +425,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_front(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), forward_list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(value);
|
||||
insert_node_after(start_node, data_node);
|
||||
@ -457,7 +458,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void resize(size_t n, T value)
|
||||
{
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, forward_list_full()))
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
size_t i = 0;
|
||||
iterator i_node = begin();
|
||||
@ -493,7 +494,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
iterator insert_after(iterator position, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), forward_list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(value);
|
||||
insert_node_after(*position.p_node, data_node);
|
||||
@ -507,7 +508,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void insert_after(iterator position, size_t n, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), forward_list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(forward_list_full)))
|
||||
{
|
||||
for (size_t i = 0; !full() && (i < n); ++i)
|
||||
{
|
||||
@ -526,7 +527,7 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT((count + current_size) <= MAX_SIZE, forward_list_full());
|
||||
ETL_ASSERT((count + current_size) <= MAX_SIZE, ETL_ERROR(forward_list_full));
|
||||
#endif
|
||||
|
||||
while (first != last)
|
||||
|
||||
15
ihash.h
15
ihash.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -34,10 +35,14 @@ SOFTWARE.
|
||||
#include <utility>
|
||||
|
||||
#include "exception.h"
|
||||
#include "error_handler.h"
|
||||
|
||||
///\defgroup ihash Common data for all hash type classes.
|
||||
///\ingroup hash
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "19"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -48,8 +53,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
hash_exception(const char* what)
|
||||
: exception(what)
|
||||
hash_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
hash_finalised()
|
||||
: hash_exception("ihash: finalised")
|
||||
hash_finalised(string_type file_name, numeric_type line_number)
|
||||
: hash_exception(ETL_ERROR_TEXT("ihash:finalised", ETL_FILE"A"), file_name, line_number)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -70,4 +75,6 @@ namespace etl
|
||||
typedef hash_finalised hash_finalized;
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
23
ilist.h
23
ilist.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -452,8 +453,8 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, list_iterator());
|
||||
ETL_ASSERT(size_t(count) <= MAX_SIZE, list_full());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(list_iterator));
|
||||
ETL_ASSERT(size_t(count) <= MAX_SIZE, ETL_ERROR(list_full));
|
||||
#endif
|
||||
initialise();
|
||||
|
||||
@ -474,7 +475,7 @@ namespace etl
|
||||
void assign(size_t n, parameter_t value)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(n <= MAX_SIZE, list_full());
|
||||
ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(list_full));
|
||||
#endif
|
||||
|
||||
initialise();
|
||||
@ -494,7 +495,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_front()
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(T());
|
||||
insert_node(get_head(), data_node);
|
||||
@ -506,7 +507,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_front(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
Node& data_node = allocate_data_node(value);
|
||||
insert_node(get_head(), data_node);
|
||||
@ -530,7 +531,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(T());
|
||||
insert_node(terminal_node, data_node);
|
||||
@ -542,7 +543,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_back(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(value);
|
||||
insert_node(terminal_node, data_node);
|
||||
@ -566,7 +567,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
iterator insert(iterator position, const value_type& value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
Data_Node& data_node = allocate_data_node(value);
|
||||
insert_node(*position.p_node, data_node);
|
||||
@ -582,7 +583,7 @@ namespace etl
|
||||
{
|
||||
for (size_t i = 0; i < n; ++i)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
// Set up the next free node and insert.
|
||||
Data_Node& data_node = allocate_data_node(value);
|
||||
@ -599,7 +600,7 @@ namespace etl
|
||||
{
|
||||
while (first != last)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), list_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(list_full)))
|
||||
{
|
||||
// Set up the next free node and insert.
|
||||
Data_Node& data_node = allocate_data_node(*first++);
|
||||
@ -660,7 +661,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void resize(size_t n, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, list_full()))
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(list_full)))
|
||||
{
|
||||
// Smaller?
|
||||
if (n < size())
|
||||
|
||||
29
imap.h
29
imap.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -524,16 +525,7 @@ namespace etl
|
||||
{
|
||||
iterator i_element = find(key);
|
||||
|
||||
if (!i_element.p_node)
|
||||
{
|
||||
// Doesn't exist.
|
||||
#if ETL_THROW_EXCEPTIONS
|
||||
throw map_out_of_bounds();
|
||||
#else
|
||||
error_handler::error(map_out_of_bounds());
|
||||
|
||||
#endif
|
||||
}
|
||||
ETL_ASSERT(i_element.p_node != nullptr, ETL_ERROR(map_out_of_bounds));
|
||||
|
||||
return i_element->second;
|
||||
}
|
||||
@ -548,16 +540,7 @@ namespace etl
|
||||
{
|
||||
const_iterator i_element = find(key);
|
||||
|
||||
if (!i_element.p_node)
|
||||
{
|
||||
// Doesn't exist.
|
||||
#if ETL_THROW_EXCEPTIONS
|
||||
throw map_out_of_bounds();
|
||||
#else
|
||||
error_handler::error(map_out_of_bounds());
|
||||
|
||||
#endif
|
||||
}
|
||||
ETL_ASSERT(i_element.p_node != nullptr, ETL_ERROR(map_out_of_bounds));
|
||||
|
||||
return i_element->second;
|
||||
}
|
||||
@ -708,7 +691,7 @@ namespace etl
|
||||
Node* inserted_node = nullptr;
|
||||
bool inserted = false;
|
||||
|
||||
if (ETL_ASSERT(!full(), map_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(map_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
@ -733,7 +716,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), map_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(map_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
@ -757,7 +740,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), map_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(map_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -655,7 +656,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), multimap_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(multimap_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -636,7 +637,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), multiset_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(multiset_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -53,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
intrusive_forward_list_exception(const char* what)
|
||||
: exception(what)
|
||||
intrusive_forward_list_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -67,8 +68,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
intrusive_forward_list_iterator_exception()
|
||||
: intrusive_forward_list_exception("intrusive_forward_list: iterator problem")
|
||||
intrusive_forward_list_iterator_exception(string_type file_name, numeric_type line_number)
|
||||
: intrusive_forward_list_exception("intrusive_forward_list: iterator", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -81,8 +82,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
intrusive_forward_list_index_exception()
|
||||
: intrusive_forward_list_exception("intrusive_forward_list: index out of bounds")
|
||||
intrusive_forward_list_index_exception(string_type file_name, numeric_type line_number)
|
||||
: intrusive_forward_list_exception("intrusive_forward_list:bounds", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -408,7 +409,7 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, intrusive_forward_list_iterator_exception());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(intrusive_forward_list_iterator_exception));
|
||||
#endif
|
||||
|
||||
initialise();
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -71,7 +72,7 @@ namespace etl
|
||||
__private_intrusive_forward_list__::intrusive_forward_list_node_base* get_next(size_t index) const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(index < SIZE, intrusive_forward_list_index_exception());
|
||||
ETL_ASSERT(index < SIZE, ETL_ERROR(intrusive_forward_list_index_exception));
|
||||
#endif
|
||||
return next[index];
|
||||
}
|
||||
@ -79,7 +80,7 @@ namespace etl
|
||||
void set_next(size_t index, __private_intrusive_forward_list__::intrusive_forward_list_node_base* pnext)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(index < SIZE, intrusive_forward_list_index_exception());
|
||||
ETL_ASSERT(index < SIZE, ETL_ERROR(intrusive_forward_list_index_exception));
|
||||
#endif
|
||||
next[index] = pnext;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
11
ipool.h
11
ipool.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -323,9 +324,9 @@ namespace etl
|
||||
T* allocate()
|
||||
{
|
||||
#if defined(_DEBUG) || defined(DEBUG)
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), pool_no_allocation()))
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), ETL_ERROR(pool_no_allocation)))
|
||||
#else
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE, pool_no_allocation()))
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE, ETL_ERROR(pool_no_allocation)))
|
||||
#endif
|
||||
{
|
||||
T* result = new(&p_buffer[next_free]) T();
|
||||
@ -349,9 +350,9 @@ namespace etl
|
||||
T* allocate(const T& initial)
|
||||
{
|
||||
#if defined(_DEBUG) || defined(DEBUG)
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), pool_no_allocation()))
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE && !in_use_flags.test(next_free), ETL_ERROR(pool_no_allocation)))
|
||||
#else
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE, pool_no_allocation()))
|
||||
if (ETL_ASSERT(items_allocated < MAX_SIZE, ETL_ERROR(pool_no_allocation)))
|
||||
#endif
|
||||
{
|
||||
T* result = new(&p_buffer[next_free]) T(initial);
|
||||
@ -386,7 +387,7 @@ namespace etl
|
||||
void release(const T* const p_object)
|
||||
{
|
||||
// Does it belong to me?
|
||||
if (ETL_ASSERT(is_in_pool(p_object), pool_object_not_in_pool()))
|
||||
if (ETL_ASSERT(is_in_pool(p_object), ETL_ERROR(pool_object_not_in_pool)))
|
||||
{
|
||||
// Where is it in the buffer?
|
||||
typename std::iterator_traits<T*>::difference_type distance = p_object - p_buffer;
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove, rlindeman
|
||||
|
||||
@ -101,7 +102,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), priority_queue_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(priority_queue_full)))
|
||||
{
|
||||
// Put element at end
|
||||
container.push_back(value);
|
||||
@ -135,8 +136,8 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, priority_queue_iterator());
|
||||
ETL_ASSERT(static_cast<size_t>(count) <= MAX_SIZE, priority_queue_full());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(priority_queue_iterator));
|
||||
ETL_ASSERT(static_cast<size_t>(count) <= MAX_SIZE, ETL_ERROR(priority_queue_full));
|
||||
#endif
|
||||
|
||||
clear();
|
||||
|
||||
7
iqueue.h
7
iqueue.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -113,7 +114,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), queue_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(queue_full)))
|
||||
{
|
||||
new(&p_buffer[in]) T(value);
|
||||
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
|
||||
@ -133,7 +134,7 @@ namespace etl
|
||||
{
|
||||
const size_type next = in;
|
||||
|
||||
if (ETL_ASSERT(!full(), queue_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(queue_full)))
|
||||
{
|
||||
new(&p_buffer[in]) T();
|
||||
in = (in == (MAX_SIZE - 1)) ? 0 : in + 1;
|
||||
@ -165,7 +166,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void pop()
|
||||
{
|
||||
if ETL_ASSERT(!empty(), etl::queue_empty())
|
||||
if ETL_ASSERT(!empty(), ETL_ERROR(queue_empty))
|
||||
{
|
||||
p_buffer[out].~T();
|
||||
out = (out == (MAX_SIZE - 1)) ? 0 : out + 1;
|
||||
|
||||
7
iset.h
7
iset.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -632,7 +633,7 @@ namespace etl
|
||||
Node* inserted_node = nullptr;
|
||||
bool inserted = false;
|
||||
|
||||
if (ETL_ASSERT(!full(), set_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(set_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
@ -657,7 +658,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), set_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(set_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
@ -681,7 +682,7 @@ namespace etl
|
||||
// Default to no inserted node
|
||||
Node* inserted_node = nullptr;
|
||||
|
||||
if (ETL_ASSERT(!full(), set_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(set_full)))
|
||||
{
|
||||
// Get next available free node
|
||||
Data_Node& node = allocate_data_node(value);
|
||||
|
||||
5
istack.h
5
istack.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -85,7 +86,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!full(), stack_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(stack_full)))
|
||||
{
|
||||
top_index = current_size++;
|
||||
new(&p_buffer[top_index]) T(value);
|
||||
@ -101,7 +102,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
reference push()
|
||||
{
|
||||
if (ETL_ASSERT(!full(), stack_full()))
|
||||
if (ETL_ASSERT(!full(), ETL_ERROR(stack_full)))
|
||||
{
|
||||
top_index = current_size++;
|
||||
new(&p_buffer[top_index]) T();
|
||||
|
||||
25
ivector.h
25
ivector.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -192,7 +193,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
void resize(size_t new_size)
|
||||
{
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
// Size up or size down?
|
||||
if (new_size > current_size)
|
||||
@ -224,7 +225,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
void resize(size_t new_size, T value)
|
||||
{
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT(new_size <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
// Size up?
|
||||
if (new_size > current_size)
|
||||
@ -273,7 +274,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
reference at(size_t i)
|
||||
{
|
||||
ETL_ASSERT(i < current_size, vector_out_of_bounds());
|
||||
ETL_ASSERT(i < current_size, ETL_ERROR(vector_out_of_bounds));
|
||||
return p_buffer[i];
|
||||
}
|
||||
|
||||
@ -285,7 +286,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
const_reference at(size_t i) const
|
||||
{
|
||||
ETL_ASSERT(i < current_size, vector_out_of_bounds());
|
||||
ETL_ASSERT(i < current_size, ETL_ERROR(vector_out_of_bounds));
|
||||
return p_buffer[i];
|
||||
}
|
||||
|
||||
@ -355,8 +356,8 @@ namespace etl
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
difference_type count = std::distance(first, last);
|
||||
ETL_ASSERT(count >= 0, vector_iterator());
|
||||
ETL_ASSERT(static_cast<size_t>(count) <= MAX_SIZE, vector_full());
|
||||
ETL_ASSERT(count >= 0, ETL_ERROR(vector_iterator));
|
||||
ETL_ASSERT(static_cast<size_t>(count) <= MAX_SIZE, ETL_ERROR(vector_full));
|
||||
#endif
|
||||
|
||||
initialise();
|
||||
@ -379,7 +380,7 @@ namespace etl
|
||||
{
|
||||
initialise();
|
||||
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT(n <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
while (n > 0)
|
||||
{
|
||||
@ -403,7 +404,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void push_back()
|
||||
{
|
||||
if (ETL_ASSERT(current_size != MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT(current_size != MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
create_element();
|
||||
}
|
||||
@ -416,7 +417,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
void push_back(parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT(current_size != MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT(current_size != MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
create_element(value);
|
||||
}
|
||||
@ -442,7 +443,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
iterator insert(iterator position, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
create_element(value);
|
||||
|
||||
@ -465,7 +466,7 @@ namespace etl
|
||||
//*********************************************************************
|
||||
void insert(iterator position, size_t n, parameter_t value)
|
||||
{
|
||||
if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT((current_size) + 1 <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
if (position == end())
|
||||
{
|
||||
@ -528,7 +529,7 @@ namespace etl
|
||||
{
|
||||
size_t count = std::distance(first, last);
|
||||
|
||||
if (ETL_ASSERT((current_size) + count <= MAX_SIZE, vector_full()))
|
||||
if (ETL_ASSERT((current_size) + count <= MAX_SIZE, ETL_ERROR(vector_full)))
|
||||
{
|
||||
if (position == end())
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -107,7 +108,7 @@ namespace etl
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
|
||||
if (ETL_ASSERT(!is_finalised, hash_finalised()))
|
||||
if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)))
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@ -123,7 +124,7 @@ namespace etl
|
||||
//*************************************************************************
|
||||
void add(uint8_t value)
|
||||
{
|
||||
if (ETL_ASSERT(!is_finalised, hash_finalised()))
|
||||
if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)))
|
||||
{
|
||||
hash += value;
|
||||
hash += (hash << 10);
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
list.h
1
list.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
log.h
1
log.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
map.h
1
map.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -120,7 +121,7 @@ namespace etl
|
||||
{
|
||||
STATIC_ASSERT(sizeof(typename std::iterator_traits<TIterator>::value_type) == 1, "Incompatible type");
|
||||
|
||||
if (ETL_ASSERT(!is_finalised, hash_finalised()))
|
||||
if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)))
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
@ -146,7 +147,7 @@ namespace etl
|
||||
void add(uint8_t value)
|
||||
{
|
||||
// We can't add to a finalised hash!
|
||||
if (ETL_ASSERT(!is_finalised, hash_finalised()))
|
||||
if (ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)))
|
||||
{
|
||||
block |= value << (block_fill_count * 8);
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
16
observer.h
16
observer.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -55,6 +56,9 @@ SOFTWARE.
|
||||
#include "exception.h"
|
||||
#include "error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "18"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -65,8 +69,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
observer_exception(const char* what)
|
||||
: exception(what)
|
||||
observer_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -79,8 +83,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
observer_list_full()
|
||||
: observer_exception("observer: list full")
|
||||
observer_list_full(string_type file_name, numeric_type line_number)
|
||||
: observer_exception(ETL_ERROR_TEXT("observer:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -117,7 +121,7 @@ namespace etl
|
||||
if (i_observer == observer_list.end())
|
||||
{
|
||||
// Is there enough room?
|
||||
if (ETL_ASSERT(!observer_list.full(), etl::observer_list_full()))
|
||||
if (ETL_ASSERT(!observer_list.full(), ETL_ERROR(etl::observer_list_full)))
|
||||
{
|
||||
// Add it.
|
||||
observer_list.push_back(&observer);
|
||||
@ -340,4 +344,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
21
optional.h
21
optional.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -72,8 +73,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
optional_exception(const char* what)
|
||||
: exception(what)
|
||||
optional_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -86,8 +87,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
optional_invalid()
|
||||
: optional_exception("optional: invalid")
|
||||
optional_invalid(string_type file_name, numeric_type line_number)
|
||||
: optional_exception("optional: invalid", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -215,7 +216,7 @@ namespace etl
|
||||
T* operator ->()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_address<T>();
|
||||
@ -227,7 +228,7 @@ namespace etl
|
||||
const T* operator ->() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_address<T>();
|
||||
@ -239,7 +240,7 @@ namespace etl
|
||||
T& operator *()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_reference<T>();
|
||||
@ -251,7 +252,7 @@ namespace etl
|
||||
const T& operator *() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_reference<T>();
|
||||
@ -271,7 +272,7 @@ namespace etl
|
||||
T& value()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_reference<T>();
|
||||
@ -283,7 +284,7 @@ namespace etl
|
||||
const T& value() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
ETL_ASSERT(valid, optional_invalid());
|
||||
ETL_ASSERT(valid, ETL_ERROR(optional_invalid));
|
||||
#endif
|
||||
|
||||
return storage.template get_reference<T>();
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
pool.h
1
pool.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
1
power.h
1
power.h
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove, rlindeman
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -37,6 +38,10 @@ SOFTWARE.
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "1"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -48,8 +53,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
deque_exception(const char* what)
|
||||
: exception(what)
|
||||
deque_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -62,8 +67,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
deque_full()
|
||||
: deque_exception("deque: full")
|
||||
deque_full(string_type file_name, numeric_type line_number)
|
||||
: deque_exception(ETL_ERROR_TEXT("deque:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -76,8 +81,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
deque_empty()
|
||||
: deque_exception("deque: empty")
|
||||
deque_empty(string_type file_name, numeric_type line_number)
|
||||
: deque_exception(ETL_ERROR_TEXT("deque:empty", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -90,8 +95,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
deque_out_of_bounds()
|
||||
: deque_exception("deque: out of bounds")
|
||||
deque_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: deque_exception(ETL_ERROR_TEXT("deque:bounds", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -169,4 +174,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -40,6 +41,9 @@ SOFTWARE.
|
||||
#include "../ivector.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "2"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -50,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_map_exception(const char* what)
|
||||
: exception(what)
|
||||
flat_map_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -64,8 +68,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_map_full()
|
||||
: flat_map_exception("flat_map: full")
|
||||
flat_map_full(string_type file_name, numeric_type line_number)
|
||||
: flat_map_exception(ETL_ERROR_TEXT("flat_map: full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -78,8 +82,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_map_out_of_bounds()
|
||||
: flat_map_exception("flat_map: out of bounds")
|
||||
flat_map_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: flat_map_exception(ETL_ERROR_TEXT("flat_map:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -92,8 +96,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_map_iterator()
|
||||
: flat_map_exception("flat_map: iterator error")
|
||||
flat_map_iterator(string_type file_name, numeric_type line_number)
|
||||
: flat_map_exception(ETL_ERROR_TEXT("flat_map:iterator", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -176,4 +180,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -40,6 +41,9 @@ SOFTWARE.
|
||||
#include "../ivector.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "3"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -50,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multimap_exception(const char* what)
|
||||
: exception(what)
|
||||
flat_multimap_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -64,8 +68,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multimap_full()
|
||||
: flat_multimap_exception("flat_multimap: full")
|
||||
flat_multimap_full(string_type file_name, numeric_type line_number)
|
||||
: flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -78,8 +82,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multimap_out_of_bounds()
|
||||
: flat_multimap_exception("flat_multimap: out of bounds")
|
||||
flat_multimap_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -92,8 +96,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multimap_iterator()
|
||||
: flat_multimap_exception("flat_multimap: iterator error")
|
||||
flat_multimap_iterator(string_type file_name, numeric_type line_number)
|
||||
: flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:iterator", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -40,6 +41,9 @@ SOFTWARE.
|
||||
#include "../ivector.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "4"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -50,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multiset_exception(const char* what)
|
||||
: exception(what)
|
||||
flat_multiset_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -64,8 +68,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multiset_full()
|
||||
: flat_multiset_exception("flat_multiset: full")
|
||||
flat_multiset_full(string_type file_name, numeric_type line_number)
|
||||
: flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -78,8 +82,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multiset_out_of_bounds()
|
||||
: flat_multiset_exception("flat_multiset: out of bounds")
|
||||
flat_multiset_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -92,8 +96,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_multiset_iterator()
|
||||
: flat_multiset_exception("flat_multiset: iterator error")
|
||||
flat_multiset_iterator(string_type file_name, numeric_type line_number)
|
||||
: flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:iterator", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -176,4 +180,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove
|
||||
|
||||
@ -40,6 +41,9 @@ SOFTWARE.
|
||||
#include "../ivector.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "5"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
@ -50,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_set_exception(const char* what)
|
||||
: exception(what)
|
||||
flat_set_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -64,8 +68,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_set_full()
|
||||
: flat_set_exception("flat_set: full")
|
||||
flat_set_full(string_type file_name, numeric_type line_number)
|
||||
: flat_set_exception(ETL_ERROR_TEXT("flat_set:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -78,8 +82,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_set_out_of_bounds()
|
||||
: flat_set_exception("flat_set: out of bounds")
|
||||
flat_set_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: flat_set_exception(ETL_ERROR_TEXT("flat_set:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -92,8 +96,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
flat_set_iterator()
|
||||
: flat_set_exception("flat_set: iterator error")
|
||||
flat_set_iterator(string_type file_name, numeric_type line_number)
|
||||
: flat_set_exception(ETL_ERROR_TEXT("flat_set:iterator", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -176,4 +180,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -36,6 +37,10 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "6"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
forward_list_exception(const char* what)
|
||||
: exception(what)
|
||||
forward_list_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
forward_list_full()
|
||||
: forward_list_exception("forward list: full")
|
||||
forward_list_full(string_type file_name, numeric_type line_number)
|
||||
: forward_list_exception(ETL_ERROR_TEXT("forward_list:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
forward_list_iterator()
|
||||
: forward_list_exception("forward_list: iterator problem")
|
||||
forward_list_iterator(string_type file_name, numeric_type line_number)
|
||||
: forward_list_exception(ETL_ERROR_TEXT("forward_list:iterator", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -240,4 +245,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -36,6 +37,10 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "7"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
list_exception(const char* what)
|
||||
: exception(what)
|
||||
list_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
list_full()
|
||||
: list_exception("list: full")
|
||||
list_full(string_type file_name, numeric_type line_number)
|
||||
: list_exception(ETL_ERROR_TEXT("list:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
list_iterator()
|
||||
: list_exception("list: iterator problem")
|
||||
list_iterator(string_type file_name, numeric_type line_number)
|
||||
: list_exception(ETL_ERROR_TEXT("list:iterator", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -261,4 +266,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -36,6 +37,10 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "8"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
map_exception(const char* what)
|
||||
: exception(what)
|
||||
map_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
map_full()
|
||||
: map_exception("map: full")
|
||||
map_full(string_type file_name, numeric_type line_number)
|
||||
: map_exception("map:full", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
map_out_of_bounds()
|
||||
: map_exception("map: out of bounds")
|
||||
map_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: map_exception("map:bounds", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -89,8 +94,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
map_iterator()
|
||||
: map_exception("map: iterator problem")
|
||||
map_iterator(string_type file_name, numeric_type line_number)
|
||||
: map_exception("map:iterator", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -417,4 +422,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove, rlindeman
|
||||
|
||||
@ -36,6 +37,10 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "9"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multimap_exception(const char* what)
|
||||
: exception(what)
|
||||
multimap_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multimap_full()
|
||||
: multimap_exception("multimap: full")
|
||||
multimap_full(string_type file_name, numeric_type line_number)
|
||||
: multimap_exception("multimap:full", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multimap_out_of_bounds()
|
||||
: multimap_exception("multimap: out of bounds")
|
||||
multimap_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: multimap_exception("multimap:bounds", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -89,8 +94,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multimap_iterator()
|
||||
: multimap_exception("multimap: iterator problem")
|
||||
multimap_iterator(string_type file_name, numeric_type line_number)
|
||||
: multimap_exception("multimap:iterator", file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove, rlindeman
|
||||
|
||||
@ -36,6 +37,10 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "10"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multiset_exception(const char* what)
|
||||
: exception(what)
|
||||
multiset_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multiset_full()
|
||||
: multiset_exception("multiset: full")
|
||||
multiset_full(string_type file_name, numeric_type line_number)
|
||||
: multiset_exception(ETL_ERROR_TEXT("multiset:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multiset_out_of_bounds()
|
||||
: multiset_exception("multiset: out of bounds")
|
||||
multiset_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: multiset_exception(ETL_ERROR_TEXT("multiset:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -89,8 +94,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
multiset_iterator()
|
||||
: multiset_exception("multiset: iterator problem")
|
||||
multiset_iterator(string_type file_name, numeric_type line_number)
|
||||
: multiset_exception(ETL_ERROR_TEXT("multiset:iterator", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -577,4 +582,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -38,6 +39,10 @@ SOFTWARE.
|
||||
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "11"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -49,8 +54,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
pool_exception(const char* what)
|
||||
: exception(what)
|
||||
pool_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -62,8 +67,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
pool_no_allocation()
|
||||
: pool_exception("pool: no allocation")
|
||||
explicit pool_no_allocation(string_type file_name, numeric_type line_number)
|
||||
: pool_exception(ETL_ERROR_TEXT("pool:allocation", ETL_FILE"A"), file_name, line_number)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -75,8 +80,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
pool_object_not_in_pool()
|
||||
: pool_exception("pool: not in pool")
|
||||
pool_object_not_in_pool(string_type file_name, numeric_type line_number)
|
||||
: pool_exception(ETL_ERROR_TEXT("pool:notinpool", ETL_FILE"B"), file_name, line_number)
|
||||
{}
|
||||
};
|
||||
|
||||
@ -122,5 +127,8 @@ namespace etl
|
||||
const size_t MAX_SIZE; ///< The maximum number of objects that can be allocated.
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove, rlindeman
|
||||
|
||||
@ -37,6 +38,10 @@ SOFTWARE.
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "12"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -48,8 +53,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
priority_queue_exception(const char* what)
|
||||
: exception(what)
|
||||
priority_queue_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -62,8 +67,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
priority_queue_full()
|
||||
: priority_queue_exception("priority_queue: full")
|
||||
priority_queue_full(string_type file_name, numeric_type line_number)
|
||||
: priority_queue_exception(ETL_ERROR_TEXT("priority_queue:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -76,8 +81,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
priority_queue_iterator()
|
||||
: priority_queue_exception("priority_queue: iterator error")
|
||||
priority_queue_iterator(string_type file_name, numeric_type line_number)
|
||||
: priority_queue_exception(ETL_ERROR_TEXT("priority_queue:iterator", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -151,4 +156,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -37,6 +38,10 @@ SOFTWARE.
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#undef ETL_FILE
|
||||
#define ETL_FILE "13"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -48,8 +53,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
queue_exception(const char* what)
|
||||
: exception(what)
|
||||
queue_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -62,8 +67,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
queue_full()
|
||||
: queue_exception("queue: full")
|
||||
queue_full(string_type file_name, numeric_type line_number)
|
||||
: queue_exception(ETL_ERROR_TEXT("queue:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -76,8 +81,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
queue_empty()
|
||||
: queue_exception("queue: empty")
|
||||
queue_empty(string_type file_name, numeric_type line_number)
|
||||
: queue_exception(ETL_ERROR_TEXT("queue:empty", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -155,4 +160,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2015 jwellbelove, rlindeman
|
||||
|
||||
@ -36,6 +37,9 @@ SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#define ETL_FILE "14"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -47,8 +51,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
set_exception(const char* what)
|
||||
: exception(what)
|
||||
set_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -61,8 +65,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
set_full()
|
||||
: set_exception("set: full")
|
||||
set_full(string_type file_name, numeric_type line_number)
|
||||
: set_exception(ETL_ERROR_TEXT("set:full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -75,8 +79,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
set_out_of_bounds()
|
||||
: set_exception("set: out of bounds")
|
||||
set_out_of_bounds(string_type file_name, numeric_type line_number)
|
||||
: set_exception(ETL_ERROR_TEXT("set:bounds", ETL_FILE"B"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -89,8 +93,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
set_iterator()
|
||||
: set_exception("set: iterator problem")
|
||||
set_iterator(string_type file_name, numeric_type line_number)
|
||||
: set_exception(ETL_ERROR_TEXT("set:iterator problem", ETL_FILE"C"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -418,4 +422,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#endif
|
||||
|
||||
@ -5,6 +5,7 @@ The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
http://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2014 jwellbelove
|
||||
|
||||
@ -37,6 +38,9 @@ SOFTWARE.
|
||||
#include <stddef.h>
|
||||
|
||||
#include "../exception.h"
|
||||
#include "../error_handler.h"
|
||||
|
||||
#define ETL_FILE "15"
|
||||
|
||||
namespace etl
|
||||
{
|
||||
@ -48,8 +52,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
stack_exception(const char* what)
|
||||
: exception(what)
|
||||
stack_exception(string_type what, string_type file_name, numeric_type line_number)
|
||||
: exception(what, file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -62,8 +66,8 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
stack_full()
|
||||
: stack_exception("stack: full")
|
||||
stack_full(string_type file_name, numeric_type line_number)
|
||||
: stack_exception(ETL_ERROR_TEXT("stack: full", ETL_FILE"A"), file_name, line_number)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -140,4 +144,6 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#undef ETL_FILE
|
||||
|
||||
#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