in src/cpp/RiderLink/Source/RD/src/rd_framework_cpp/src/main/base/RdPropertyBase.h [53:100]
void init(Lifetime lifetime) const override
{
RdReactiveBase::init(lifetime);
if (!optimize_nested)
{
this->change.advise(lifetime, [this](T const& v) {
if (is_local_change)
{
if (this->has_value())
{
const IProtocol* iProtocol = get_protocol();
const Identities* identity = iProtocol->get_identity();
identifyPolymorphic(v, *identity, identity->next(rdid));
}
}
});
}
advise(lifetime, [this](T const& v) {
if (!is_local_change)
{
return;
}
if (is_master)
{
master_version++;
}
get_wire()->send(rdid, [this, &v](Buffer& buffer) {
buffer.write_integral<int32_t>(master_version);
S::write(this->get_serialization_context(), buffer, v);
spdlog::get("logSend")->trace("SEND property {} + {}:: ver = {}, value = {}", to_string(location), to_string(rdid),
std::to_string(master_version), to_string(v));
});
});
get_wire()->advise(lifetime, this);
if (!optimize_nested)
{
this->view(lifetime, [this](Lifetime lf, T const& v) {
if (this->has_value())
{
bindPolymorphic(v, lf, this, "$");
}
});
}
}