SocketAddressMapper.hpp 1.1 KB

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