00001 00002 // 00003 // Fichero : fnasocket.h 00004 // Autor : 00005 // Fecha creacion : 00006 // 00007 // Descripcion : Objeto funcion que escribe mensajes a un fichero 00008 // 00009 // Notas 00010 // - 00012 00013 #ifndef __ASOCKET_H__ 00014 #define __ASOCKET_H__ 00015 00016 #include "jic/exc/excepcion.hpp" 00017 #include "jic/task/CFnConsumer.hpp" 00018 #include "jic/task/CMessageBlock.hpp" 00019 #include "jic/socket/sockets.hpp" 00020 #include "jic/socket/connector.hpp" 00021 00022 namespace TASK { 00023 namespace CONSUMERS { 00024 00025 //----------------------------------------------------------------- 00026 // Clase Template : FnASocket 00027 //----------------------------------------------------------------- 00028 template<class Mensaje> 00029 class FnASocket : public TASK::CFnConsumer<Mensaje> 00030 { 00031 public: 00032 FnASocket(std::string ip, int puerto); 00033 // throw (ExcFicheroNoEncontrado) 00034 00035 void operator() (TASK::CMessageBlock<Mensaje> *data); 00036 00037 protected: 00038 SOCKETS::Servicio svc; 00039 SOCKETS::Connector<SOCKETS::Servicio> conn; 00040 }; 00041 00042 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE 00043 #include "fnasocket.cpp" 00044 #endif 00045 00046 } // CONSUMERS 00047 } // TASK 00048 00049 #endif