Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_MessageExternal.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_MESSAGEEXTERNAL_H
00021 #define _C_MESSAGEEXTERNAL_H
00022 
00023 #include "iostream_t.hpp"
00024 #include "C_MessageFrame.hpp"
00025 #include "C_GeneratorConfig.hpp"
00026 #include "C_ContextFrame.hpp"
00027 
00028 #include "C_RegExp.hpp"
00029 
00030 class C_ProtocolExternal ;
00031 
00032 
00033 class C_MessageExternal : public C_MessageFrame {
00034 public:
00035   C_MessageExternal ();
00036   C_MessageExternal (C_MessageExternal&);
00037   virtual ~C_MessageExternal ();
00038 
00039   T_pValueData get_session_id (C_ContextFrame *P_ctxt) ;
00040   T_pValueData get_type () ;
00041 
00042   bool         compare_types (C_MessageFrame *P_ref) ;
00043   bool         update_fields (C_MessageFrame *P_ref) ;
00044 
00045   void         update_message_stats ()      ;
00046 
00047   bool         check (C_MessageFrame  *P_ref, 
00048                       unsigned int     P_levelMask,
00049                       T_CheckBehaviour P_behave) ;
00050   bool         check_field_presence (int              P_id,
00051                                      T_CheckBehaviour P_behave,
00052                                      int              P_instance,
00053                                      int              P_sub_id) ;
00054 
00055 
00056   bool         check_field_value (C_MessageFrame  *P_ref,
00057                                   int              P_id,
00058                                   T_CheckBehaviour P_behave,
00059                                   int              P_instance,
00060                                   int              P_sub_id) ;
00061 
00062   bool         check_field_order (int              P_id,
00063                                   T_CheckBehaviour P_behave,
00064                                   int              P_position);
00065 
00066 
00067   T_TypeType   get_field_type  (int P_id,
00068                                 int P_sub_id)                   ;
00069 
00070   friend class C_ProtocolExternal ;
00071 
00072 
00073   bool       get_field_value(int P_id, 
00074                              C_RegExp *P_reg,
00075                              T_pValueData P_value) ;
00076 
00077 
00078   int         get_buffer (T_pValueData P_dest,
00079                           T_MessagePartType P_header_body_type) ;
00080 
00081 
00082   bool         get_field_value (int P_id, 
00083                                 int P_instance,
00084                                 int P_sub_id,
00085                                 T_pValueData P_value) ;
00086 
00087   bool         set_field_value (T_pValueData P_value, 
00088                                 int P_id,
00089                                 int P_instance,
00090                                 int P_sub_id) ;
00091 
00092   C_MessageExternal& operator= (C_MessageExternal & P_val);
00093 
00094   friend iostream_output& operator<< (iostream_output&, C_MessageExternal &);
00095 
00096   void dump(iostream_output&);
00097 
00098   char* name();
00099 
00100   int get_id_message() ;
00101 
00102 
00103 
00104   static void set_protocol_data (int P_nb_header_fields,
00105                                  int P_nb_body_values,
00106                                  int P_nb_body_fields,
00107                                  int P_session_id,
00108                                  int P_outof_session_id,
00109                                  int P_type_id,
00110                                  char** P_names,
00111                                  char** P_message_names,
00112                                  bool** P_body_not_present_table,
00113                                  bool** P_header_not_present_table);
00114 
00115 
00116   static int get_nb_header_fields () ;
00117   static int get_nb_body_values   () ;
00118   static int get_nb_body_fields   () ;
00119   
00120 protected:
00121 private:
00122 
00123   typedef T_pValueData (C_MessageExternal::* T_GetId)(int);
00124   typedef T_pValueData (C_MessageExternal::* T_GetId_instance)(int, int);
00125 
00126   static int m_nb_header_fields         ;
00127   static int m_nb_body_values           ;
00128   static int m_nb_body_fields           ;
00129 
00130   static int m_session_id               ;
00131   static int m_outof_session_id         ;
00132   static int m_type_id                  ;
00133 
00134   static T_GetId_instance m_get_id               ;
00135 
00136   static T_GetId_instance  m_get_outof_session_id ;
00137   static T_GetId m_get_type             ;
00138 
00139   static char ** m_names              ;
00140   static char ** m_message_names      ;
00141 
00142   static bool ** m_body_not_present_table      ;
00143   static bool ** m_header_not_present_table    ;
00144 
00145   C_ProtocolExternal *m_protocol    ;
00146   T_pValueData        m_header      ;
00147 
00148   T_pMultiValueData   m_body       ;
00149   int                 m_nb_values  ;
00150 
00151 
00152   T_pValueData       *m_all_values ;
00153   int                *m_ids        ;
00154 
00155   int                 m_id          ;
00156 
00157   T_pValueData get_out_of_session_id () ;
00158   void internal_reset () ;
00159 
00160   C_MessageExternal (C_ProtocolExternal *P_protocol,
00161                      T_pValueData        P_header, 
00162                      T_pValueDataList    P_body,       
00163                      list_t<int>        *P_body_id,
00164                      int                *P_instance_body);
00165 
00166 
00167 
00168   T_pValueData get_id_header (int P_id, int P_instance)     ;
00169 
00170   T_pValueData get_id_body (int P_id, int P_instance)       ;
00171 
00172   T_pValueData  get_type_header (int P_id) ;
00173 
00174   T_pValueData  get_type_body (int P_id) ;
00175 
00176 
00177 
00178 } ;
00179 
00180 #endif // _C_MESSAGEEXTERNAL_H
00181 
00182 
00183 
00184 
00185 
00186 
00187 

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