FST  openfst-1.8.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 FST_FLAGS_ ## name
 
#define DECLARE_string(name)   extern std::string FST_FLAGS_##name
 
#define DECLARE_int32(name)   extern int32 FST_FLAGS_ ## name
 
#define DECLARE_int64(name)   extern int64 FST_FLAGS_ ## name
 
#define DECLARE_uint64(name)   extern uint64 FST_FLAGS_##name
 
#define DECLARE_double(name)   extern double FST_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(std::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_uint64(name, value, doc)   DEFINE_VAR(uint64, 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="")
 
template<typename Type , typename Value >
void SetFlag (Type *flag, Value value)
 
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 FST_FLAGS_ ## name

Definition at line 49 of file flags.h.

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

Definition at line 54 of file flags.h.

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

Definition at line 51 of file flags.h.

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

Definition at line 52 of file flags.h.

#define DECLARE_string (   name)    extern std::string FST_FLAGS_##name

Definition at line 50 of file flags.h.

#define DECLARE_uint64 (   name)    extern uint64 FST_FLAGS_##name

Definition at line 53 of file flags.h.

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

Definition at line 201 of file flags.h.

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

Definition at line 207 of file flags.h.

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

Definition at line 204 of file flags.h.

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

Definition at line 205 of file flags.h.

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

Definition at line 202 of file flags.h.

#define DEFINE_uint64 (   name,
  value,
  doc 
)    DEFINE_VAR(uint64, name, value, doc)

Definition at line 206 of file flags.h.

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

Definition at line 192 of file flags.h.

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

Definition at line 222 of file flags.h.

Function Documentation

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

Definition at line 226 of file flags.h.

template<typename Type , typename Value >
void SetFlag ( Type *  flag,
Value  value 
)

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 45 of file flags.cc.

void ShowUsage ( bool  long_usage = true)

Definition at line 123 of file flags.cc.