16template <
typename Component>
19 std::vector<Component> components_;
25 : target_(base), components_(), modified_(false) {}
68 void add(Component &&cp) {
70 components_.push_back(std::move(cp));
79 void set(
const std::vector<Component> &cv) {
85 void set(std::initializer_list<Component> cl) {
87 components_ = std::vector<Component>(cl.begin(), cl.end());
91 const std::vector<Component> &
components()
const {
return components_; }
132 double width_ = 0, height_ = 0;
139 void onAdd()
override { checkSize(); }
141 if (width_ <= 0 && height_ <= 0) {
142 throw std::invalid_argument(
"Canvas2D size is invalid (" +
143 std::to_string(width_) +
", " +
144 std::to_string(height_) +
")");
147 void init(
double width,
double height) {
Definition component_canvas2d.h:137
Viewを構築するときに使う一時的なViewComponent.
Definition component_view.h:267
Definition data_buffer.h:131
Canvas2DDataBuf()=default
Canvas2DDataBuf(const Field &base)
Definition data_buffer.h:137
~Canvas2DDataBuf() noexcept override
Definition data_buffer.h:156
void init(double width, double height)
Definition data_buffer.h:147
void checkSize() const
Definition data_buffer.h:140
void onAdd() override
add時のチェック
Definition data_buffer.h:139
View,Canvasなどで送信用にaddされたデータを管理する
Definition data_buffer.h:17
void init()
Definition data_buffer.h:58
void set(const std::vector< Component > &cv)
まとめてセット
Definition data_buffer.h:79
void set(std::initializer_list< Component > cl)
Definition data_buffer.h:85
virtual ~DataSetBuffer() noexcept
Definition data_buffer.h:31
DataSetBuffer()
Definition data_buffer.h:23
const std::vector< Component > & components() const
Definition data_buffer.h:91
void onDestroy()
Definition data_buffer.h:38
void add(Component &&cp)
Definition data_buffer.h:68
DataSetBuffer(const Field &base)
Definition data_buffer.h:24
DataSetBuffer(DataSetBuffer &&)=delete
DataSetBuffer & operator=(DataSetBuffer &&)=delete
void sync()
Definition data_buffer.h:44
DataSetBuffer & operator=(const DataSetBuffer &)=delete
void onSync()
データを処理しtargetにsetする
DataSetBuffer(const DataSetBuffer &)=delete
virtual void onAdd()
add時のチェック
Definition data_buffer.h:67
Viewの送信用データを保持する
Definition data_buffer.h:108
void syncSetBuf()
Definition data_buffer.h:124
ClientDataの参照とメンバ名とデータ名を持つクラス
Definition field.h:70
bool isSelf() const
memberがselfならtrue
Definition field.cc:142
std::weak_ptr< internal::ClientData > data_w
ClientDataの参照
Definition field.h:76
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103