X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fservice.hh;fp=src%2FMoof%2FService.hh;h=6db1d964b1e47a76c0cfc2c77af0fb9962a8f374;hp=570a2309e270cb235a7abe7e1b8819d12a7264a6;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hpb=299af4f2047e767e5d79501c26444473bda64c64 diff --git a/src/Moof/Service.hh b/src/moof/service.hh similarity index 68% rename from src/Moof/Service.hh rename to src/moof/service.hh index 570a230..6db1d96 100644 --- a/src/Moof/Service.hh +++ b/src/moof/service.hh @@ -9,27 +9,27 @@ * **************************************************************************/ +#ifndef _MOOF_SERVICE_HH_ +#define _MOOF_SERVICE_HH_ + /** - * \file Service.hh + * \file service.hh * Classes for publishing and finding network services. */ -#ifndef _MOOF_SERVICE_HH_ -#define _MOOF_SERVICE_HH_ - #include -#include -#include +#include +#include -namespace Mf { +namespace moof { /** * Class representing a network service. */ -class Service +class service { public: @@ -40,7 +40,7 @@ public: * \param name The service name. * \param text The service information. */ - Service(const SocketAddress& address, + service(const socket::address& address, const std::string& type, const std::string& name, const std::string& text); @@ -52,7 +52,7 @@ public: * \param name The service name. * \param text The service information. */ - Service(const SocketAddress& address, + service(const socket::address& address, const std::string& name, const std::string& text); @@ -72,9 +72,9 @@ public: * Get the host address. * \return The address. */ - const SocketAddress& address() const + const socket::address& address() const { - return mAddress; + return address_; } /** @@ -83,7 +83,7 @@ public: */ const std::string& type() const { - return mType; + return type_; } /** @@ -92,7 +92,7 @@ public: */ const std::string& name() const { - return mName; + return name_; } /** @@ -101,27 +101,27 @@ public: */ const std::string& text() const { - return mText; + return text_; } - ~Service(); + ~service(); private: - int handlePacket(SocketMultiplexer& mux, - Packet& packet, - const SocketAddress& address); + int handle_packet(socket_multiplexer& mux, + packet& packet, + const socket::address& address); - SocketAddress mAddress; - std::string mType; - std::string mName; - std::string mText; + socket::address address_; + std::string type_; + std::string name_; + std::string text_; }; -class ServiceFinder +class service_finder { public: @@ -130,35 +130,35 @@ public: * address. * \address The address. */ - explicit ServiceFinder(const SocketAddress& address); + explicit service_finder(const socket::address& address); /** * Construct a service finder to find services of a certain type. * \param type The type of the service. * \param sockType The type of socket. */ - explicit ServiceFinder(const std::string& type, - int sockType = SOCK_STREAM); + explicit service_finder(const std::string& type, + int sockType = SOCK_STREAM); - const std::map& services() const + const std::map& services() const { - return mServices; + return services_; } private: - int handlePacket(SocketMultiplexer& mux, - Packet& packet, - const SocketAddress& address); + int handle_packet(socket_multiplexer& mux, + packet& packet, + const socket::address& address); - std::string mType; - std::map mServices; + std::string type_; + std::map services_; }; -} // namespace Mf +} // namespace moof #endif // _MOOF_SERVICE_HH_