로딩중...
검색중...
일치하는것 없음
stela.hpp
이 파일의 문서화 페이지로 가기
1
2#pragma once
3
4#include "stela/common.hpp"
5
6namespace by {
7
62 class stelaVisitor;
64
65 class _nout stela: public instance {
66 BY(ADT(stela, instance))
67
68 typedef std::map<std::string, tstr<me>> myMap;
69 typedef myMap::iterator iterator;
70
71 public:
77 stela(std::initializer_list<me*> subs, const std::string& name = "");
78 stela(const me& rhs, const std::string& name = "");
79 stela(const std::string& name = "");
80
81 public:
82 me& operator[](const std::string& name);
83 const me& operator[](const std::string& name) const BY_CONST_FUNC(operator[](name));
84 me& operator[](const nchar* name);
85 const me& operator[](const nchar* name) const BY_CONST_FUNC(operator[](name));
90 explicit operator nbool() const;
91
92 public:
93 me& sub(const std::string& name);
94 me& sub(const std::string* it) BY_SIDE_FUNC(it, sub(*it), *this);
95 const me& sub(const std::string& name) const BY_CONST_FUNC(sub(name))
96 const me& sub(const std::string* name) const BY_CONST_FUNC(sub(name))
97 me& sub(const nchar* name);
98 const me& sub(const nchar* name) const BY_CONST_FUNC(sub(name))
99 me& sub(nidx n);
100 const me& sub(nidx n) const BY_CONST_FUNC(sub(n))
101
102 nbool has(const std::string& name) const;
103 nbool has(const std::string* it) const BY_SIDE_FUNC(has);
104
109 void add(const stela& it);
114 void add(const stela* it) BY_SIDE_FUNC(add);
119 void add(std::initializer_list<stela*> subs);
120 void del(const stela& it);
121 void del(const stela* it) BY_SIDE_FUNC(del);
122 void del(const std::string& name);
123 void del(const std::string* it) BY_SIDE_FUNC(del);
124 void del(const nchar* name);
125
126 const std::string& getName() const;
127 void setName(const std::string& newName);
128 void setName(const std::string* it) BY_SIDE_FUNC(setName);
129 void setName(const nchar* newName);
130
131 ncnt len() const;
132
133 iterator begin();
134 iterator end();
135
142 virtual nint asInt() const;
149 virtual nchar asChar() const;
155 virtual const std::string& asStr() const;
162 virtual nbool asBool() const;
167 virtual nbool isExist() const;
168
169 public:
172 virtual void accept(const stelaVisitInfo& i, stelaVisitor& v);
173
174 private:
175 myMap _subs;
176 std::string _name;
177 };
178} // namespace by
Deferred execution utility similar to defer keyword in other languages
Definition end.hpp:36
Base class for all managed instances in memlite system
Definition instance.hpp:41
Definition stela.hpp:63
Traversal context handed to every stelaVisitor callback.
Definition stelaVisitInfo.hpp:17
Preorder visitor for the stela AST.
Definition stelaVisitor.hpp:30
Weak reference smart pointer with type-safe access
Definition tweak.hpp:16
#define BY_SIDE_FUNC(...)
Side function macros for safe pointer operations
Definition sideFunc.hpp:24
to Top