FST  openfst-1.7.1
OpenFst Library
Classes | Macros | Functions
flags.h File Reference
#include <cstdlib>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <fst/types.h>
#include <fst/lock.h>
Include dependency graph for flags.h:

Go to the source code of this file.

Classes

struct  FlagDescription< T >
 
class  FlagRegister< T >
 
class  FlagRegisterer< T >
 

Macros

#define DECLARE_bool(name)   extern bool FLAGS_ ## name
 
#define DECLARE_string(name)   extern string FLAGS_ ## name
 
#define DECLARE_int32(name)   extern int32 FLAGS_ ## name
 
#define DECLARE_int64(name)   extern int64 FLAGS_ ## name
 
#define DECLARE_double(name)   extern double FLAGS_ ## name
 
#define DEFINE_VAR(type, name, value, doc)
 
#define DEFINE_bool(name, value, doc)   DEFINE_VAR(bool, name, value, doc)
 
#define DEFINE_string(name, value, doc)   DEFINE_VAR(string, name, value, doc)
 
#define DEFINE_int32(name, value, doc)   DEFINE_VAR(int32, name, value, doc)
 
#define DEFINE_int64(name, value, doc)   DEFINE_VAR(int64, name, value, doc)
 
#define DEFINE_double(name, value, doc)   DEFINE_VAR(double, name, value, doc)
 
#define SET_FLAGS(usage, argc, argv, rmflags)   SetFlags(usage, argc, argv, rmflags, __FILE__)
 

Functions

 DECLARE_string (tmpdir)
 
void SetFlags (const char *usage, int *argc, char ***argv, bool remove_flags, const char *src="")
 
void InitFst (const char *usage, int *argc, char ***argv, bool rmflags)
 
void ShowUsage (bool long_usage=true)
 

Macro Definition Documentation

#define DECLARE_bool (   name)    extern bool FLAGS_ ## name

Definition at line 51 of file flags.h.

#define DECLARE_double (   name)    extern double FLAGS_ ## name

Definition at line 55 of file flags.h.

#define DECLARE_int32 (   name)    extern int32 FLAGS_ ## name

Definition at line 53 of file flags.h.

#define DECLARE_int64 (   name)    extern int64 FLAGS_ ## name

Definition at line 54 of file flags.h.

#define DECLARE_string (   name)    extern string FLAGS_ ## name

Definition at line 52 of file flags.h.

#define DEFINE_bool (   name,
  value,
  doc 
)    DEFINE_VAR(bool, name, value, doc)

Definition at line 200 of file flags.h.

#define DEFINE_double (   name,
  value,
  doc 
)    DEFINE_VAR(double, name, value, doc)

Definition at line 205 of file flags.h.

#define DEFINE_int32 (   name,
  value,
  doc 
)    DEFINE_VAR(int32, name, value, doc)

Definition at line 203 of file flags.h.

#define DEFINE_int64 (   name,
  value,
  doc 
)    DEFINE_VAR(int64, name, value, doc)

Definition at line 204 of file flags.h.

#define DEFINE_string (   name,
  value,
  doc 
)    DEFINE_VAR(string, name, value, doc)

Definition at line 201 of file flags.h.

#define DEFINE_VAR (   type,
  name,
  value,
  doc 
)
Value:
type FLAGS_ ## name = value; \
name ## _flags_registerer(#name, FlagDescription<type>(&FLAGS_ ## name, \
doc, \
#type, \
__FILE__, \
value))

Definition at line 191 of file flags.h.

#define SET_FLAGS (   usage,
  argc,
  argv,
  rmflags 
)    SetFlags(usage, argc, argv, rmflags, __FILE__)

Definition at line 214 of file flags.h.

Function Documentation

DECLARE_string ( tmpdir  )
void InitFst ( const char *  usage,
int *  argc,
char ***  argv,
bool  rmflags 
)
inline

Definition at line 218 of file flags.h.

void SetFlags ( const char *  usage,
int *  argc,
char ***  argv,
bool  remove_flags,
const char *  src = "" 
)

Definition at line 46 of file flags.cc.

void ShowUsage ( bool  long_usage = true)

Definition at line 124 of file flags.cc.