haiku/headers/private/debugger/model/ExpressionValues.h
Rene Gollent fce4895d18 Debugger: Split into core library and application.
- Add subfolder src/kits/debugger which contains the debugger's core
  functionality and lower layers. Correspondingly add headers/private/debugger
  for shared headers to be used by clients such as the Debugger application
  and eventual remote_debug_server. Adjust various files to account for
  differences as a result of the split and moves.
- Add libdebugger.so to minimal Jamfile.
2016-06-04 13:18:39 -04:00

83 lines
1.9 KiB
C++

/*
* Copyright 2014, Rene Gollent, rene@gollent.com.
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#ifndef EXPRESSION_VALUES_H
#define EXPRESSION_VALUES_H
#include <String.h>
#include <Referenceable.h>
#include <util/OpenHashTable.h>
#include <Variant.h>
class FunctionID;
class Thread;
class ExpressionValues : public BReferenceable {
public:
ExpressionValues();
ExpressionValues(const ExpressionValues& other);
// throws std::bad_alloc
virtual ~ExpressionValues();
status_t Init();
bool GetValue(FunctionID* function,
Thread* thread,
const BString* expression,
BVariant& _value) const;
inline bool GetValue(FunctionID* function,
Thread* thread,
const BString& expression,
BVariant& _value) const;
bool HasValue(FunctionID* function,
Thread* thread,
const BString* expression) const;
inline bool HasValue(FunctionID* function,
Thread* thread,
const BString& expression) const;
status_t SetValue(FunctionID* function,
Thread* thread,
const BString& expression,
const BVariant& value);
private:
struct Key;
struct ValueEntry;
struct ValueEntryHashDefinition;
typedef BOpenHashTable<ValueEntryHashDefinition> ValueTable;
private:
ExpressionValues& operator=(const ExpressionValues& other);
void _Cleanup();
private:
ValueTable* fValues;
};
bool
ExpressionValues::GetValue(FunctionID* function, Thread* thread,
const BString& expression, BVariant& _value) const
{
return GetValue(function, thread, &expression, _value);
}
bool
ExpressionValues::HasValue(FunctionID* function, Thread* thread,
const BString& expression) const
{
return HasValue(function, thread, &expression);
}
#endif // EXPRESSION_VALUES_H