c++ - 使用 DEFINE_string 是什么意思

标签 c++ flags mediapipe

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/

相关文章:

c++ - CMake Visual Studio 将可执行文件与静态库链接

c++ - Python中的字典是否可以看作是C++中的Map

c++ - 嵌入 SpiderMonkey JS

java - 打印所有 JVM 标志

android - 无法在 Android 上通过 Mac OS 编译 mediapipe

javascript - mediapipe javascript 到 vue 组件?

python - mediapipe 解决方案::FaceDetection

c++ - 如何在 Linux/Unix 上获取硬件信息?

assembly - 我的标志标志值显示错误?我对标志旗的工作原理有误解吗?

xcode - 其他链接器标志列表