From: Maxim Mamontov Date: Wed, 22 Jul 2015 18:02:01 +0000 (+0300) Subject: Reduced public interface. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/62a323c846db0ef869ff7a3030e473835b9f7ac3?ds=inline;hp=20072b367cf034ab9124560e4a06d8e32a388d93 Reduced public interface. --- diff --git a/stglibs/sgcp.lib/include/stg/sgcp_proto.h b/stglibs/sgcp.lib/include/stg/sgcp_proto.h index 04bc3c88..440843a1 100644 --- a/stglibs/sgcp.lib/include/stg/sgcp_proto.h +++ b/stglibs/sgcp.lib/include/stg/sgcp_proto.h @@ -40,8 +40,6 @@ namespace STG namespace SGCP { -class TransportProto; - class Proto { public: diff --git a/stglibs/sgcp.lib/include/stg/sgcp_transport.h b/stglibs/sgcp.lib/include/stg/sgcp_transport.h deleted file mode 100644 index 6e24756a..00000000 --- a/stglibs/sgcp.lib/include/stg/sgcp_transport.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __STG_SGCP_TRANSPORT_H__ -#define __STG_SGCP_TRANSPORT_H__ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -#include "stg/sgcp_types.h" - -#include "stg/os_int.h" - -#include -#include - -#include // ssize_t - -namespace STG -{ -namespace SGCP -{ - -class TransportProto -{ - public: - struct Error : public std::runtime_error { - Error(const std::string& message) : runtime_error(message) {} - }; - - static TransportProto* create(TransportType transport, const std::string& key); - - virtual ~TransportProto() {} - - virtual ConnectionPtr connect(const std::string& address, uint16_t port) = 0; - virtual void bind(const std::string& address, uint16_t port, Proto::AcceptHandler handler) = 0; -}; - -} // namespace SGCP -} // namespace STG - -#endif diff --git a/stglibs/sgcp.lib/transport.h b/stglibs/sgcp.lib/transport.h new file mode 100644 index 00000000..6e24756a --- /dev/null +++ b/stglibs/sgcp.lib/transport.h @@ -0,0 +1,56 @@ +#ifndef __STG_SGCP_TRANSPORT_H__ +#define __STG_SGCP_TRANSPORT_H__ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Author : Maxim Mamontov + */ + +#include "stg/sgcp_types.h" + +#include "stg/os_int.h" + +#include +#include + +#include // ssize_t + +namespace STG +{ +namespace SGCP +{ + +class TransportProto +{ + public: + struct Error : public std::runtime_error { + Error(const std::string& message) : runtime_error(message) {} + }; + + static TransportProto* create(TransportType transport, const std::string& key); + + virtual ~TransportProto() {} + + virtual ConnectionPtr connect(const std::string& address, uint16_t port) = 0; + virtual void bind(const std::string& address, uint16_t port, Proto::AcceptHandler handler) = 0; +}; + +} // namespace SGCP +} // namespace STG + +#endif