diff options
Diffstat (limited to 'src/variable.h')
-rw-r--r-- | src/variable.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/variable.h b/src/variable.h index 97308c7..22a1b26 100644 --- a/src/variable.h +++ b/src/variable.h | |||
@@ -44,23 +44,30 @@ public: | |||
44 | Variable( double fValue ); | 44 | Variable( double fValue ); |
45 | Variable( bool bValue ); | 45 | Variable( bool bValue ); |
46 | Variable( const Bu::String &sValue ); | 46 | Variable( const Bu::String &sValue ); |
47 | Variable( Variable *pValue ); | ||
47 | virtual ~Variable(); | 48 | virtual ~Variable(); |
48 | 49 | ||
49 | static Variable newSituationName( const Bu::String &s ); | 50 | static Variable newSituationName( const Bu::String &s ); |
50 | static Variable newVariableName( const Bu::String &s, ScopeId sid ); | 51 | static Variable newVariableName( const Bu::String &s, ScopeId sid ); |
51 | 52 | ||
52 | Type getType() const { return eType; } | 53 | Type getType() const { return eType; } |
54 | |||
55 | typedef Bu::List<Variable> VariableList; | ||
56 | typedef Bu::Hash<Variable, Variable> VariableHash; | ||
53 | 57 | ||
54 | bool getBool() const; | 58 | bool getBool() const; |
55 | int64_t getInt() const; | 59 | int64_t getInt() const; |
56 | double getFloat() const; | 60 | double getFloat() const; |
57 | Bu::String getString() const; | 61 | Bu::String getString() const; |
58 | VariableRef getVariableRef() const; | 62 | VariableRef getVariableRef() const; |
63 | Variable *getVariablePtr() const; | ||
64 | const VariableHash &getHash() const; | ||
59 | 65 | ||
60 | Variable to( Type e ) const; | 66 | Variable to( Type e ) const; |
61 | 67 | ||
62 | void insert( const Variable &vKey, const Variable &vValue ); | 68 | void insert( const Variable &vKey, const Variable &vValue ); |
63 | bool has( const Variable &vKey ); | 69 | bool has( const Variable &vKey ); |
70 | Variable &get( const Variable &vKey ); | ||
64 | 71 | ||
65 | Variable &operator=( const Variable &rhs ); | 72 | Variable &operator=( const Variable &rhs ); |
66 | Variable &operator+=( const Variable &rhs ); | 73 | Variable &operator+=( const Variable &rhs ); |
@@ -86,17 +93,14 @@ private: | |||
86 | private: | 93 | private: |
87 | Type eType; | 94 | Type eType; |
88 | 95 | ||
89 | typedef Bu::List<Variable> VList; | ||
90 | typedef Bu::Hash<Variable, Variable> VHash; | ||
91 | |||
92 | union | 96 | union |
93 | { | 97 | { |
94 | int64_t iValue; | 98 | int64_t iValue; |
95 | double fValue; | 99 | double fValue; |
96 | bool bValue; | 100 | bool bValue; |
97 | Bu::String *sValue; | 101 | Bu::String *sValue; |
98 | VList *lValue; | 102 | VariableList *lValue; |
99 | VHash *hValue; | 103 | VariableHash *hValue; |
100 | VariableRef *rValue; | 104 | VariableRef *rValue; |
101 | Variable *pValue; | 105 | Variable *pValue; |
102 | }; | 106 | }; |