Loading...
Searching...
No Matches
nseq.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/node.hpp"
8
9namespace by {
10
16 class _nout nseq: public tnucontainer<nInt, nInt, nInt>, public tarrayable<nInt, nInt, nInt> {
18 BY(CLASS(nseq, _super3))
19 friend class seq; // for redirection to `_onMakeIteration()`
20
21 public:
23
24 public:
25 nseq(const nInt& start, const nInt& end);
26 nseq(const nInt& start, const nInt& end, const nInt& step);
27
28 public:
29 using tarrayable<nInt, nInt, nInt>::operator[];
30 nInt operator[](nidx n) override;
31
32 public:
33 const nInt& getStart() const;
34 const nInt& getEnd() const;
35 const nInt& getStep() const;
36
37 ncnt len() const override;
38
39 void rel() override;
40
41 using super::get;
42 nInt get(nidx n) override;
43
44 using super::in;
45 nbool in(nidx n) const override;
46
47 protected:
48 iteration* _onMakeIteration(ncnt step, nbool isReversed) const override;
49
50 private:
51 // these method has been prohibited.
52 using super::add;
53 using tarrayable<nInt, nInt, nInt>::add;
54 nbool add(const iter& at, const nInt& new1) override;
55 void add(const iter& at, const iter& from, const iter& to) override;
56 nbool add(nidx n, const nInt& new1) override;
57
58 using super::set;
59 using tarrayable<nInt, nInt, nInt>::set;
60 nbool set(const iter& at, const nInt& new1) override;
61 nbool set(nidx n, const nInt& new1) override;
62
63 using super::del;
64 using tarrayable<nInt, nInt, nInt>::del;
65 nbool del(const iter& it) override;
66 nbool del(const iter& from, const iter& end) override;
67 nbool del(nidx n) override;
68
69 void _updateStep();
70
71 private:
72 nInt _start;
73 nInt _end;
74 nInt _step;
75 };
76} // namespace by
Integer primitive type in byeol language.
Definition nInt.hpp:13
Native sequence container for integer ranges.
Definition nseq.hpp:16
scripted sequence container for integer ranges
Definition seq.hpp:17
Definition tarrayable.hpp:11
Definition tnarr.hpp:9
Definition tnucontainer.hpp:9
Bidirectional iterator for key-value containers.
Definition biter.hpp:10
Definition biteration.hpp:5
to Top