/*] Copyright (c) 2009-2010, Charles McGarvey [************************** **] All rights reserved. * * vi:ts=4 sw=4 tw=75 * * Distributable under the terms and conditions of the 2-clause BSD license; * see the file COPYING for a complete text of the license. * **************************************************************************/ #ifndef _MOOF_SERVICE_HH_ #define _MOOF_SERVICE_HH_ #include #include #include namespace Mf { /** * Class representing a network service. */ class Service { public: /** * Construct a network service. * \param address The address of the host. * \param text The service information. */ Service(const SocketAddress& address, const std::string& text); /** * Get the host address. * \return The address. */ const SocketAddress& address() const; /** * Get the service information. * \return The service information as a string. */ const std::string& text() const; /** * Publish the service on the network. */ void publish(); void update(Scalar t, Scalar dt); private: SocketAddress mAddress; std::string mText; }; class ServiceFinder { public: ServiceFinder(const std::string& service, int type = SOCK_STREAM); void update(Scalar t, Scalar dt); const std::vector& services() const { return mServices; } private: std::vector mServices; }; } // namespace Mf #endif // _MOOF_SERVICE_HH_