Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_ProtocolFrame.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
00017  *
00018  */
00019 
00020 #ifndef    _C_PROTOCOLFRAME_H
00021 #define    _C_PROTOCOLFRAME_H
00022 
00023 #include "C_MessageFrame.hpp"
00024 #include "list_t.hpp"
00025 #include "ExternalMethod.h"
00026 #include "ParamDefConfig.h"
00027 
00028 
00029 class C_ProtocolStatsFrame ;
00030 
00031 typedef struct _struct_inst_data {
00032   char *m_instance_name  ;
00033   int   m_instance_id    ;
00034   int   m_id             ;
00035 } T_InstanceData, *T_pInstanceData ;
00036 
00037 typedef list_t<T_InstanceData> T_InstanceDataList, 
00038   *T_pInstanceDataList ;
00039 
00040 typedef struct _struct_name_id {
00041   char *m_name;
00042   int   m_id  ;
00043 } T_NameAndId, *T_pNameAndId ;
00044 typedef list_t<T_NameAndId> T_NameAndIdList, *T_pNameAndIdList ;
00045 
00046 
00047 class C_ProtocolFrame { // Protocol Frame Definition Class
00048 
00049 public:
00050 
00051 
00052 
00053   typedef enum _protocol_type {
00054     E_PROTOCOL_BINARY,
00055     E_PROTOCOL_EXTERNAL,
00056     E_PROTOCOL_TEXT,
00057     E_PROTOCOL_UNKNOWN
00058   } T_ProtocolType, *T_pProtocolType ;
00059 
00060   typedef enum _msg_error_code {
00061     E_MSG_OK = 0,
00062     E_MSG_ERROR_DECODING,
00063     E_MSG_ERROR_DECODING_SIZE_LESS,
00064     E_MSG_ERROR_ENCODING,
00065     E_MSG_EXTERNAL_ERROR, // used for EXTERNAL protocol type
00066     E_MSG_INTERNAL_ERROR  // used for EXTERNAL protocol type
00067   } T_MsgError, *T_pMsgError ;
00068 
00069 
00070            C_ProtocolFrame() {m_type = E_PROTOCOL_UNKNOWN; m_name=NULL; m_stats = NULL;} ;
00071   virtual ~C_ProtocolFrame() {} ;
00072 
00073   T_ProtocolType get_type() { return (m_type); }
00074 
00075 
00076   virtual C_MessageFrame* create_new_message (C_MessageFrame *P_msg) = 0 ;
00077 
00078   // void * for P_Xml parameter: 
00079   //     Xml internal format not exported for transport  
00080   virtual C_MessageFrame* create_new_message (void               *P_xml,
00081                                               T_pInstanceDataList P_list,
00082                                               int                *P_nb_body_value) = 0 ;
00083 
00084   virtual char*            message_name                 () = 0 ;
00085   virtual char*            message_component_name       () = 0 ;
00086   virtual T_pNameAndIdList message_name_list            () = 0 ;
00087   virtual T_pNameAndIdList message_component_name_list  () = 0 ;
00088   virtual bool             find_present_session (int P_msg_id,int P_id) = 0 ;
00089 
00090 
00091 
00092   // find field id from field name (to be used in the dictionnary)
00093   virtual int              find_field (char *P_name)          = 0 ;
00094   virtual T_TypeType       get_field_type (int P_id,
00095                                            int P_sub_id)      = 0 ;
00096   virtual bool             check_sub_entity_needed (int P_id) = 0 ;
00097 
00098   C_ProtocolStatsFrame*    get_stats () { return (m_stats); }
00099   void                     set_stats (C_ProtocolStatsFrame *P_stats) {
00100     m_stats = P_stats ;
00101   }
00102 
00103   virtual T_ExternalMethod find_method_extern(char *P_name){return NULL;} 
00104 
00105 
00106   char* name() { return(m_name); }
00107 
00108 protected:
00109 
00110   C_ProtocolStatsFrame *m_stats ;
00111   T_ProtocolType        m_type ;
00112   char                 *m_name ;
00113 
00114 } ;
00115 
00116 typedef C_ProtocolFrame *T_pC_ProtocolFrame ;
00117 
00118 
00119 #endif  // _C_PROTOCOLFRAME_H
00120 
00121 
00122 
00123 

Generated on Wed Mar 7 14:44:54 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002