what does it mean to use DEFINE_string

Viewed 2769
DEFINE_string(
    calculator_graph_config_file, "",
    "Name of file containing text format CalculatorGraphConfig proto.");

This is part of a code offered by Google's mediapipe for image recognition can someone tell me what this (DEFINE_string) does?

1 Answers

That is just a function to define flags... a macro function more specifically and is described in the doc 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:

so you can not just define string flags, you could also

DEFINE_bool: boolean
DEFINE_int32: 32-bit integer
DEFINE_int64: 64-bit integer
DEFINE_uint64: unsigned 64-bit integer
DEFINE_double: double
Related