18 std::vector<Arg> m_arguments;
20 ds::InputRestrictionsAndFlags m_ds_flags;
24 inline Algorithm(std::string&& name,
25 std::vector<Arg>&& args,
27 ds::InputRestrictionsAndFlags flags):
28 m_name(
std::move(name)),
29 m_arguments(
std::move(args)),
30 m_doc(
std::move(doc)),
33 inline const std::string& name()
const {
37 inline const std::vector<Arg>& arguments()
const {
40 inline std::vector<Arg>& arguments() {
44 inline const std::string& doc()
const {
48 inline ds::InputRestrictionsAndFlags textds_flags() {
52 inline std::string
to_string(
bool omit_type =
false)
const;
54 friend inline bool operator==(
const Algorithm &lhs,
const Algorithm &rhs);
65 inline Arg(std::string&& name,
68 m_name(
std::move(name)),
69 m_is_static(is_static),
70 m_type(
std::move(type)),
71 m_has_default(false) {}
72 inline Arg(std::string&& name,
75 ast::Value&& default_value):
76 m_name(
std::move(name)),
77 m_is_static(is_static),
78 m_type(
std::move(type)),
80 m_default(
std::move(default_value)) {}
82 inline const std::string& name()
const {
85 inline bool is_static()
const {
88 inline const std::string& type()
const {
91 inline bool has_default()
const {
95 inline const ast::Value& default_value()
const {
98 inline ast::Value& default_value() {
102 inline std::string
to_string(
bool omit_type =
false)
const;
104 friend inline bool operator==(
const Arg &lhs,
const Arg &rhs);
107 inline std::ostream&
operator<<(std::ostream& os,
108 const Algorithm& x) {
112 inline std::ostream&
operator<<(std::ostream& os,
119 std::stringstream ss;
121 if (arguments().size() > 0) {
124 for (
auto& a: arguments()) {
128 ss << a.to_string(omit_type);
136 inline bool operator==(
const Arg &lhs,
const Arg &rhs);
137 inline bool operator==(
const Algorithm &lhs,
const Algorithm &rhs);
139 inline bool operator!=(
const Arg &lhs,
const Arg &rhs) {
140 return !(lhs == rhs);
142 inline bool operator!=(
const Algorithm &lhs,
const Algorithm &rhs) {
143 return !(lhs == rhs);
146 inline bool operator==(
const Arg &lhs,
const Arg &rhs) {
147 if (lhs.m_name != rhs.m_name)
return false;
148 if (lhs.m_is_static != rhs.m_is_static)
return false;
149 if (lhs.m_type != rhs.m_type)
return false;
150 if (lhs.m_has_default != rhs.m_has_default)
return false;
151 if (lhs.m_default != rhs.m_default)
return false;
155 inline bool operator==(
const Algorithm &lhs,
const Algorithm &rhs) {
156 if (lhs.m_name != rhs.m_name)
return false;
157 if (lhs.m_arguments != rhs.m_arguments)
return false;
158 if (lhs.m_doc != rhs.m_doc)
return false;
163 std::stringstream ss;
173 ss <<
" = " << default_value();
bool operator!=(const ConstGenericView< uliteral_t > &lhs, const ConstGenericView< uliteral_t > &rhs)
Contains the text compression and encoding framework.
std::ostream & operator<<(std::ostream &os, const uint_impl_t< N > &v)
bool operator==(const ConstGenericView< uliteral_t > &lhs, const ConstGenericView< uliteral_t > &rhs)
std::string to_string(tdc::uint_impl_t< N > value)