SocketAddressMapper.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-11-18
  6. * Changed: 2022-11-18
  7. *
  8. * */
  9. #ifndef LS_STD_SOCKET_ADDRESS_MAPPER_HPP
  10. #define LS_STD_SOCKET_ADDRESS_MAPPER_HPP
  11. #include <ls_std/core/Class.hpp>
  12. #include <ls_std/os/dynamic_goal.hpp>
  13. #include "ConvertedSocketAddress.hpp"
  14. #include "SocketAddressMapperParameter.hpp"
  15. #if defined(unix) || defined(__APPLE__)
  16. #include <netinet/in.h>
  17. #endif
  18. namespace ls::std::network
  19. {
  20. class LS_STD_DYNAMIC_GOAL SocketAddressMapper : public ls::std::core::Class // TODO: does this make sense, since all methods are static
  21. {
  22. public:
  23. SocketAddressMapper();
  24. ~SocketAddressMapper() override = default;
  25. [[nodiscard]] static ls::std::network::ConvertedSocketAddress from(const ls::std::network::SocketAddressMapperParameter& _parameter);
  26. private:
  27. #if defined(unix) || defined(__APPLE__)
  28. [[nodiscard]] static ::sockaddr_in _toSockAddressUnix(const ls::std::network::SocketAddressMapperParameter& _parameter);
  29. #endif
  30. };
  31. }
  32. #endif