template <typename CharT, ::std::size_t kBits>

struct MemoryAccessor

Defined at line 73 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_memory_util.h

The least-aligned case for MemoryAccessor is 8-bit alignment, and the default

version of MemoryAccessor will devolve to this one if there is no more

specific override.

If the system byte order is known, then these routines can use memcpy and

(possibly) a byte swap; otherwise they can read individual bytes and

shift+or them together in the appropriate order. I (bolms

@

) haven't found a

compiler that will optimize the multiple reads, shifts, and ors into a single

read, so the memcpy version is *much* faster for 32-bit and larger reads.

Public Methods

Unsigned ReadLittleEndianUInt (const CharT * bytes)

Defined at line 83 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_memory_util.h

void WriteLittleEndianUInt (CharT * bytes, Unsigned value)

Defined at line 101 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_memory_util.h

Unsigned ReadBigEndianUInt (const CharT * bytes)

Defined at line 119 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_memory_util.h

void WriteBigEndianUInt (CharT * bytes, Unsigned value)

Defined at line 181 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_memory_util.h