MCPcopy Create free account
hub / github.com/apache/brpc / get_value

Method get_value

src/bvar/gflag.cpp:56–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55#ifdef BAIDU_INTERNAL
56void GFlag::get_value(boost::any* value) const {
57 GFLAGS_NAMESPACE::CommandLineFlagInfo info;
58 if (!GFLAGS_NAMESPACE::GetCommandLineFlagInfo(gflag_name().c_str(), &info)) {
59 *value = "Unknown gflag=" + gflag_name();
60 } else if (info.type == "string") {
61 *value = info.current_value;
62 } else if (info.type == "int32") {
63 *value = static_cast<int>(atoi(info.current_value.c_str()));
64 } else if (info.type == "int64") {
65 *value = static_cast<int64_t>(atoll(info.current_value.c_str()));
66 } else if (info.type == "uint64") {
67 *value = static_cast<uint64_t>(
68 strtoull(info.current_value.c_str(), NULL, 10));
69 } else if (info.type == "bool") {
70 *value = (info.current_value == "true");
71 } else if (info.type == "double") {
72 *value = strtod(info.current_value.c_str(), NULL);
73 } else {
74 *value = "Unknown type=" + info.type + " of gflag=" + gflag_name();
75 }
76}
77#endif
78
79std::string GFlag::get_value() const {

Callers 15

num_requestsMethod · 0.45
num_requestsMethod · 0.45
num_requestsMethod · 0.45
num_requestsMethod · 0.45
runMethod · 0.45
runMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 1

c_strMethod · 0.45

Tested by 15

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TestLabelsFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36