Cogs.Core
Public Member Functions | Public Attributes | Private Attributes | List of all members
Cogs::Core::MappedStreamReadOnly< Element > Struct Template Referencefinal

Wrapper for read-only access to mapped stream data. More...

#include <Mesh.h>

Public Member Functions

 MappedStreamReadOnly (struct Mesh *mesh, const Element *data, VertexDataType::EVertexDataType type)
 Constructs a MappedStreamReadOnly from the given mesh for readonly access to the mesh stream.
 
bool isValid () const
 Returns true if stream mapping successful.
 
constexpr const Element & operator[] (const size_t index) const
 Access the Element at the given index.
 
VertexDataType::EVertexDataType getDataType () const
 

Public Attributes

const Element * data = nullptr
 Pointer to the element data mapped from the Mesh data stream.
 

Private Attributes

struct Meshmesh = nullptr
 Pointer to the mapped mesh.
 
VertexDataType::EVertexDataType type = VertexDataType::EVertexDataType::Reserved
 Type index of the mesh data stream.
 

Detailed Description

template<typename Element>
struct Cogs::Core::MappedStreamReadOnly< Element >

Wrapper for read-only access to mapped stream data.

Template Parameters
Typeof elements contained in the stream, e.g glm::vec3 for position data.

Definition at line 196 of file Mesh.h.

Constructor & Destructor Documentation

◆ MappedStreamReadOnly()

template<typename Element >
Cogs::Core::MappedStreamReadOnly< Element >::MappedStreamReadOnly ( struct Mesh mesh,
const Element *  data,
VertexDataType::EVertexDataType  type 
)
inline

Constructs a MappedStreamReadOnly from the given mesh for readonly access to the mesh stream.

Parameters
meshMesh resource the data is mapped from. Notified when this wrapper is destructed that the mapped data is done being modified.
dataPointer to the mapped mesh data stream.
typeIndex of the vertex data stream in the Mesh.

Definition at line 208 of file Mesh.h.

Member Function Documentation

◆ getDataType()

template<typename Element >
VertexDataType::EVertexDataType Cogs::Core::MappedStreamReadOnly< Element >::getDataType ( ) const
inline

Definition at line 227 of file Mesh.h.

◆ isValid()

template<typename Element >
bool Cogs::Core::MappedStreamReadOnly< Element >::isValid ( ) const
inline

Returns true if stream mapping successful.

Definition at line 212 of file Mesh.h.

Referenced by Cogs::Core::generateMeshTangents().

◆ operator[]()

template<typename Element >
constexpr const Element & Cogs::Core::MappedStreamReadOnly< Element >::operator[] ( const size_t  index) const
inlineconstexpr

Access the Element at the given index.

Parameters
indexIndex of the element to access. Must be inside the range [start, start + count) given to Mesh::map().
Returns
A const reference to the element instance at index.

Definition at line 222 of file Mesh.h.

Member Data Documentation

◆ data

template<typename Element >
const Element* Cogs::Core::MappedStreamReadOnly< Element >::data = nullptr

Pointer to the element data mapped from the Mesh data stream.

Definition at line 230 of file Mesh.h.

◆ mesh

template<typename Element >
struct Mesh* Cogs::Core::MappedStreamReadOnly< Element >::mesh = nullptr
private

Pointer to the mapped mesh.

Definition at line 234 of file Mesh.h.

◆ type

template<typename Element >
VertexDataType::EVertexDataType Cogs::Core::MappedStreamReadOnly< Element >::type = VertexDataType::EVertexDataType::Reserved
private

Type index of the mesh data stream.

Definition at line 237 of file Mesh.h.


The documentation for this struct was generated from the following file: