aboutsummaryrefslogtreecommitdiff
path: root/include/DataView.hpp
blob: d4200c5b1a55e7cd91fd3af1973eeb68056f3c18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "types.hpp"

namespace amalgine
{
    template <typename T>
    class DataView
    {
    public:
        DataView() : data(nullptr), size(0) {}
        
        DataView(T *_data, usize _size) : data(_data), size(_size)
        {
            
        }
        
        usize getByteSize() const
        {
            return size * sizeof(T);
        }
    
        T *data;
        usize size;
    };

    using StringView = DataView<char>;
}