params.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/ast/scope.hpp"
6#include "core/ast/param.hpp"
7
8namespace by {
9 typedef std::vector<std::string> strings;
10
15 class _nout params: public tnarr<param> {
16 BY(CLASS(params, tnarr<param>))
17
18 public:
19 params();
20 params(const me& rhs) = default;
21
22 template <typename... Es> explicit params(const Es&... elems) {
23 static_assert(areBaseOfT<param, Es...>::value, "some of type of args are not base of type `T`");
24 add({(param*) &elems...});
25 }
26
27 public:
28 me& operator=(const me& rhs) = default;
29 nbool operator==(const me& rhs) const;
30 nbool operator!=(const me& rhs) const;
31
32 public:
34 std::string toStr() const;
35
36 static me make(const strings& names, const narr& args);
37 static me make(const narr& args);
38 };
39
43 class _nout dumParams: public params {
44 BY(CLASS(dumParams, params))
45
46 public:
49
50 nbool set(const iter& at, const param& new1) override { return true; }
51
52 nbool set(nidx n, const param& new1) override { return true; }
53
56
57 nbool add(const iter& at, const param& new1) override { return true; }
58
59 nbool add(nidx n, const param& new1) override { return true; }
60
61 void add(const iter& here, const iter& from, const iter& to) override {}
62 };
63} // namespace by
Function call arguments container.
Definition: args.hpp:13
Dummy parameter container that ignores all operations.
Definition: params.hpp:43
Function parameter definition.
Definition: param.hpp:13
Function parameter list container.
Definition: params.hpp:15
std::string toStr() const
Definition: tarrayable.hpp:10
Definition: tnarr.hpp:9
Template unidirectional container interface.
Definition: tucontainable.hpp:19
Bidirectional iterator for key-value containers.
Definition: biter.hpp:9