diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-07 13:03:04 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-03-07 13:03:04 (GMT) |
commit | ca46aa711fb5d08a8fd1cc6b91593c281189e8e3 (patch) | |
tree | c46ed5fcbf44ea1a32517f8ba3d6d9a066b6fed8 /src/uscxml/Message.h | |
parent | fce16e70dff8503bfab2e734bca5a52d9057a3ee (diff) | |
download | uscxml-ca46aa711fb5d08a8fd1cc6b91593c281189e8e3.zip uscxml-ca46aa711fb5d08a8fd1cc6b91593c281189e8e3.tar.gz uscxml-ca46aa711fb5d08a8fd1cc6b91593c281189e8e3.tar.bz2 |
Modified InterpreterMonitor for uscxml-debugger
Diffstat (limited to 'src/uscxml/Message.h')
-rw-r--r-- | src/uscxml/Message.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h index bdb9498..f61cd1d 100644 --- a/src/uscxml/Message.h +++ b/src/uscxml/Message.h @@ -71,8 +71,19 @@ public: }; Data() : type(INTERPRETED) {} + + // TODO: default INTERPRETED is unfortunate Data(const std::string& atom_, Type type_ = INTERPRETED) : atom(atom_), type(type_) {} Data(const char* data, size_t size, const std::string& mimeType, bool adopt = false); + + // convenience constructors + Data(short atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(int atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(unsigned int atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(long atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(unsigned long atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(float atom_) : atom(toStr(atom_)), type(INTERPRETED) {} + Data(double atom_) : atom(toStr(atom_)), type(INTERPRETED) {} Data(bool atom_) : type(INTERPRETED) { if (atom_) { atom = "true"; @@ -80,9 +91,18 @@ public: atom = "false"; } } - template <typename T> Data(T value) : atom(toStr(value)), type(INTERPRETED) {} + template <typename T> Data(T value, Type type_) : atom(toStr(value)), type(type_) {} +#if 0 + // constructor for arbitrary types, skip if type is subclass though (C++11) + // we will have to drop this constructor as it interferes with operator Data() and entails C++11 + template <typename T> + Data(T value, typename std::enable_if<! std::is_base_of<Data, T>::value>::type* = nullptr) + : atom(toStr(value)), type(INTERPRETED) {} +#endif + + explicit Data(const Arabica::DOM::Node<std::string>& dom); virtual ~Data() {} |