it_bus/param_t.h

00001 #ifndef _IT_BUS_PARAM_T_H_
00002 #define _IT_BUS_PARAM_T_H_
00003 
00004 //
00005 //  Copyright (c) 2002 IONA Technologies PLC. All Rights Reserved.
00006 //
00007 
00008 #error __FILE__" is obsolete"
00009 
00010 #include <it_bus/param.h>
00011 #include <it_bus/message_writer.h>
00012 #include <it_bus/message_reader.h>
00013 
00014 namespace IT_Bus
00015 {
00016     template <class T>
00017     class InParamImpl : public InParam
00018     {
00019       public:
00020         InParamImpl(const String & param_name, const T & value)
00021          : m_value(value), m_name(param_name) {};
00022         virtual ~InParamImpl() {};
00023 
00024         virtual void
00025         write(
00026             MessageWriter & writer
00027         ) const IT_THROW_DECL((SerializationException))
00028         {
00029             writer.write(QName(m_name), m_value);
00030         }
00031 
00032         virtual const String &
00033         get_name() const
00034         {
00035             return m_name;
00036         }
00037 
00038       protected:
00039         InParamImpl(const InParamImpl<T> &);
00040         InParamImpl<T> & operator=(const InParamImpl<T> &);
00041 
00042         String m_name;
00043         const T & m_value;
00044     };
00045 
00046     template <class T>
00047     class OutParamImpl : public OutParam
00048     {
00049       public:
00050         OutParamImpl(const String & param_name, T & value)
00051          : m_value(value), m_name(param_name) {};
00052         virtual ~OutParamImpl() {};
00053 
00054         virtual void
00055         read(
00056             MessageReader & reader
00057         ) IT_THROW_DECL((SerializationException))
00058         {
00059             reader.read(m_value);
00060         }
00061 
00062         virtual const String &
00063         get_name() const
00064         {
00065             return m_name;
00066         }
00067 
00068       protected:
00069         OutParamImpl(const OutParamImpl<T> &);
00070         OutParamImpl<T> & operator=(const OutParamImpl<T> &);
00071 
00072         String m_name;
00073         T & m_value;
00074     };
00075 
00076     template <class T>
00077     class InOutParamImpl : public InOutParam
00078     {
00079       public:
00080         InOutParamImpl(const String & param_name, T & value)
00081          : m_value(value), m_name(param_name) {};
00082         virtual ~InOutParamImpl() {};
00083 
00084         virtual void
00085         write(
00086             MessageWriter & writer
00087         ) const IT_THROW_DECL((SerializationException))
00088         {
00089             writer.write(QName(m_name), m_value);
00090         }
00091 
00092         virtual void
00093         read(
00094             MessageReader & reader
00095         ) IT_THROW_DECL((SerializationException))
00096         {
00097             reader.read(m_value);
00098         }
00099 
00100         virtual const String &
00101         get_name() const
00102         {
00103             return m_name;
00104         }
00105 
00106       protected:
00107         InOutParamImpl(const InOutParamImpl<T> &);
00108         InOutParamImpl<T> & operator=(const InOutParamImpl<T> &);
00109 
00110         String m_name;
00111         T & m_value;
00112     };
00113 };
00114 
00115 #endif  

Generated on Thu Sep 7 11:38:59 2006 for Artix by  doxygen 1.4.7