31 using iterator =
typename std::vector<Argument<Base> >::iterator;
32 using const_iterator =
typename std::vector<Argument<Base> >::const_iterator;
33 using const_reverse_iterator =
typename std::vector<Argument<Base> >::const_reverse_iterator;
34 using reverse_iterator =
typename std::vector<Argument<Base> >::reverse_iterator;
36 static const std::set<CGOpCode> CUSTOM_NODE_CLASS;
50 std::vector<size_t> info_;
56 std::vector<Argument<Base> > arguments_;
64 std::unique_ptr<std::string> name_;
71 CPPADCG_ASSERT_UNKNOWN(CUSTOM_NODE_CLASS.find(operation_) == CUSTOM_NODE_CLASS.end());
73 operation_ = CGOpCode::Alias;
75 arguments_[0] =
other;
106 CPPADCG_ASSERT_UNKNOWN(
op == operation_ || CUSTOM_NODE_CLASS.find(
op) == CUSTOM_NODE_CLASS.end());
109 arguments_ = arguments;
134 inline const std::vector<size_t>&
getInfo()
const {
159 inline void setName(
const std::string& name) {
160 if (name_ !=
nullptr)
163 name_.reset(
new std::string(name));
187 inline iterator begin() {
188 return arguments_.begin();
191 inline const_iterator begin()
const {
192 return arguments_.begin();
195 inline iterator end() {
196 return arguments_.end();
199 inline const_iterator end()
const {
200 return arguments_.end();
203 inline reverse_iterator rbegin() {
204 return arguments_.rbegin();
207 inline const_reverse_iterator rbegin()
const {
208 return arguments_.rbegin();
211 inline reverse_iterator rend() {
212 return arguments_.rend();
215 inline const_reverse_iterator rend()
const {
216 return arguments_.rend();
219 inline const_iterator cbegin() const noexcept {
220 return arguments_.cbegin();
223 inline const_iterator cend() const noexcept {
224 return arguments_.cend();
227 inline const_reverse_iterator crbegin() const noexcept {
228 return arguments_.crbegin();
231 inline const_reverse_iterator crend() const noexcept {
232 return arguments_.crend();
235 inline virtual ~OperationNode() =
default;
239 inline OperationNode(
const OperationNode& orig) :
240 handler_(orig.handler_),
241 operation_(orig.operation_),
243 arguments_(orig.arguments_),
244 pos_((std::numeric_limits<size_t>::max)()),
245 name_(orig.name_ != nullptr ? new std::string(*orig.name_) : nullptr) {
248 inline OperationNode(CodeHandler<Base>* handler,
252 pos_((std::numeric_limits<size_t>::max)()) {
255 inline OperationNode(CodeHandler<Base>* handler,
257 const Argument<Base>& arg) :
261 pos_((std::numeric_limits<size_t>::max)()) {
264 inline OperationNode(CodeHandler<Base>* handler,
266 std::vector<Argument<Base> >&& args) :
269 arguments_(std::move(args)),
270 pos_((std::numeric_limits<size_t>::max)()) {
273 inline OperationNode(CodeHandler<Base>* handler,
275 std::vector<size_t>&& info,
276 std::vector<Argument<Base> >&& args) :
279 info_(std::move(info)),
280 arguments_(std::move(args)),
281 pos_((std::numeric_limits<size_t>::max)()) {
284 inline OperationNode(CodeHandler<Base>* handler,
286 const std::vector<size_t>& info,
287 const std::vector<Argument<Base> >& args) :
292 pos_((std::numeric_limits<size_t>::max)()) {
295 inline void setHandlerPosition(
size_t pos) {
307 const std::vector<size_t>&
info,
313 static inline std::set<CGOpCode> makeCustomNodeClassesSet()
noexcept;