yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat::Int64Option Class Reference

#include <Options.h>

+ Inheritance diagram for Minisat::Int64Option:
+ Collaboration diagram for Minisat::Int64Option:

Public Member Functions

 Int64Option (const char *c, const char *n, const char *d, int64_t def=int64_t(), Int64Range r=Int64Range(INT64_MIN, INT64_MAX))
 
 operator int64_t (void) const
 
 operator int64_t & (void)
 
Int64Optionoperator= (int64_t x)
 
virtual bool parse (const char *str)
 
virtual void help (bool verbose=false)
 

Static Protected Member Functions

static vec< Option * > & getOptionList ()
 
static const char *& getUsageString ()
 
static const char *& getHelpPrefixString ()
 

Protected Attributes

Int64Range range
 
int64_t value
 
const char * name
 
const char * description
 
const char * category
 
const char * type_name
 

Detailed Description

Definition at line 243 of file Options.h.

Constructor & Destructor Documentation

Minisat::Int64Option::Int64Option ( const char *  c,
const char *  n,
const char *  d,
int64_t  def = int64_t(),
Int64Range  r = Int64Range(INT64_MIN, INT64_MAX) 
)
inline

Definition at line 250 of file Options.h.

251  : Option(n, d, c, "<int64>"), range(r), value(def) {}
tuple n
Definition: fsm/generate.py:59
Option(const char *name_, const char *desc_, const char *cate_, const char *type_)
Definition: Options.h:67
Int64Range range
Definition: Options.h:246

Member Function Documentation

static const char*& Minisat::Option::getHelpPrefixString ( )
inlinestaticprotectedinherited

Definition at line 58 of file Options.h.

58 { static const char* help_prefix_str = ""; return help_prefix_str; }

+ Here is the caller graph for this function:

static vec<Option*>& Minisat::Option::getOptionList ( )
inlinestaticprotectedinherited

Definition at line 56 of file Options.h.

56 { static vec<Option*> options; return options; }

+ Here is the caller graph for this function:

static const char*& Minisat::Option::getUsageString ( )
inlinestaticprotectedinherited

Definition at line 57 of file Options.h.

57 { static const char* usage_str; return usage_str; }

+ Here is the caller graph for this function:

virtual void Minisat::Int64Option::help ( bool  verbose = false)
inlinevirtual

Implements Minisat::Option.

Definition at line 280 of file Options.h.

280  {
281  fprintf(stderr, " -%-12s = %-8s [", name, type_name);
282  if (range.begin == INT64_MIN)
283  fprintf(stderr, "imin");
284  else
285  fprintf(stderr, "%4" PRIi64 , range.begin);
286 
287  fprintf(stderr, " .. ");
288  if (range.end == INT64_MAX)
289  fprintf(stderr, "imax");
290  else
291  fprintf(stderr, "%4" PRIi64 , range.end);
292 
293  fprintf(stderr, "] (default: %" PRIi64 ")\n", value);
294  if (verbose){
295  fprintf(stderr, "\n %s\n", description);
296  fprintf(stderr, "\n");
297  }
298  }
const char * name
Definition: Options.h:51
const char * type_name
Definition: Options.h:54
Int64Range range
Definition: Options.h:246
const char * description
Definition: Options.h:52
Minisat::Int64Option::operator int64_t ( void  ) const
inline

Definition at line 253 of file Options.h.

253 { return value; }
Minisat::Int64Option::operator int64_t & ( void  )
inline

Definition at line 254 of file Options.h.

254 { return value; }
Int64Option& Minisat::Int64Option::operator= ( int64_t  x)
inline

Definition at line 255 of file Options.h.

255 { value = x; return *this; }
virtual bool Minisat::Int64Option::parse ( const char *  str)
inlinevirtual

Implements Minisat::Option.

Definition at line 257 of file Options.h.

257  {
258  const char* span = str;
259 
260  if (!match(span, "-") || !match(span, name) || !match(span, "="))
261  return false;
262 
263  char* end;
264  int64_t tmp = strtoll(span, &end, 10);
265 
266  if (end == NULL)
267  return false;
268  else if (tmp > range.end){
269  fprintf(stderr, "ERROR! value <%s> is too large for option \"%s\".\n", span, name);
270  exit(1);
271  }else if (tmp < range.begin){
272  fprintf(stderr, "ERROR! value <%s> is too small for option \"%s\".\n", span, name);
273  exit(1); }
274 
275  value = tmp;
276 
277  return true;
278  }
const char * name
Definition: Options.h:51
static bool match(B &in, const char *str)
Definition: ParseUtils.h:96
#define NULL
Int64Range range
Definition: Options.h:246

+ Here is the call graph for this function:

Field Documentation

const char* Minisat::Option::category
protectedinherited

Definition at line 53 of file Options.h.

const char* Minisat::Option::description
protectedinherited

Definition at line 52 of file Options.h.

const char* Minisat::Option::name
protectedinherited

Definition at line 51 of file Options.h.

Int64Range Minisat::Int64Option::range
protected

Definition at line 246 of file Options.h.

const char* Minisat::Option::type_name
protectedinherited

Definition at line 54 of file Options.h.

int64_t Minisat::Int64Option::value
protected

Definition at line 247 of file Options.h.


The documentation for this class was generated from the following file: