template <class Parameters, class BitViewType>
class UIntView
Defined at line 145 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
UIntView is a view for UInts inside of bitfields.
Public Methods
template <typename... Args>
void UIntView<Parameters, BitViewType> (Args &&... args)
Defined at line 155 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
void UIntView<Parameters, BitViewType> ()
Defined at line 156 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
void UIntView<Parameters, BitViewType> (const UIntView<Parameters, BitViewType> & )
Defined at line 157 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
void UIntView<Parameters, BitViewType> (UIntView<Parameters, BitViewType> && )
Defined at line 158 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
UIntView<Parameters, BitViewType> & operator= (const UIntView<Parameters, BitViewType> & )
Defined at line 159 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
UIntView<Parameters, BitViewType> & operator= (UIntView<Parameters, BitViewType> && )
Defined at line 160 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
void ~UIntView<Parameters, BitViewType> ()
Defined at line 161 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
ValueType Read ()
Defined at line 163 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
ValueType UncheckedRead ()
Defined at line 168 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename IntT, typename = typename ::std::enable_if<
(::std::numeric_limits<typename ::std::remove_cv<
typename ::std::remove_reference<IntT>::type>::type>::
is_integer &&
!::std::is_same<bool, typename ::std::remove_cv<
typename ::std::remove_reference<
IntT>::type>::type>::value) ||
::std::is_enum<IntT>::value>::type>
void Write (IntT value)
The Write, TryToWrite, and CouldWriteValue methods are templated in order
to avoid surprises due to implicit narrowing.
In C++, you can pass (say) an `int` to a function expecting `uint8_t`, and
the compiler will silently cast the `int` to `uint8_t`, which can change
the value. Even with fairly aggressive warnings, something like this will
silently compile, and print `256 is not >= 128!`:
bool is_big_uint8(uint8_t value) { return value >= 128; }
bool is_big(uint32_t value) { return is_big_uint8(value); }
int main() {
assert(!is_big(256)); // big is truncated to 0.
std::cout
<
<
256
<
<
" is not >= 128!\n";
return 0;
}
(Most compilers will give a warning when directly passing a *constant* that
gets truncated; for example, GCC will throw -Woverflow on
`is_big_uint8(256U)`.)
Defined at line 198 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename IntT, typename = typename ::std::enable_if<
(::std::numeric_limits<typename ::std::remove_cv<
typename ::std::remove_reference<IntT>::type>::type>::
is_integer &&
!::std::is_same<bool, typename ::std::remove_cv<
typename ::std::remove_reference<
IntT>::type>::type>::value) ||
::std::is_enum<IntT>::value>::type>
bool TryToWrite (IntT value)
Defined at line 213 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename IntT, typename = typename ::std::enable_if<
(::std::numeric_limits<typename ::std::remove_cv<
typename ::std::remove_reference<IntT>::type>::type>::
is_integer &&
!::std::is_same<bool, typename ::std::remove_cv<
typename ::std::remove_reference<
IntT>::type>::type>::value) ||
::std::is_enum<IntT>::value>::type>
bool CouldWriteValue (IntT value)
Defined at line 229 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
void UncheckedWrite (ValueType value)
Defined at line 272 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename OtherView>
void CopyFrom (const OtherView & other)
Defined at line 277 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename OtherView>
void UncheckedCopyFrom (const OtherView & other)
Defined at line 281 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <typename OtherView>
bool TryToCopyFrom (const OtherView & other)
Defined at line 285 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
bool Ok ()
All bit patterns in the underlying buffer are valid, so Ok() is always
true if IsComplete() is true.
Defined at line 291 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <class OtherBitViewType>
bool Equals (const UIntView<Parameters, OtherBitViewType> & other)
Defined at line 295 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <class OtherBitViewType>
bool UncheckedEquals (const UIntView<Parameters, OtherBitViewType> & other)
Defined at line 299 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
bool IsComplete ()
Defined at line 303 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <class Stream>
bool UpdateFromTextStream (Stream * stream)
Defined at line 308 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
template <class Stream>
void WriteToTextStream (Stream * stream, ::emboss::TextOutputOptions & options)
Defined at line 313 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
bool IsAggregate ()
Defined at line 318 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h
int SizeInBits ()
Defined at line 320 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_prelude.h