21 #ifndef _GLIBCXX_CMATH
36 # define aw_assert(cond) arb_assert(cond)
47 enum { INT, FLOAT, STR, PNTR } type;
48 static const int SCALAR_TYPES = 4;
50 static const char *
const type_name[SCALAR_TYPES];
55 explicit AW_scalar(
float F) : type(FLOAT) { value.f = F; }
64 if (type == STR) value.s =
ARB_strdup(value.s);
90 case INT: equal = (value.i == other.value.
i);
break;
91 case FLOAT: equal = fabs(value.f-other.value.
f)<0.000001;
break;
92 case STR: equal = strcmp(value.s, other.value.
s) == 0;
break;
93 case PNTR: equal = (value.p == other.value.
p);
break;
102 #error aw_scalar.hxx included twice
103 #endif // AW_SCALAR_HXX
bool matches_variable_type(AW_VARIABLE_TYPE atype) const
GBDATA * get_pointer() const
void set_pointer(GBDATA *P)
char * ARB_strdup(const char *str)
GB_ERROR write_to(class AW_awar *awar) const
AW_scalar(const AW_scalar &other)
const char * get_string() const
bool operator!=(const AW_scalar &other) const
DECLARE_ASSIGNMENT_OPERATOR(AW_scalar)
const char * get_type_name() const
AW_VARIABLE_TYPE matching_variable_type() const
void set_string(const char *S)
bool operator==(const AW_scalar &other) const