00001 #include <string>
00002
00003 #include <stdio.h>
00004 #include <time.h>
00005
00006 #include <oess_1/stdsn/h/serializable.hpp>
00007 #include <oess_1/stdsn/h/inout_templ.hpp>
00008
00009
00010
00011
00012
00013
00014
00015
00016 class data_t
00017 : public oess_1::stdsn::serializable_t
00018 {
00019 OESS_SERIALIZER( data_t )
00020 public :
00021 data_t()
00022 {}
00023
00024 data_t(
00025
00026 unsigned int size )
00027 : m_data( size, '0' )
00028 {}
00029
00030 virtual ~data_t()
00031 {}
00032
00033 private :
00034
00035 std::string m_data;
00036 };
00037
00038 #include "common.ddl.cpp"
00039
00040
00041
00042 class a_common_t
00043 : public so_4::rt::agent_t
00044 {
00045 typedef so_4::rt::agent_t base_type_t;
00046 public :
00047 a_common_t()
00048 : base_type_t( agent_name() )
00049 {}
00050 virtual ~a_common_t()
00051 {}
00052
00053 virtual const char *
00054 so_query_type() const;
00055
00056 static std::string
00057 agent_name()
00058 {
00059 return "a_common";
00060 }
00061
00062 static std::string
00063 agent_type()
00064 {
00065 return "a_common_t";
00066 }
00067
00068
00069 struct msg_request
00070 {
00071
00072 unsigned int m_uid;
00073
00074 data_t m_data;
00075
00076 msg_request()
00077 {}
00078 msg_request(
00079 unsigned int uid,
00080 unsigned int size )
00081 : m_uid( uid )
00082 , m_data( size )
00083 {}
00084
00085 static bool
00086 check( const msg_request * cmd )
00087 {
00088 return ( 0 != cmd );
00089 }
00090 };
00091
00092
00093 struct msg_reply
00094 {
00095
00096 unsigned int m_uid;
00097
00098 msg_reply()
00099 {}
00100 msg_reply(
00101 unsigned int uid )
00102 : m_uid( uid )
00103 {}
00104
00105 static bool
00106 check( const msg_reply * cmd )
00107 {
00108 return ( 0 != cmd );
00109 }
00110 };
00111 };
00112
00113 SOL4_CLASS_START( a_common_t )
00114
00115 SOL4_MSG_START( msg_request, a_common_t::msg_request )
00116 SOL4_MSG_FIELD( m_uid )
00117 SOL4_MSG_FIELD( m_data )
00118 SOL4_MSG_CHECKER( a_common_t::msg_request::check )
00119 SOL4_MSG_FINISH()
00120
00121 SOL4_MSG_START( msg_reply, a_common_t::msg_reply )
00122 SOL4_MSG_FIELD( m_uid )
00123 SOL4_MSG_CHECKER( a_common_t::msg_reply::check )
00124 SOL4_MSG_FINISH()
00125
00126 SOL4_CLASS_FINISH()