diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-10-21 22:25:48 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-10-21 22:25:48 +0000 |
commit | 623184c101c904eb0d456d325d3ced4d4475d3ae (patch) | |
tree | 56a4d02eeb1f966ad1f17405a9c6b2fe84e804e0 /cpp/src/Transform/TransformUtil.h | |
parent | Freeze Index Windows port (diff) | |
download | ice-623184c101c904eb0d456d325d3ced4d4475d3ae.tar.bz2 ice-623184c101c904eb0d456d325d3ced4d4475d3ae.tar.xz ice-623184c101c904eb0d456d325d3ced4d4475d3ae.zip |
initial check-in
Diffstat (limited to 'cpp/src/Transform/TransformUtil.h')
-rw-r--r-- | cpp/src/Transform/TransformUtil.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/cpp/src/Transform/TransformUtil.h b/cpp/src/Transform/TransformUtil.h new file mode 100644 index 00000000000..fab1ef8ecee --- /dev/null +++ b/cpp/src/Transform/TransformUtil.h @@ -0,0 +1,52 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#ifndef TRANSFORM_TRANSFORM_UTIL_H +#define TRANSFORM_TRANSFORM_UTIL_H + +#include <Slice/Parser.h> + +namespace Transform +{ + +template<class T> +class Destroyer +{ +public: + + Destroyer() {} + Destroyer(T p) : _p(p) {} + ~Destroyer() + { + if(_p) + _p->destroy(); + } + + void set(T p) + { + if(_p) + _p->destroy(); + _p = p; + } + +private: + + T _p; +}; + +std::string typeName(const Slice::TypePtr&); + +} // End of namespace Transform + +#endif |