#ifndef ICE_P2_HELPERS_H #define ICE_P2_HELPERS_H #include <variableType.h> #include <common.h> #include <visibility.h> template <typename T> DLL_PUBLIC const VariableType & operator>>(const VariableType & vt, T & v) { v = vt.as<T>(); return vt; } template <> DLL_PUBLIC const VariableType & operator>><Common::Duration>(const VariableType & vt, Common::Duration & d); template <> DLL_PUBLIC const VariableType & operator>><Common::DateTime>(const VariableType & vt, Common::DateTime & dt); template <typename T> DLL_PUBLIC const VariableType & operator>>(const VariableType & vt, IceUtil::Optional<T> & v) { if (vt.isNull()) { v = IceUtil::Optional<T>(); } else { v = T(); vt >> *v; } return vt; } template <> DLL_PUBLIC const VariableType & operator>>(const VariableType & vt, short int & v); template <typename T> DLL_PUBLIC VariableType & operator<<(VariableType & vt, const T & v) { vt = v; return vt; } template <> DLL_PUBLIC VariableType & operator<<<Common::Duration>(VariableType & vt, const Common::Duration & d); template <> DLL_PUBLIC VariableType & operator<<<Common::DateTime>(VariableType & vt, const Common::DateTime & dt); template <typename T> DLL_PUBLIC VariableType & operator<<(VariableType & vt, const IceUtil::Optional<T> & v) { if (v) { vt << *v; } else { vt = Null(); } return vt; } #endif