Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
ArrayBase.hpp
1// INFINITY_API_PUBLIC
2
3#pragma once
4
5#include <Infinity/Types/Core/Data.hpp>
6
7#include <memory>
8
10{
71 class INFINITY_API_TEMPLATE ArrayBase : public Core::Data
72 {
73 public:
74 ArrayBase() : Data()
75 { }
76
77 ArrayBase(const ArrayBase& other) : Data(other)
78 { }
79
85 virtual ~ArrayBase() = default;
86
105
118 virtual void* pointer(size_t index) = 0;
119
131 virtual const void* pointer(size_t index) const = 0;
132
149 virtual bool containsData() const = 0;
150
167 virtual bool containsValues() const = 0;
168
186 virtual std::shared_ptr<Core::Data> dataAt(size_t index) = 0;
187
200 virtual std::shared_ptr<const Core::Data> dataAt(size_t index) const = 0;
201
218 virtual void setData(size_t index, const Core::Data& data) = 0;
219
231 virtual void resize(size_t newSize) = 0;
232
252 virtual size_t dimensions() const noexcept = 0;
253
262 virtual size_t size() const noexcept = 0;
263 };
264}
Abstract base class for all array container types in the Infinity type system.
Definition ArrayBase.hpp:72
ArrayBase(const ArrayBase &other)
Definition ArrayBase.hpp:77
virtual const void * pointer(size_t index) const =0
Gets a const type-erased pointer to the element at the specified index.
virtual ~ArrayBase()=default
Virtual destructor.
virtual size_t dimensions() const noexcept=0
Gets the number of dimensions in this array container.
virtual void setData(size_t index, const Core::Data &data)=0
Sets an element from type-erased Data.
virtual bool containsValues() const =0
Checks if the array contains plain value (POD) types.
virtual void * pointer(size_t index)=0
Gets a type-erased pointer to the element at the specified index.
virtual bool containsData() const =0
Checks if the array contains Core::Data-derived types.
virtual void resize(size_t newSize)=0
Resizes the array to contain the specified number of elements.
virtual std::shared_ptr< const Core::Data > dataAt(size_t index) const =0
Gets a const type-erased Data pointer to the element at the specified index.
ArrayBase()
Definition ArrayBase.hpp:74
virtual std::shared_ptr< Core::Data > dataAt(size_t index)=0
Gets a type-erased Data pointer to the element at the specified index.
virtual const Infinity::Types::TypeID & elementTypeId()=0
Gets the TypeID of the element type contained in this array.
Base class for complex data types with memory wrapping and property support.
Definition Data.hpp:49
Definition Array.hpp:25
Runtime type identifier for the Infinity type system.
Definition TypeID.hpp:71