#include "nusmv/core/utils/utils.h"
#include "nusmv/core/node/node.h"
Go to the source code of this file.
Data Structures | |
struct | Opts_EnumRec |
Defines | |
#define | OPTS_DEFAULT_VALUE_TRUE true |
#define | OPTS_FALSE_VALUE "0" |
#define | OPTS_FOREACH_OPTION(h, name, value) for (Opts_Gen_init(h); Opts_Gen_next(h, name, value) || (Opts_Gen_deinit(h), 0); ) |
Operates on each entry of the option handler. | |
#define | OPTS_HANDLER(self) ((OptsHandler_ptr) self) |
To cast and check instances of class ModelSimplifier. | |
#define | OPTS_HANDLER_CHECK_INSTANCE(self) (nusmv_assert(OPTS_HANDLER(self) != OPTS_HANDLER(NULL))) |
#define | OPTS_IS_PUBLIC true |
#define | OPTS_TRUE_VALUE "1" |
#define | OPTS_VALUE_ERROR (void *)-9999 |
Typedefs | |
typedef boolean(* | Opts_CheckFnType )(OptsHandler_ptr, const char *, void *) |
typedef void *(* | Opts_ReturnFnType )(OptsHandler_ptr, const char *, void *) |
typedef boolean(* | Opts_TriggerFnType )(OptsHandler_ptr, const char *, const char *, Trigger_Action, void *) |
Enumerations | |
enum | Option_Type { GENERIC_OPTION, USER_OPTION, INTEGER_OPTION, ENUM_OPTION, BOOL_OPTION } |
Generic handler of options. More... | |
enum | Trigger_Action { ACTION_SET, ACTION_RESET, ACTION_GET } |
Functions | |
void | OptsHandler_copy (OptsHandler_ptr src_opts, OptsHandler_ptr dst_opts) |
Copy src_opts to dst_opts. | |
void | OptsHandler_destroy (OptsHandler_ptr h) |
Frees an option handler. | |
boolean | OptsHandler_register_bool_option (OptsHandler_ptr self, const char *name, boolean value, boolean is_public) |
Registers a boolean option in an option handler. |
#define OPTS_FOREACH_OPTION | ( | h, | |||
name, | |||||
value | ) | for (Opts_Gen_init(h); Opts_Gen_next(h, name, value) || (Opts_Gen_deinit(h), 0); ) |
Operates on each entry of the option handler.
Operates on each entry of the option handler. name and value must be declared to be char **.
#define OPTS_HANDLER | ( | self | ) | ((OptsHandler_ptr) self) |
To cast and check instances of class ModelSimplifier.
These macros must be used respectively to cast and to check instances of class ModelSimplifier
#define OPTS_HANDLER_CHECK_INSTANCE | ( | self | ) | (nusmv_assert(OPTS_HANDLER(self) != OPTS_HANDLER(NULL))) |
typedef boolean(* Opts_CheckFnType)(OptsHandler_ptr, const char *, void *) |
typedef void*(* Opts_ReturnFnType)(OptsHandler_ptr, const char *, void *) |
typedef boolean(* Opts_TriggerFnType)(OptsHandler_ptr, const char *, const char *, Trigger_Action, void *) |
enum Option_Type |
Generic handler of options.
For boolean options are provided special methods to register the option and for setting and getting a value associated to it.
For enumerative options are provided special methods to register the option and for setting and getting a value associated to it. An enumertive option is registered by providing an array of structures of type Opts_EnumRec. Similarly to the below declaration:
typedef enum {foo1, ...., fooN} fooenumtype; Opts_EnumRec foo[] = {"foo1", foo1, "foo2", foo2, .... "fooN", fooN}; .... handler = OptsHandler_create(); OptsHandler_register_enum_option(handler, "foooption", "foo1", foo, N);
if (OptsHandler_get_enum_option_value(handler, "foooption") == foo2) { ... }
...
switch(OptsHandler_get_enum_option_value(handler, "foooption")) { case foo1: ... case fooN: ... default: ... }
enum Trigger_Action |
void OptsHandler_copy | ( | OptsHandler_ptr | src_opts, | |
OptsHandler_ptr | dst_opts | |||
) |
Copy src_opts to dst_opts.
Copy src_opts to dst_opts.
Note that:
void OptsHandler_destroy | ( | OptsHandler_ptr | h | ) |
Frees an option handler.
Frees an option handler.
None
boolean OptsHandler_register_bool_option | ( | OptsHandler_ptr | self, | |
const char * | name, | |||
boolean | value, | |||
boolean | is_public | |||
) |
Registers a boolean option in an option handler.
Registers a boolean option in an option handler. The user is not required to provide any function to check and return a value. Returns true if the registration of the option succeeds, false otherwise.
None