Mercurial > archived > louis > epitech > zia-api
changeset 25:27de48562b2c
Added doc on INetworkHander
author | Zoltan K |
---|---|
date | Sun, 21 Mar 2010 14:35:03 +0100 |
parents | ce4c3431392f |
children | c0213ec8ab71 6ad68d5cb049 |
files | src/include/handler/INetworkHandler.hpp |
diffstat | 1 files changed, 35 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/include/handler/INetworkHandler.hpp Sun Mar 21 14:19:32 2010 +0100 +++ b/src/include/handler/INetworkHandler.hpp Sun Mar 21 14:35:03 2010 +0100 @@ -15,39 +15,53 @@ namespace handler { /** - * @brief this class represent an handler which redefine some basic function - * like accept(2), write(2), read(2) - * - * It allows protocol implementation like ssl + ** @brief This class represents an handler which redefines some basic functions + ** like @b @c accept(2), @b @c write(2), @b @c read(2). + ** + ** It allows protocol implementation like ssl. */ class INetworkHandler { public: /** - * @brief this structure represent functions pointers that can be overloaded - * if an handler does not want to overload one of this function it should set - * the pointer to NULL - * + ** @brief This structure represents function pointers that can be overloaded. + ** If an handler doesn't want to overload one of this function it should set + ** the pointer to @c NULL. + ** */ struct sPtrFunc { /** - * sock_accept return a pointer on IEndpoint. - * if an error happend the pointer returned is null. - * the pointer HAS TO BE ALLOCATED, all memory managment is made by - * the server. + ** @brief accept redefinition, called when we want accept a new connection + ** sock_accept return a pointer on IEndPoint. + ** @param [in] server Holds the accept socket. + ** @return if an error happend the pointer returned is null. + ** the pointer HAS TO BE ALLOCATED using the new operator, + ** all memory managment is made by the server. + ** @see network::IEndPoint */ - network::IEndPoint* (*sock_accept) (network::IEndPoint& server); /**< accept redefinition, called when we want accept a new connection */ + network::IEndPoint* (*sock_accept) (network::IEndPoint& server); /** - * sock_read function returns the number of bytes read, -1 on error and 0 on EOF + ** @brief write redefinition, called when we want to write something on the socket + ** @param [in] client Holds the client socket. + ** @param [out] buffer buffer that should be filled by the function. + ** @param [in] len buffer' size. + ** @return the number of bytes read, -1 on error and 0 on EOF + ** @see network::IEndPoint */ - int (*sock_read)(network::IEndPoint&, void* buffer, size_t len); /**< write redefinition, called when we want to write something on the socket */ + int (*sock_read)(network::IEndPoint& client, void* buffer, size_t len); + /** - * sock_write function returns the number of bytes writen, -1 on error + ** @brief read redefinition, called when we want to read something on the socket + ** @param [in] client Holds the client socket. + ** @param [out] buffer buffer that have to be send. + ** @param [in] len buffer' size. + ** @return the number of bytes written, -1 on error and 0 on EOF + ** @see network::IEndPoint */ - int (*sock_write)(network::IEndPoint&, const void* buffer, size_t len);/**< read redefinition, called when we want to read something on the socket */ + int (*sock_write)(network::IEndPoint&, const void* buffer, size_t len); }; @@ -55,10 +69,10 @@ virtual ~INetworkHandler(void){} /** - * @brief this method return the structure wich contains - * all function pointer redefined - * @return a copy of a structure - * @see sPtrFunc + ** @brief This method returns the structure wich contains + ** all function pointers redefined. + ** @return a copy of a structure + ** @see sPtrFunc */ virtual sPtrFunc getHandlers(void) = 0;