2 * Copyright 2014, Rene Gollent, rene@gollent.com.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
6 #ifndef EXPRESSION_VALUES_H
7 #define EXPRESSION_VALUES_H
12 #include <Referenceable.h>
13 #include <util/OpenHashTable.h>
21 class ExpressionValues
: public BReferenceable
{
24 ExpressionValues(const ExpressionValues
& other
);
25 // throws std::bad_alloc
26 virtual ~ExpressionValues();
30 bool GetValue(FunctionID
* function
,
32 const BString
* expression
,
33 BVariant
& _value
) const;
34 inline bool GetValue(FunctionID
* function
,
36 const BString
& expression
,
37 BVariant
& _value
) const;
38 bool HasValue(FunctionID
* function
,
40 const BString
* expression
) const;
41 inline bool HasValue(FunctionID
* function
,
43 const BString
& expression
) const;
44 status_t
SetValue(FunctionID
* function
,
46 const BString
& expression
,
47 const BVariant
& value
);
52 struct ValueEntryHashDefinition
;
54 typedef BOpenHashTable
<ValueEntryHashDefinition
> ValueTable
;
57 ExpressionValues
& operator=(const ExpressionValues
& other
);
67 ExpressionValues::GetValue(FunctionID
* function
, Thread
* thread
,
68 const BString
& expression
, BVariant
& _value
) const
70 return GetValue(function
, thread
, &expression
, _value
);
75 ExpressionValues::HasValue(FunctionID
* function
, Thread
* thread
,
76 const BString
& expression
) const
78 return HasValue(function
, thread
, &expression
);
82 #endif // EXPRESSION_VALUES_H