From 16a7442db916bc83613175b40ce8904d844107e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20H=C3=B6schele?= Date: Thu, 29 Jul 2021 19:48:01 +0200 Subject: [PATCH] rename unuseable template functions --- AnTCP.Server.Sample/src/Main.cpp | 6 +++--- AnTCP.Server/src/AnTcpServer.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AnTCP.Server.Sample/src/Main.cpp b/AnTCP.Server.Sample/src/Main.cpp index af0273d..bd287e3 100644 --- a/AnTCP.Server.Sample/src/Main.cpp +++ b/AnTCP.Server.Sample/src/Main.cpp @@ -40,19 +40,19 @@ int __stdcall SigIntHandler(unsigned long signal) void AddCallback(ClientHandler* handler, char type, const void* data, int size) { int c = ((int*)data)[0] + ((int*)data)[1]; - handler->SendData(type, c); + handler->SendDataVar(type, c); } void SubtractCallback(ClientHandler* handler, char type, const void* data, int size) { int c = ((int*)data)[0] - ((int*)data)[1]; - handler->SendData(type, c); + handler->SendDataVar(type, c); } void MultiplyCallback(ClientHandler* handler, char type, const void* data, int size) { int c = ((int*)data)[0] * ((int*)data)[1]; - handler->SendData(type, c); + handler->SendDataVar(type, c); } void MinAvgMaxCallback(ClientHandler* handler, char type, const void* data, int size) diff --git a/AnTCP.Server/src/AnTcpServer.hpp b/AnTCP.Server/src/AnTcpServer.hpp index 0cd3bb8..52e8693 100644 --- a/AnTCP.Server/src/AnTcpServer.hpp +++ b/AnTCP.Server/src/AnTcpServer.hpp @@ -106,7 +106,7 @@ class ClientHandler /// Data to send. /// True if data was sent, false if not. template - constexpr bool SendData(AnTcpMessageType type, const T data) const noexcept + constexpr bool SendDataVar(AnTcpMessageType type, const T data) const noexcept { return SendData(type, &data, sizeof(T)); } @@ -122,7 +122,7 @@ class ClientHandler /// Data to send. /// True if data was sent, false if not. template - constexpr bool SendData(AnTcpMessageType type, const T* data) const noexcept + constexpr bool SendDataPtr(AnTcpMessageType type, const T* data) const noexcept { return SendData(type, data, sizeof(T)); }