Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_TransportControl.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_TRANSPORTCONTROL_H
00021 #define _C_TRANSPORTCONTROL_H
00022 
00023 
00024 #include "string_t.hpp"
00025 #include "map_t.hpp"
00026 #include "select_t.hpp"
00027 
00028 #include "C_IdGenerator.hpp"
00029 #include "C_XmlData.hpp"
00030 #include "C_Transport.hpp"
00031 
00032 #include "C_ProtocolFrame.hpp"
00033 
00034 
00035 #define ERROR_TRANSPORT_UNKNOWN -1
00036 typedef map_t<string_t, int> T_TransportNameMap, *T_pTransportNameMap ;
00037 
00038 class C_TransportControl {
00039 
00040 public:
00041 
00042   typedef struct _transport_context {
00043     int                        m_id       ;
00044     T_pTransport               m_instance ;
00045     T_TransportCreateInstance  m_ext_create ;
00046     T_TransportDeleteInstance  m_ext_delete ;
00047     void                      *m_lib_handle ;
00048   } T_TransportContext, *T_pTransportContext ;
00049 
00050    C_TransportControl(T_logFunction P_logError, 
00051                       T_logFunction P_logInfo) ;
00052   ~C_TransportControl() ;
00053 
00054   bool fromXml (C_XmlData *P_data) ;
00055 
00056   bool set_config_value(T_pConfigValueList P_config_value_list) ;
00057 
00058   C_Transport*        get_transport         (char *P_name);
00059   C_Transport*        get_transport         (int   P_id);
00060   T_pTransportContext get_transport_context (int   P_id);
00061   int                 get_transport_id      (char *P_name);
00062 
00063   T_SelectDef  get_call_select () ;
00064 
00065 protected:
00066 
00067 private:
00068 
00069   T_pTransportNameMap   m_name_map       ;
00070   T_pTransportContext  *m_transport_context_table ;
00071   int                   m_transport_table_size ;
00072   T_pC_IdGenerator      m_id_gen         ;
00073 
00074   T_logFunction         m_log_error, m_log_info ;
00075 
00076   bool                  update_context(T_pTransportContext  P_context,
00077                                        void                *P_value);
00078 
00079   T_SelectDef           m_call_select ;
00080 
00081 } ;
00082 
00083 #endif
00084 
00085 
00086 
00087 

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