tarrayable.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/common.hpp"
5#include "core/type/ntype.hpp"
6
7namespace by {
8
10 template <typename T, typename R = T*, typename RSquare = T&> class tarrayable {
11 BY_ME(tarrayable)
12
13 public:
14 virtual ~tarrayable() {}
15
16 // operator:
17 virtual RSquare operator[](nidx n) = 0;
18
19 const RSquare operator[](nidx n) const BY_CONST_FUNC(operator[](n))
20
21 // in:
22 virtual nbool in(nidx n) const = 0;
23
24 // get:
25 virtual R get(nidx n) = 0;
26 const R get(nidx n) const BY_CONST_FUNC(get(n))
27
28 // set:
29 virtual nbool set(nidx n, const T& new1) = 0;
30 nbool set(nidx n, const T* new1) BY_SIDE_FUNC(new1, set(n, *new1), false);
31
32 // add:
34 virtual nbool add(nidx n, const T& new1) = 0;
35 nbool add(nidx n, const T* new1) BY_SIDE_FUNC(new1, add(n, *new1), false);
36
37 // del:
40 virtual nbool del(nidx n) = 0;
41 };
42} // namespace by
Definition: tarrayable.hpp:10
virtual nbool del(nidx n)=0
virtual nbool add(nidx n, const T &new1)=0