00001 /*************************************************************************** 00002 * Copyright (C) 2001 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the conexus library. * 00006 * * 00007 * The conexus library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The conexus library is distributed in the hope that it will be * 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef CONEXUSENDPOINTSERVER_H 00020 #define CONEXUSENDPOINTSERVER_H 00021 00022 #include <conexus/server.h> 00023 #include <conexus/endpoint.h> 00024 00033 #define CONEXUS_ENDPOINTSERVER_GENERIC_CREATE() static EndpointServer::pointer generic_create() { return create(); } 00034 00035 namespace Conexus 00036 { 00037 00049 class EndpointServer : public Server 00050 { 00051 00052 protected: 00053 00054 EndpointServer(); 00055 00056 public: 00057 typedef ConexusPointer<EndpointServer> pointer; 00058 00059 virtual ~EndpointServer(); 00060 00065 sigc::signal<void, Endpoint::pointer> signal_new_endpoint(); 00066 00067 protected: 00068 sigc::signal<void, Endpoint::pointer> m_signal_new_endpoint; 00069 std::queue<Endpoint::pointer> m_endpoint_queue; 00070 00071 Glib::Mutex m_mutex_signal_endpoint; 00072 Glib::Mutex m_mutex_endpoint_queue; 00073 00074 Glib::Dispatcher* m_dispatcher; 00075 sigc::connection m_dispatcher_connection; 00076 00077 virtual void queue_endpoint( Endpoint::pointer endpoint ); 00078 void emit( ); 00079 00080 }; 00081 00082 } 00083 00084 #endif