10 template <
typename K,
typename V,
typename _defaultContainer = tnmap<K, V>>
17 typedef typename super::iter
iter;
18 typedef typename super::iteration
iteration;
20 typedef _defaultContainer defaultContainer;
27 explicit tnchain(std::initializer_list<std::pair<K, V*>> elems);
32 nbool in(
const K& key)
const override;
35 ncnt len()
const override;
36 ncnt chainLen()
const;
39 V* get(
const K& key)
override;
43 nbool add(
const K& key,
const V& val)
override;
58 nbool
link(
const me& new1);
59 nbool
link(
const me* it) BY_SIDE_FUNC(
link);
65 nbool
del(
const K& key)
override;
66 nbool
del(
const iter& at)
override;
72 super& getContainer();
73 const super& getContainer()
const;
76 const me* getNext() const BY_CONST_FUNC(getNext())
88 void onCloneDeep(const
clonable& from) override;
95 template <typename T> static T*
wrap(const super& toShallowWrap) {
96 T* ret = (T*) toShallowWrap.template cast<T>();
99 ret->_map.bind(toShallowWrap);
105 template <
typename T>
static T*
wrap(
const super* it) BY_SIDE_FUNC(it, wrap<T>(*it),
nullptr);
107 static me*
wrap(
const super& toShallowWrap);
108 static me*
wrap(
const super* it) BY_SIDE_FUNC(
wrap);
121 iteration* _onMakeIteration(
const K* key, nbool isReversed, ncnt step, nbool isBoundary)
const override;
123 void _getAll(
const K& key,
narr& tray)
const override;
126 iter* _getInnerIter(
const iter& wrapper);
127 iter _getInnerBeginOfChain(me& it,
const me& fromChain,
const iter& from);
128 iter _getInnerEndOfChain(me& it,
const me& lastChain,
const iter& last);
129 iter _rendOfThisChain(nbool isReversed);
131 void _eachChain(std::function<
void(me&)>
closure);
Managed array container for byeol language.
Definition: arr.hpp:14
Interface for objects that can be cloned.
Definition: clonable.hpp:12
func closure with captured object scope
Definition: closure.hpp:19
Deferred execution utility like defer keyword in other languages.
Definition: end.hpp:14
Definition: tnbicontainer.hpp:8
Definition: tnchain.hpp:11
static T * wrap(const super &toShallowWrap)
Definition: tnchain.hpp:95
const me * getPrev() const BY_CONST_FUNC(getPrev()) me *getTail()
return most not null next element of this chain.
virtual nbool link(const iter &portion)
link to another chain instance. if iterator is not the begin of another chain, this chain won't link ...
me * cloneChain() const
mock all of this chain until 'next' is null.
const me * getTail() const BY_CONST_FUNC(getTail()) void onCloneDeep(const clonable &from) override
nbool del(const K &key) override
delete all elements matching by given key.
me * cloneChain(const super *until) const
Strong reference smart pointer with strict type checking.
Definition: tstr.hpp:13
Bidirectional iterator for key-value containers.
Definition: biter.hpp:9
Definition: biteration.hpp:5
Definition: nchainIteration.hpp:7
ncnt next(ncnt step) override
Definition: nchainIteration.hpp:40
Chain iteration implementation.