CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
MemoryView.hpp File Reference
#include "CeresEngine/DataTypes.hpp"
#include "CeresEngine/Macros.hpp"
#include "CeresEngine/Foundation/String.hpp"
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <iterator>
#include <cassert>

Go to the source code of this file.

Classes

class  CeresEngine::MemoryView< T >
 A memory view is a class which attaches to an chunk of memory and provides a view to it (optionally changing its type) with a Vector-like interface, excluding the methods which change a vector's size. More...
 
class  CeresEngine::StridedMemoryView< T >
 A memory view is a class which attaches to an chunk of memory and provides a view to it (optionally changing its type) with a Vector-like interface, excluding the methods which change a vector's size. More...
 
class  CeresEngine::StridedMemoryView< T >::IteratorImpl< IsConstIterator >
 

Namespaces

namespace  CeresEngine
 
namespace  CeresEngine::internal
 
namespace  CeresEngine::impl
 Helper functions for comparing iterators.
 

Macros

#define CE_MEMORY_VIEW_BOUNDS_CHECK(i)   CE_ASSERT((i) < this->size())
 

Typedefs

using CeresEngine::ByteMemoryView = MemoryView< Byte >
 A memory view that views elements as raw-bytes.
 
using CeresEngine::ByteStridedMemoryView = StridedMemoryView< Byte >
 A strided memory view that views elements as raw-bytes.
 

Functions

String CeresEngine::internal::memoryViewHexdump (const MemoryView< Byte > &memoryView)
 
void CeresEngine::internal::memoryViewHexdump (const MemoryView< Byte > &memoryView, std::ostream &stream)
 
String CeresEngine::internal::memoryViewToHex (const MemoryView< Byte > &memoryView)
 
void CeresEngine::internal::memoryViewToHex (const MemoryView< Byte > &memoryView, std::ostream &stream)
 
template<typename T >
MemoryView< TCeresEngine::make_memory_view (T *ptr, size_t size)
 Makes a new memory from a raw pointer and length.
 
template<typename T >
MemoryView< const TCeresEngine::make_memory_view (const T *ptr, size_t size)
 Makes a new memory from a raw pointer and length.
 
template<typename T , size_t N>
MemoryView< TCeresEngine::make_memory_view (T(&array)[N])
 Makes a new memory view from a C-style array.
 
template<typename Container >
MemoryView< typename Container::value_type > CeresEngine::make_memory_view (Container &container, size_t offset=0)
 Makes a new memory view from an STL-compatible Vector-like container.
 
template<typename Container >
MemoryView< const typename Container::value_type > CeresEngine::make_memory_view (const Container &c, size_t offset=0)
 Makes a new memory view from an STL-compatible Vector-like container.
 
template<typename T >
TCeresEngine::impl::advanceBytes (T *pointer, std::ptrdiff_t bytes)
 Utility function that advances a pointer by a fixed number of bytes, independent of the size of T.
 
template<typename T >
StridedMemoryView< TCeresEngine::make_strided_memory_view (T *ptr, size_t size, size_t stride=StridedMemoryView< T >::defaultStride)
 Makes a new strided memory from a raw pointer and length.
 
template<typename T >
StridedMemoryView< const TCeresEngine::make_strided_memory_view (const T *ptr, size_t size, size_t stride=StridedMemoryView< T >::defaultStride)
 Makes a new strided memory from a raw pointer and length.
 
template<typename T , size_t N>
StridedMemoryView< const TCeresEngine::make_strided_memory_view (const T(&ar)[N])
 Makes a new strided memory view from a C-style array.
 
template<typename Container >
StridedMemoryView< typename Container::value_type > CeresEngine::make_strided_memory_view (Container &container, size_t offset=0)
 Makes a new memory view from an STL-compatible Vector-like container.
 
template<typename Container >
StridedMemoryView< const typename Container::value_type > CeresEngine::make_strided_memory_view (const Container &container, size_t offset=0)
 Makes a new memory view from an STL-compatible Vector-like container.
 

Macro Definition Documentation

◆ CE_MEMORY_VIEW_BOUNDS_CHECK

#define CE_MEMORY_VIEW_BOUNDS_CHECK (   i)    CE_ASSERT((i) < this->size())