59 inline static SP::GPM_Variable
New() {
82 virtual void copy(SPC::GPM_Variable var) {
83 if (var.get()!=
null)
copy(*var.get());
106 void setValue(
const int& cardinality,
const double* values,
const tFlag& type);
113 for (
int i=0;i<l;i++) mValues[i]=(
double) value[i];
151 values.resize(mCardinality);
152 for (
int i=0;i<mCardinality;i++) values[i]=(
char) mValues[i];
156 inline void getValue(
int& n,
double* values)
const {
157 n=(n<mCardinality)?n:mCardinality;
158 for (
int i=0;i<n;i++) values[i]=mValues[i];
163 if (mCardinality==0)
return 0;
181 if (var==
null)
return false;
187 if (var.get()==
null)
return false;
201 void resize(
const int& n);
static const tFlag SINGLE
Definition: GPM_Variable.h:27
virtual ~GPM_Variable(void)
destroy an object.
Definition: GPM_Variable.cpp:22
tBoolean isEqual(const GPM_Variable *var) const
return tre if the 2 variables are equal
Definition: GPM_Variable.h:180
void setType(const tFlag &t)
set the type of the variable
Definition: GPM_Variable.h:96
void setValue(const double &value)
set the variable
Definition: GPM_Variable.h:123
DEFINE_SVPTR(GPM_Variable)
double getValue() const
get the variable value
Definition: GPM_Variable.h:162
tBoolean isGlobal() const
return true if the vraibale is global
Definition: GPM_Variable.h:143
tBoolean isEqual(const GPM_Variable &var) const
return true if the 2 variables are equal
Definition: GPM_Variable.h:171
virtual void copy(SPC::GPM_Variable var)
copy the vraiable
Definition: GPM_Variable.h:82
static SP::GPM_Variable New()
Definition: GPM_Variable.h:59
#define tBoolean
Definition: types.h:35
int getCardinality() const
get the cardinality
Definition: GPM_Variable.h:133
#define null
Definition: types.h:13
double & operator[](const int &i)
Definition: GPM_Variable.h:70
static const tFlag MULTIPLE
Definition: GPM_Variable.h:28
void getValue(tString &values) const
get the variable value
Definition: GPM_Variable.h:150
tFlag getType() const
Definition: GPM_Variable.h:138
void setValue(const int &cardinality, const double *values, const tFlag &type)
set the variable
Definition: GPM_Variable.cpp:74
void parse(const tString &value)
parse the string : reverse method of toString
Definition: GPM_Variable.cpp:85
void setCardinality(const int &n)
set the cardinalty of the variable
Definition: GPM_Variable.h:91
static const tFlag STRING
Definition: GPM_Variable.h:26
static const tFlag REAL
Definition: GPM_Variable.h:23
This class describes a node.
Definition: GPM_Variable.h:16
void setValue(const int &n, const double *value)
set the variable
Definition: GPM_Variable.h:118
tBoolean isEqual(const SPC::GPM_Variable var) const
return tre if the 2 variables are equal
Definition: GPM_Variable.h:186
void setValue(const tString &value)
set the variable
Definition: GPM_Variable.h:110
virtual tString toString() const
to string
Definition: GPM_Variable.cpp:181
void getValue(int &n, double *values) const
get the variable value
Definition: GPM_Variable.h:156
static const tFlag BOOLEAN
Definition: GPM_Variable.h:24
#define tString
Definition: types.h:36
const double & operator[](const int &i) const
Definition: GPM_Variable.h:66
DEFINE_SPTR(GPM_Variable)
GPM_Variable(void)
create an object
Definition: GPM_Variable.cpp:13
This class is the base class of all graph classes.
Definition: GPM_Object.h:17
static const tFlag UNDEFINED
Definition: GPM_Variable.h:22
virtual void copy(const GPM_Variable &var)
copy the vraiable
Definition: GPM_Variable.cpp:53
#define ASSERT_IN(a)
Definition: types.h:82
static const tFlag INTEGER
Definition: GPM_Variable.h:25
void setIsGlobal(const tBoolean &t)
set if the variable is global
Definition: GPM_Variable.h:101
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14