MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / update

Method update

src/utils/flags.cpp:122–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 error_s update(const std::string &val)
123 {
124 if (!has_tag(flag_tag::FT_MUTABLE)) {
125 return error_s::make(ERR_INVALID_PARAMETERS, fmt::format("{} is not mutable", _name));
126 }
127
128 switch (_type) {
129 FLAG_DATA_UPDATE_CASE(int32_t, FV_INT32, int32);
130 FLAG_DATA_UPDATE_CASE(int64_t, FV_INT64, int64);
131 FLAG_DATA_UPDATE_CASE(uint32_t, FV_UINT32, uint32);
132 FLAG_DATA_UPDATE_CASE(uint64_t, FV_UINT64, uint64);
133 FLAG_DATA_UPDATE_CASE(bool, FV_BOOL, bool);
134 FLAG_DATA_UPDATE_CASE(double, FV_DOUBLE, double);
135 FLAG_DATA_UPDATE_STRING();
136 }
137 return error_s::make(ERR_OK);
138 }
139
140 void set_validator(validator_fn &validator) { _validator = std::move(validator); }
141 const validator_fn &validator() const { return _validator; }

Callers 3

update_flagMethod · 0.45
genJsonFromHistogramMethod · 0.45
setHistorgramMethod · 0.45

Calls 1

has_tagFunction · 0.85

Tested by 1

genJsonFromHistogramMethod · 0.36