로딩중...
검색중...
일치하는것 없음
tbaseConvergence.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
8
9namespace by {
10
11 template <typename T> struct ConvergenceClosure {
12 typedef std::function<nbool(const T&)> is;
13 };
14
15 template <> struct ConvergenceClosure<void> {
16 typedef std::function<nbool()> is;
17 };
18
19 template <typename T> class tbaseConvergence: public baseConvergence {
21
22 protected:
23 using onConverge = typename ConvergenceClosure<T>::is;
24
25 public:
27 _obj(obj), _func(func), _onConverge(closure) {}
28
29 public:
46 nbool converge() override {
47 WHEN(!_obj) .ret(false);
48 baseFunc& fun = _func OR.ret(false);
49
52 return convergeWithoutFrame();
53 }
54
55 baseFunc& getFunc() { return *_func; }
56
57 const baseFunc& getFunc() const BY_CONST_FUNC(getFunc());
58
59 baseObj& getObj() { return *_obj; }
60
61 const baseObj& getObj() const BY_CONST_FUNC(getObj());
62
63 protected:
64 onConverge _getClosure() { return _onConverge; }
65
66 private:
67 tstr<baseObj> _obj;
68 tstr<baseFunc> _func;
69 onConverge _onConverge;
70 };
71} // namespace by
Base class for convergence algorithms
Definition baseConvergence.hpp:11
Base class for all function types
Definition baseFunc.hpp:41
Base class for representing byeol objects
Definition baseObj.hpp:73
func closure with captured object scope
Definition closure.hpp:20
Definition frameInteract.hpp:8
Function definition in byeol language
Definition func.hpp:38
Byeol runtime environment object
Definition obj.hpp:62
Definition tbaseConvergence.hpp:19
nbool converge() override
Definition tbaseConvergence.hpp:46
Definition tnarr.hpp:9
Definition tbaseConvergence.hpp:11
to Top