DEFINE_string(
calculator_graph_config_file, "",
"Name of file containing text format CalculatorGraphConfig proto.");
这是 Google 的 mediapipe 提供的用于图像识别的代码的一部分,有人可以告诉我这是 (DEFINE_string) 的作用吗?
最佳答案
这只是一个定义标志的函数……更具体地说是一个宏函数,在文档 here 中有描述。 :
Defining a flag is easy: just use the appropriate macro for the type you want the flag to be, as defined at the bottom of gflags/gflags.h. Here's an example file, foo.cc:
所以你不仅可以定义字符串标志,还可以
DEFINE_bool: boolean
DEFINE_int32: 32-bit integer
DEFINE_int64: 64-bit integer
DEFINE_uint64: unsigned 64-bit integer
DEFINE_double: double
关于c++ - 使用 DEFINE_string 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63544513/