31#ifndef ETL_NOT_NULL_INCLUDED
32#define ETL_NOT_NULL_INCLUDED
49 not_null_exception(string_type reason_, string_type file_name_, numeric_type line_number_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
50 :
exception(reason_, file_name_, line_number_)
58 class not_null_contains_null :
public not_null_exception
62 not_null_contains_null(string_type file_name_, numeric_type line_number_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
63 : not_null_exception(ETL_ERROR_TEXT(
"not_null:contains null", ETL_NOT_NULL_FILE_ID
"A"), file_name_, line_number_)
86 typedef const T* const_pointer;
88 typedef const T& const_reference;
89 typedef pointer underlying_type;
95 ETL_CONSTEXPR14
explicit not_null(underlying_type ptr_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
113 ETL_CONSTEXPR14
not_null&
operator=(underlying_type rhs) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
135 ETL_CONSTEXPR14 pointer
get() const ETL_NOEXCEPT
143 ETL_CONSTEXPR14
operator pointer() const ETL_NOEXCEPT
151 ETL_CONSTEXPR14 reference
operator*() const ETL_NOEXCEPT
174 template <
typename T,
typename TDeleter>
184 typedef T value_type;
186 typedef const T* const_pointer;
187 typedef T& reference;
188 typedef const T& const_reference;
196 ETL_CONSTEXPR14
explicit not_null(underlying_type&& u_ptr_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
197 : u_ptr(etl::move(u_ptr_))
207 ETL_CONSTEXPR14 not_null& operator=(underlying_type&& rhs) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
211 u_ptr = etl::move(rhs);
220 ETL_CONSTEXPR14 pointer
get() const ETL_NOEXCEPT
228 ETL_CONSTEXPR14
operator pointer() const ETL_NOEXCEPT
236 ETL_CONSTEXPR14 reference
operator*() const ETL_NOEXCEPT
251 ETL_CONSTEXPR14
explicit not_null(
const this_type& u_ptr_) ETL_NOEXCEPT ETL_DELETE;
252 ETL_CONSTEXPR14
not_null& operator=(
const this_type& rhs) ETL_NOEXCEPT ETL_DELETE;
255 ETL_CONSTEXPR14
explicit not_null(this_type&& u_ptr_) ETL_NOEXCEPT =
delete;
256 ETL_CONSTEXPR14
not_null& operator=(this_type&& rhs) ETL_NOEXCEPT =
delete;
260 underlying_type u_ptr;
ETL_CONSTEXPR14 not_null(underlying_type ptr_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
Definition not_null.h:95
ETL_CONSTEXPR14 not_null(const etl::not_null< T * > &other) ETL_NOEXCEPT
Copy construct from a not_null pointer.
Definition not_null.h:104
ETL_CONSTEXPR14 pointer get() const ETL_NOEXCEPT
Gets the underlying pointer.
Definition not_null.h:135
ETL_CONSTEXPR14 not_null & operator=(const etl::not_null< T * > &rhs) ETL_NOEXCEPT
Assignment from a not_null.
Definition not_null.h:125
ETL_CONSTEXPR14 pointer operator->() const ETL_NOEXCEPT
Arrow operator.
Definition not_null.h:159
ETL_CONSTEXPR14 reference operator*() const ETL_NOEXCEPT
Dereference operator.
Definition not_null.h:151
ETL_CONSTEXPR14 not_null & operator=(underlying_type rhs) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
Definition not_null.h:113
ETL_CONSTEXPR14 pointer operator->() const ETL_NOEXCEPT
Arrow operator.
Definition not_null.h:244
ETL_CONSTEXPR14 pointer get() const ETL_NOEXCEPT
Gets the underlying ptr.
Definition not_null.h:220
ETL_CONSTEXPR14 reference operator*() const ETL_NOEXCEPT
Dereference operator.
Definition not_null.h:236
The exception when the not_null contains a null.
Definition not_null.h:59
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81