11#include "webcface/common/webcface-config.h"
30 using Field::lastName;
96 template <
typename F,
typename std::enable_if_t<std::is_invocable_v<F>,
97 std::
nullptr_t> =
nullptr>
100 [callback = std::move(callback)](
const auto &) { callback(); });
109 template <
typename T>
111 onChange(std::forward<T>(callback));
121 const Value &set(
double v)
const;
127 const Value &set(std::vector<double> v)
const;
137 template <
typename R,
140 return set(traits::arrayLikeToVector(range));
146 const Value &resize(std::size_t size)
const;
150 const Value &push_back(
double v)
const;
156 template <
typename T>
158 this->set(std::forward<T>(v));
170 this->set(std::move(v));
179 const Value &request()
const;
186 std::optional<double> tryGet()
const;
191 std::optional<std::vector<double>> tryGetVec()
const;
196 double get()
const {
return tryGet().value_or(0); }
202 return tryGetVec().value_or(std::vector<double>{});
204 operator double()
const {
return get(); }
205 operator std::vector<double>()
const {
return getVec(); }
220 [[deprecated]] std::chrono::system_clock::time_point time()
const;
226 const Value &free()
const;
229 this->set(this->get() + rhs);
233 this->set(this->get() - rhs);
237 this->set(this->get() * rhs);
241 this->set(this->get() / rhs);
245 this->set(
static_cast<std::int32_t
>(this->get()) % rhs);
250 this->set(
static_cast<std::int32_t
>(this->get()) << rhs);
254 this->set(
static_cast<std::int32_t
>(this->get()) >> rhs);
258 this->set(
static_cast<std::int32_t
>(this->get()) & rhs);
262 this->set(
static_cast<std::int32_t
>(this->get()) | rhs);
266 this->set(
static_cast<std::int32_t
>(this->get()) ^ rhs);
274 this->set(this->get() + 1);
282 auto v = this->get();
291 this->set(this->get() - 1);
299 auto v = this->get();
312 template <
typename T,
typename std::enable_if_t<std::is_same_v<T, Value>,
313 std::
nullptr_t> =
nullptr>
315 return static_cast<Field>(*this) ==
static_cast<Field>(other);
317 template <
typename T,
typename std::enable_if_t<std::is_same_v<T, Value>,
318 std::
nullptr_t> =
nullptr>
320 return static_cast<Field>(*this) ==
static_cast<Field>(other);
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
実数値またはその配列の送受信データを表すクラス
Definition value.h:23
Value parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition value.h:80
const Value & operator/=(double rhs) const
Definition value.h:240
const Value & operator+=(double rhs) const
Definition value.h:228
const Value & operator|=(std::int32_t rhs) const
Definition value.h:261
bool operator==(const T &other) const
Valueの参照先を比較
Definition value.h:314
const Value & onChange(F callback) const
値が変化したときに呼び出されるコールバックを設定
Definition value.h:98
const Value & set(const R &range) const
配列型の値をセットする
Definition value.h:139
std::vector< double > getVec() const
値をvectorで返す
Definition value.h:201
const Value & operator%=(std::int32_t rhs) const
Definition value.h:244
const Value & operator>>=(std::int32_t rhs) const
Definition value.h:253
double operator--(int) const
1引いたものをsetし、足す前の値を返す
Definition value.h:298
Value operator[](std::string_view field) const
Definition value.h:56
Value child(std::string_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField
Definition value.h:38
bool operator<=(const Value &) const =delete
const Value & operator*=(double rhs) const
Definition value.h:236
Value child(int index) const
Definition value.h:51
bool operator!=(const T &other) const
Definition value.h:319
Value operator[](int index) const
Definition value.h:75
double operator++(int) const
1足したものをsetし、足す前の値を返す
Definition value.h:281
bool operator>=(const Value &) const =delete
Value child(std::wstring_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField (wstring)
Definition value.h:45
void appendListener(T &&callback) const
Definition value.h:110
const Value & operator&=(std::int32_t rhs) const
Definition value.h:257
const Value & operator--() const
1引いたものをsetした後自身を返す
Definition value.h:290
const Value & operator-=(double rhs) const
Definition value.h:232
bool operator>(const Value &) const =delete
const Value & operator=(T &&v) const
数値または配列をセットする
Definition value.h:157
const Value & operator^=(std::int32_t rhs) const
Definition value.h:265
Value operator[](std::wstring_view field) const
Definition value.h:61
const Value & operator=(std::vector< double > v) const
vector型配列をセットする
Definition value.h:169
bool operator<(const Value &) const =delete
Value operator[](const char *field) const
Definition value.h:66
Value operator[](const wchar_t *field) const
Definition value.h:70
double get() const
値を返す
Definition value.h:196
Value(const Field &base, const SharedString &field)
Definition value.h:27
const Value & operator<<=(std::int32_t rhs) const
Definition value.h:248
const Value & operator++() const
1足したものをsetした後自身を返す
Definition value.h:273
std::ostream & operator<<(std::ostream &os, const Arg &arg)
Definition func_info.cc:96
ClientDataの参照とメンバ名とデータ名を持つクラス
Definition field.h:70
Field parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition field.cc:33
Field child(const SharedString &field) const
Definition field.cc:42
Definition array_like.h:58
#define WEBCFACE_DLL
Definition webcface-config.h:60
#define WEBCFACE_CALL
Definition webcface-config.h:97
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103
#define WEBCFACE_CALL_FP
Definition webcface-config.h:98