52#include <unordered_map>
53#include <unordered_set>
69 std::is_same_v<S,boost::asio::ip::tcp::socket>
70 || std::is_same_v<S,boost::asio::local::stream_protocol::socket>
71 || std::is_same_v<S,boost::asio::generic::stream_protocol::socket>;
90 static bool Read(boost::asio::ip::tcp::socket & s, uint8_t & value,
91 boost::system::error_code & ec);
97 static bool Write(boost::asio::ip::tcp::socket & s, uint8_t value,
98 boost::system::error_code & ec);
104 static bool Read(boost::asio::local::stream_protocol::socket & s,
105 uint8_t & value, boost::system::error_code & ec);
111 static bool Write(boost::asio::local::stream_protocol::socket & s,
112 uint8_t value, boost::system::error_code & ec);
118 static bool Read(boost::asio::generic::stream_protocol::socket & s,
119 uint8_t & value, boost::system::error_code & ec);
125 static bool Write(boost::asio::generic::stream_protocol::socket & s,
126 uint8_t value, boost::system::error_code & ec);
132 static bool Read(boost::asio::ip::tcp::socket & s,
bool & value,
133 boost::system::error_code & ec);
139 static bool Write(boost::asio::ip::tcp::socket & s,
bool value,
140 boost::system::error_code & ec);
146 static bool Read(boost::asio::local::stream_protocol::socket & s,
147 bool & value, boost::system::error_code & ec);
153 static bool Write(boost::asio::local::stream_protocol::socket & s,
154 bool value, boost::system::error_code & ec);
160 static bool Read(boost::asio::generic::stream_protocol::socket & s,
161 bool & value, boost::system::error_code & ec);
167 static bool Write(boost::asio::generic::stream_protocol::socket & s,
168 bool value, boost::system::error_code & ec);
174 static bool Read(boost::asio::ip::tcp::socket & s, uint16_t & value,
175 boost::system::error_code & ec);
181 static bool Write(boost::asio::ip::tcp::socket & s, uint16_t value,
182 boost::system::error_code & ec);
188 static bool Read(boost::asio::local::stream_protocol::socket & s,
189 uint16_t & value, boost::system::error_code & ec);
195 static bool Write(boost::asio::local::stream_protocol::socket & s,
196 uint16_t value, boost::system::error_code & ec);
202 static bool Read(boost::asio::generic::stream_protocol::socket & s,
203 uint16_t & value, boost::system::error_code & ec);
209 static bool Write(boost::asio::generic::stream_protocol::socket & s,
210 uint16_t value, boost::system::error_code & ec);
216 static bool Read(boost::asio::ip::tcp::socket & s, uint32_t & value,
217 boost::system::error_code & ec);
223 static bool Write(boost::asio::ip::tcp::socket & s, uint32_t value,
224 boost::system::error_code & ec);
230 static bool Read(boost::asio::local::stream_protocol::socket & s,
231 uint32_t & value, boost::system::error_code & ec);
237 static bool Write(boost::asio::local::stream_protocol::socket & s,
238 uint32_t value, boost::system::error_code & ec);
244 static bool Read(boost::asio::generic::stream_protocol::socket & s,
245 uint32_t & value, boost::system::error_code & ec);
251 static bool Write(boost::asio::generic::stream_protocol::socket & s,
252 uint32_t value, boost::system::error_code & ec);
258 static bool Read(boost::asio::ip::tcp::socket & s, uint64_t & value,
259 boost::system::error_code & ec);
265 static bool Write(boost::asio::ip::tcp::socket & s, uint64_t value,
266 boost::system::error_code & ec);
272 static bool Read(boost::asio::local::stream_protocol::socket & s,
273 uint64_t & value, boost::system::error_code & ec);
279 static bool Write(boost::asio::local::stream_protocol::socket & s,
280 uint64_t value, boost::system::error_code & ec);
286 static bool Read(boost::asio::generic::stream_protocol::socket & s,
287 uint64_t & value, boost::system::error_code & ec);
293 static bool Write(boost::asio::generic::stream_protocol::socket & s,
294 uint64_t value, boost::system::error_code & ec);
300 static bool Read(boost::asio::ip::tcp::socket & s, int8_t & value,
301 boost::system::error_code & ec);
307 static bool Write(boost::asio::ip::tcp::socket & s, int8_t value,
308 boost::system::error_code & ec);
314 static bool Read(boost::asio::local::stream_protocol::socket & s,
315 int8_t & value, boost::system::error_code & ec);
321 static bool Write(boost::asio::local::stream_protocol::socket & s,
322 int8_t value, boost::system::error_code & ec);
328 static bool Read(boost::asio::generic::stream_protocol::socket & s,
329 int8_t & value, boost::system::error_code & ec);
335 static bool Write(boost::asio::generic::stream_protocol::socket & s,
336 int8_t value, boost::system::error_code & ec);
342 static bool Read(boost::asio::ip::tcp::socket & s, int16_t & value,
343 boost::system::error_code & ec);
349 static bool Write(boost::asio::ip::tcp::socket & s, int16_t value,
350 boost::system::error_code & ec);
356 static bool Read(boost::asio::local::stream_protocol::socket & s,
357 int16_t & value, boost::system::error_code & ec);
363 static bool Write(boost::asio::local::stream_protocol::socket & s,
364 int16_t value, boost::system::error_code & ec);
370 static bool Read(boost::asio::generic::stream_protocol::socket & s,
371 int16_t & value, boost::system::error_code & ec);
377 static bool Write(boost::asio::generic::stream_protocol::socket & s,
378 int16_t value, boost::system::error_code & ec);
384 static bool Read(boost::asio::ip::tcp::socket & s, int32_t & value,
385 boost::system::error_code & ec);
391 static bool Write(boost::asio::ip::tcp::socket & s, int32_t value,
392 boost::system::error_code & ec);
398 static bool Read(boost::asio::local::stream_protocol::socket & s,
399 int32_t & value, boost::system::error_code & ec);
405 static bool Write(boost::asio::local::stream_protocol::socket & s,
406 int32_t value, boost::system::error_code & ec);
412 static bool Read(boost::asio::generic::stream_protocol::socket & s,
413 int32_t & value, boost::system::error_code & ec);
419 static bool Write(boost::asio::generic::stream_protocol::socket & s,
420 int32_t value, boost::system::error_code & ec);
426 static bool Read(boost::asio::ip::tcp::socket & s, int64_t & value,
427 boost::system::error_code & ec);
433 static bool Write(boost::asio::ip::tcp::socket & s, int64_t value,
434 boost::system::error_code & ec);
440 static bool Read(boost::asio::local::stream_protocol::socket & s,
441 int64_t & value, boost::system::error_code & ec);
447 static bool Write(boost::asio::local::stream_protocol::socket & s,
448 int64_t value, boost::system::error_code & ec);
454 static bool Read(boost::asio::generic::stream_protocol::socket & s,
455 int64_t & value, boost::system::error_code & ec);
461 static bool Write(boost::asio::generic::stream_protocol::socket & s,
462 int64_t value, boost::system::error_code & ec);
468 static bool Read(boost::asio::ip::tcp::socket & s, std::string & value,
469 boost::system::error_code & ec);
475 static bool Write(boost::asio::ip::tcp::socket & s,
476 const std::string & value,
477 boost::system::error_code & ec);
483 static bool Read(boost::asio::local::stream_protocol::socket & s,
484 std::string & value, boost::system::error_code & ec);
490 static bool Write(boost::asio::local::stream_protocol::socket & s,
491 const std::string & value,
492 boost::system::error_code & ec);
498 static bool Read(boost::asio::generic::stream_protocol::socket & s,
499 std::string & value, boost::system::error_code & ec);
505 static bool Write(boost::asio::generic::stream_protocol::socket & s,
506 const std::string & value,
507 boost::system::error_code & ec);
520 static bool Read(boost::asio::ip::tcp::socket & s,
float & val,
521 boost::system::error_code & ec);
528 static bool Write(boost::asio::ip::tcp::socket & s,
float val,
529 boost::system::error_code & ec);
536 static bool Read(boost::asio::local::stream_protocol::socket & s,
537 float & val, boost::system::error_code & ec);
544 static bool Write(boost::asio::local::stream_protocol::socket & s,
545 float val, boost::system::error_code & ec);
552 static bool Read(boost::asio::generic::stream_protocol::socket & s,
553 float & val, boost::system::error_code & ec);
560 static bool Write(boost::asio::generic::stream_protocol::socket & s,
561 float val, boost::system::error_code & ec);
568 static bool Read(boost::asio::ip::tcp::socket & s,
double & val,
569 boost::system::error_code & ec);
576 static bool Write(boost::asio::ip::tcp::socket & s,
double val,
577 boost::system::error_code & ec);
584 static bool Read(boost::asio::local::stream_protocol::socket & s,
585 double & val, boost::system::error_code & ec);
592 static bool Write(boost::asio::local::stream_protocol::socket & s,
593 double val, boost::system::error_code & ec);
600 static bool Read(boost::asio::generic::stream_protocol::socket & s,
601 double & val, boost::system::error_code & ec);
608 static bool Write(boost::asio::generic::stream_protocol::socket & s,
609 double val, boost::system::error_code & ec);
615 template <
typename S,
typename _firstT,
typename _secondT>
617 static bool Read(S & s, std::pair<_firstT, _secondT> & p,
618 boost::system::error_code & ec)
621 if (
Read(s, p.first, ec)) {
622 rc =
Read(s, p.second, ec);
631 template <
typename S,
typename _firstT,
typename _secondT>
633 static bool Write(S & s,
const std::pair<_firstT,_secondT> & p,
634 boost::system::error_code & ec)
637 if (
Write(s, p.first, ec)) {
638 rc =
Write(s, p.second, ec);
647 template <
typename S,
typename... Args>
649 static bool Read(S & s, std::tuple<Args...> & t,
650 boost::system::error_code & ec)
652 return(std::apply([&s,&ec](
auto&&...args)
654 auto read_tuple_mem = [&s,&ec](
auto&& x) {
return Read(s, x, ec); };
655 return (read_tuple_mem(args) && ...);
663 template <
typename S,
typename... Args>
665 static bool Write(S & s,
const std::tuple<Args...> & t,
666 boost::system::error_code & ec)
668 return(std::apply([&s,&ec](
auto&&...args)
670 auto write_tuple_mem = [&s,&ec](
auto&& x) {
return Write(s, x, ec); };
671 return (write_tuple_mem(args) && ...);
679 template <
typename S,
typename... Ts>
681 static bool Read(S & s, std::variant<Ts...> & v,
682 boost::system::error_code & ec)
686 if (
Read(s, index, ec)) {
687 if (index < std::variant_size_v<std::variant<Ts...>>) {
690 std::visit([&] (
auto && arg) { rc &=
Read(s, arg, ec); }, v);
700 template <
typename S,
typename... Ts>
702 static bool Write(S & s,
const std::variant<Ts...> & v,
703 boost::system::error_code & ec)
706 uint64_t index = v.index();
707 if (
Write(s, index, ec)) {
709 std::visit([&] (
const auto & arg) { rc &=
Write(s, arg, ec); }, v);
718 template <
typename S,
typename _valueT,
size_t N>
720 static bool Read(S & s, std::array<_valueT, N> & a,
721 boost::system::error_code & ec)
724 for ( ; i < N; ++i) {
725 if (!
Read(s, a[i], ec)) {
736 template <
typename S,
typename _valueT,
size_t N>
738 static bool Write(S & s,
const std::array<_valueT, N> & a,
739 boost::system::error_code & ec)
742 for ( ; i < N; ++i) {
743 if (!
Write(s, a[i], ec)) {
754 template <
typename S,
typename _valueT,
typename _Alloc>
756 static bool Read(S & s, std::vector<_valueT, _Alloc> & v,
757 boost::system::error_code & ec)
759 return ContainerRead<S,std::vector<_valueT, _Alloc> >(s, v, ec);
766 template <
typename S,
typename _valueT,
typename _Alloc>
768 static bool Write(S & s,
const std::vector<_valueT, _Alloc> & v,
769 boost::system::error_code & ec)
771 return ContainerWrite<S,std::vector<_valueT, _Alloc> >(s, v, ec);
778 template <
typename S,
typename _valueT,
typename _Alloc>
780 static bool Read(S & s, std::deque<_valueT, _Alloc> & d,
781 boost::system::error_code & ec)
783 return ContainerRead<S,std::deque<_valueT, _Alloc> >(s, d, ec);
790 template <
typename S,
typename _valueT,
typename _Alloc>
792 static bool Write(S & s,
const std::deque<_valueT, _Alloc> & d,
793 boost::system::error_code & ec)
795 return ContainerWrite<S,std::deque<_valueT, _Alloc> >(s, d, ec);
802 template <
typename S,
typename _valueT,
typename _Alloc>
804 static bool Read(S & s, std::list<_valueT, _Alloc> & l,
805 boost::system::error_code & ec)
807 return ContainerRead<S,std::list<_valueT, _Alloc> >(s, l, ec);
814 template <
typename S,
typename _valueT,
typename _Alloc>
816 static bool Write(S & s,
const std::list<_valueT, _Alloc> & l,
817 boost::system::error_code & ec)
819 return ContainerWrite<S,std::list<_valueT, _Alloc> >(s, l, ec);
826 template <
typename S,
typename _keyT,
typename _valueT,
827 typename _Compare,
typename _Alloc>
829 static bool Read(S & s, std::map<_keyT, _valueT, _Compare, _Alloc> & m,
830 boost::system::error_code & ec)
832 return(PairAssocContRead<S,std::map<_keyT, _valueT, _Compare, _Alloc> >(s, m, ec));
839 template <
typename S,
typename _keyT,
typename _valueT,
840 typename _Compare,
typename _Alloc>
843 const std::map<_keyT,_valueT, _Compare, _Alloc> & m,
844 boost::system::error_code & ec)
846 return(ContainerWrite<S,std::map<_keyT,_valueT,_Compare,_Alloc> >(s, m, ec));
853 template <
typename S,
typename _keyT,
typename _valueT,
854 typename _Compare,
typename _Alloc>
856 static bool Read(S & s, std::multimap<_keyT,_valueT,_Compare,_Alloc> & m,
857 boost::system::error_code & ec)
859 return(PairAssocContRead<S,std::multimap<_keyT,_valueT,_Compare,_Alloc>>(s, m, ec));
866 template <
typename S,
typename _keyT,
typename _valueT,
867 typename _Compare,
typename _Alloc>
871 const std::multimap<_keyT,_valueT, _Compare, _Alloc> & m,
872 boost::system::error_code & ec)
874 return(ContainerWrite<S,std::multimap<_keyT,_valueT,_Compare,_Alloc>>(s, m, ec));
881 template <
typename S,
typename _keyT,
typename _valueT,
882 typename _Hash,
typename _Pred,
typename _Alloc>
885 Read(S & s, std::unordered_map<_keyT, _valueT, _Hash, _Pred, _Alloc> & m,
886 boost::system::error_code & ec)
888 return(PairAssocContRead<S,std::unordered_map<_keyT, _valueT, _Hash, _Pred, _Alloc> >(s, m, ec));
895 template <
typename S,
typename _keyT,
typename _valueT,
896 typename _Hash,
typename _Pred,
typename _Alloc>
900 const std::unordered_map<_keyT, _valueT, _Hash, _Pred, _Alloc> & m,
901 boost::system::error_code & ec)
903 return(ContainerWrite<S,std::unordered_map<_keyT,_valueT,_Hash,_Pred,_Alloc> >(s, m, ec));
910 template <
typename S,
typename _valueT,
typename _Compare,
typename _Alloc>
913 std::set<_valueT,_Compare,_Alloc> & m,
914 boost::system::error_code & ec)
916 return(ContainerRead<S,std::set<_valueT,_Compare,_Alloc>>(s, m, ec));
923 template <
typename S,
typename _valueT,
typename _Compare,
typename _Alloc>
925 static bool Write(S & s,
const std::set<_valueT,_Compare,_Alloc> & m,
926 boost::system::error_code & ec)
928 return(ContainerWrite<S,std::set<_valueT,_Compare,_Alloc>>(s, m, ec));
935 template <
typename S,
typename _valueT,
typename _Compare,
typename _Alloc>
937 static bool Read(S & s, std::multiset<_valueT,_Compare,_Alloc> & m,
938 boost::system::error_code & ec)
940 return(ContainerRead<S,std::multiset<_valueT,_Compare,_Alloc>>(s, m, ec));
947 template <
typename S,
typename _valueT,
typename _Compare,
typename _Alloc>
950 const std::multiset<_valueT,_Compare,_Alloc> & m,
951 boost::system::error_code & ec)
953 return(ContainerWrite<S,std::multiset<_valueT,_Compare,_Alloc>>(s, m, ec));
960 template <
typename S,
typename _valueT,
typename _Hash,
961 typename _Pred,
typename _Alloc>
964 Read(S & s, std::unordered_set<_valueT, _Hash, _Pred, _Alloc> & m,
965 boost::system::error_code & ec)
967 return(ContainerRead<S,std::unordered_set<_valueT,_Hash,_Pred,_Alloc>>(s, m, ec));
974 template <
typename S,
typename _valueT,
typename _Hash,
975 typename _Pred,
typename _Alloc>
978 Write(S & s,
const std::unordered_set<_valueT, _Hash, _Pred, _Alloc> & m,
979 boost::system::error_code & ec)
981 return(ContainerWrite<S,std::unordered_set<_valueT,_Hash,_Pred,_Alloc>>(s, m, ec));
987 template <
typename S>
990 boost::system::error_code & ec)
991 {
return val.
Read(s, ec); }
996 template <
typename S>
999 boost::system::error_code & ec)
1000 {
return val.Read(s, ec); }
1005 template <
typename S>
1008 boost::system::error_code & ec)
1009 {
return val.
Write(s, ec); }
1014 template <
typename S>
1017 boost::system::error_code & ec)
1018 {
return val.Write(s, ec); }
1023 template <
typename S,
typename... Args>
1025 static bool ReadV(S & s, boost::system::error_code & ec, Args & ...args)
1027 return (
Read(s,args,ec) && ...);
1033 template <
typename S,
typename... Args>
1035 static bool WriteV(S & s, boost::system::error_code & ec,
1036 const Args & ...args)
1038 return (
Write(s,args,ec) && ...);
1047 template <
typename S>
1049 static bool Read(S & s, std::monostate & sm,
1050 boost::system::error_code & ec)
1060 template <
typename S>
1061 requires IsSupportedASIOSocket<S>
1062 static bool Write(S & s,
const std::monostate & sm,
1063 boost::system::error_code & ec)
1073 template <
typename S,
typename _containerT>
1074 requires IsSupportedASIOSocket<S>
1075 static bool ContainerRead(S & s, _containerT & c,
1076 boost::system::error_code & ec)
1080 uint64_t numEntries;
1081 if (
Read(s, numEntries, ec)) {
1083 for ( ; i < numEntries; ++i) {
1084 typename _containerT::value_type val;
1085 if (!
Read(s, val, ec)) {
1088 c.insert(c.end(), std::move(val));
1090 rc = (i == numEntries);
1099 template <
typename S,
typename _containerT>
1100 requires IsSupportedASIOSocket<S>
1101 static bool ContainerWrite(S & s,
const _containerT & c,
1102 boost::system::error_code & ec)
1105 uint64_t numEntries = c.size();
1106 if (
Write(s, numEntries, ec)) {
1123 template <
typename S,
typename _inputIteratorT>
1124 requires IsSupportedASIOSocket<S>
1125 static bool Write(S & s, _inputIteratorT f, _inputIteratorT l,
1126 boost::system::error_code & ec)
1128 for ( ; f != l; ++f) {
1129 if (!
Write(s, *f, ec)) {
1140 template <
typename S,
typename _containerT>
1141 requires IsSupportedASIOSocket<S>
1142 static bool PairAssocContRead(S & s, _containerT & m,
1143 boost::system::error_code & ec)
1147 uint64_t numEntries;
1148 if (
Read(s, numEntries, ec)) {
1150 for ( ; i < numEntries; ++i) {
1151 typename _containerT::key_type key;
1152 if (
Read(s, key, ec)) {
1153 typename _containerT::mapped_type val;
1154 if (
Read(s, val, ec)) {
1155 m.insert(
typename _containerT::value_type(std::move(key),
1166 rc = (i == numEntries);
Dwm::HasAsioTcpRead, Dwm::HasAsioTcpWrite, Dwm::HasAsioLocalRead, Dwm::HasAsioLocalWrite,...
Dwm::VariantFromIndex function template.
std::variant< Ts... > VariantFromIndex(size_t index)
Returns a variant type V whose contents are set to a default constructed value of the type at index i...
Definition DwmVariantFromIndex.hh:57
Interface for classes that wish to be readable via Dwm::ASIO.
Definition DwmASIOCapable.hh:145
virtual bool Read(boost::asio::ip::tcp::socket &s, boost::system::error_code &ec)=0
Should read the class from the given socket s and return true on success, false on failure.
Interface for classes that wish to be writable via Dwm::ASIO.
Definition DwmASIOCapable.hh:174
virtual bool Write(boost::asio::ip::tcp::socket &s, boost::system::error_code &ec) const =0
Should write the class to the given socket s and return true on success, false on failure.
A collection of functions for reading from and writing to Boost ASIO stream sockets.
Definition DwmASIO.hh:84
static bool Write(boost::asio::generic::stream_protocol::socket &s, uint16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool WriteV(S &s, boost::system::error_code &ec, const Args &...args)
Writes args to s. Returns true on success, false on failure.
Definition DwmASIO.hh:1035
static bool Write(boost::asio::generic::stream_protocol::socket &s, int16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, float val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(S &s, const std::array< _valueT, N > &a, boost::system::error_code &ec)
Writes an array<_valueT.N> v to s.
Definition DwmASIO.hh:738
static bool Write(boost::asio::local::stream_protocol::socket &s, uint64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, std::string &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::deque< _valueT, _Alloc > &d, boost::system::error_code &ec)
Writes a deque<_valueT> d to s.
Definition DwmASIO.hh:792
static bool Read(boost::asio::ip::tcp::socket &s, uint64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::generic::stream_protocol::socket &s, uint8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, const std::string &value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, bool &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, int16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, bool &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::tuple< Args... > &t, boost::system::error_code &ec)
Writes a tuple to s.
Definition DwmASIO.hh:665
static bool Read(boost::asio::ip::tcp::socket &s, int32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(S &s, std::deque< _valueT, _Alloc > &d, boost::system::error_code &ec)
Reads a deque<_valueT> d from s.
Definition DwmASIO.hh:780
static bool Write(boost::asio::ip::tcp::socket &s, double val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Read(S &s, std::variant< Ts... > &v, boost::system::error_code &ec)
Reads a variant \C V from s.
Definition DwmASIO.hh:681
static bool Write(S &s, const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m, boost::system::error_code &ec)
Writes a unordered_map<_keyT,_valueT> m to s.
Definition DwmASIO.hh:899
static bool Read(boost::asio::ip::tcp::socket &s, int8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, uint64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, uint32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::generic::stream_protocol::socket &s, int32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::generic::stream_protocol::socket &s, const std::string &value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, int16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, float &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(S &s, const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Writes a multimap<_keyT,_valueT> m to s.
Definition DwmASIO.hh:870
static bool Write(boost::asio::local::stream_protocol::socket &s, int8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(S &s, const std::pair< _firstT, _secondT > &p, boost::system::error_code &ec)
Writes a pair<_firstT,_secondT> to s.
Definition DwmASIO.hh:633
static bool Write(S &s, const std::variant< Ts... > &v, boost::system::error_code &ec)
Writes a variant v to s.
Definition DwmASIO.hh:702
static bool Write(boost::asio::ip::tcp::socket &s, uint8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, uint32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, int32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, uint8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, double &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Read(S &s, std::array< _valueT, N > &a, boost::system::error_code &ec)
Reads an array<_valueT,N> v from s.
Definition DwmASIO.hh:720
static bool Write(boost::asio::generic::stream_protocol::socket &s, int64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::generic::stream_protocol::socket &s, int8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(S &s, const HasAsioWrite auto &val, boost::system::error_code &ec)
Writes val to s. Returns true on success, false on failure.
Definition DwmASIO.hh:1016
static bool Write(boost::asio::generic::stream_protocol::socket &s, bool value, boost::system::error_code &ec)
Write value to the given socket s.
static bool ReadV(S &s, boost::system::error_code &ec, Args &...args)
Reads args from s. Returns true on success, false on failure.
Definition DwmASIO.hh:1025
static bool Read(S &s, std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m, boost::system::error_code &ec)
Reads an unordered_set<_valueT> m from s.
Definition DwmASIO.hh:964
static bool Read(boost::asio::generic::stream_protocol::socket &s, uint64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::vector< _valueT, _Alloc > &v, boost::system::error_code &ec)
Writes a vector<_valueT> v to s.
Definition DwmASIO.hh:768
static bool Read(S &s, std::map< _keyT, _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Reads a map<_keyT,_valueT> m from s.
Definition DwmASIO.hh:829
static bool Write(boost::asio::generic::stream_protocol::socket &s, float val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(boost::asio::local::stream_protocol::socket &s, int32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(S &s, const std::list< _valueT, _Alloc > &l, boost::system::error_code &ec)
Writes a list<_valueT> l to s.
Definition DwmASIO.hh:816
static uint64_t StreamedLength(const std::string &s)
Returns the number of bytes that should be written if we call the Write() member for a string.
static bool Read(S &s, HasAsioRead auto &val, boost::system::error_code &ec)
Reads val from s. Returns true on success, false on failure.
Definition DwmASIO.hh:998
static bool Write(S &s, const std::set< _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Writes a set<_valueT> m to s.
Definition DwmASIO.hh:925
static bool Write(boost::asio::generic::stream_protocol::socket &s, uint32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, int8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, uint32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, uint16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, const std::string &value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, uint16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, uint64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(S &s, std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m, boost::system::error_code &ec)
Reads an unordered_map<_keyT,_valueT> m from s.
Definition DwmASIO.hh:885
static bool Read(boost::asio::ip::tcp::socket &s, std::string &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, int16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::generic::stream_protocol::socket &s, double val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Read(boost::asio::generic::stream_protocol::socket &s, uint8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, int64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, bool &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(S &s, std::vector< _valueT, _Alloc > &v, boost::system::error_code &ec)
Reads a vector<_valueT> v from s.
Definition DwmASIO.hh:756
static bool Read(boost::asio::local::stream_protocol::socket &s, std::string &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, uint32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(S &s, std::tuple< Args... > &t, boost::system::error_code &ec)
Reads a tuple from s.
Definition DwmASIO.hh:649
static bool Read(boost::asio::ip::tcp::socket &s, uint8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::multiset< _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Writes a multiset<_valueT> m to s.
Definition DwmASIO.hh:949
static bool Read(boost::asio::generic::stream_protocol::socket &s, float &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(boost::asio::generic::stream_protocol::socket &s, uint64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, uint16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, float val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(boost::asio::local::stream_protocol::socket &s, int64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, uint16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, bool value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(S &s, const ASIOWritable &val, boost::system::error_code &ec)
Writes val to s. Returns true on success, false on failure.
Definition DwmASIO.hh:1007
static bool Read(S &s, std::set< _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Reads a set<_valueT> m from s.
Definition DwmASIO.hh:912
static bool Write(boost::asio::ip::tcp::socket &s, int64_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, int8_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, uint8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, int32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::local::stream_protocol::socket &s, double val, boost::system::error_code &ec)
Writes val to s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Read(boost::asio::generic::stream_protocol::socket &s, uint16_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, int64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::local::stream_protocol::socket &s, int32_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m, boost::system::error_code &ec)
Writes a unordered_set<_valueT> m to s.
Definition DwmASIO.hh:978
static bool Read(boost::asio::generic::stream_protocol::socket &s, int64_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Read(boost::asio::ip::tcp::socket &s, double &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Read(S &s, std::list< _valueT, _Alloc > &l, boost::system::error_code &ec)
Reads a list<_valueT> l from s.
Definition DwmASIO.hh:804
static bool Read(boost::asio::generic::stream_protocol::socket &s, int8_t &value, boost::system::error_code &ec)
Reads value from the given socket s.
static bool Write(S &s, const std::map< _keyT, _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Writes a map<_keyT,_valueT> m to s.
Definition DwmASIO.hh:842
static bool Read(S &s, ASIOReadable &val, boost::system::error_code &ec)
Reads val from s. Returns true on success, false on failure.
Definition DwmASIO.hh:989
static bool Read(S &s, std::pair< _firstT, _secondT > &p, boost::system::error_code &ec)
Reads a pair<_firstT,_secondT> from s.
Definition DwmASIO.hh:617
static bool Read(boost::asio::local::stream_protocol::socket &s, float &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
static bool Write(boost::asio::local::stream_protocol::socket &s, uint32_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Write(boost::asio::ip::tcp::socket &s, int16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(S &s, std::multiset< _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Reads a multiset<_valueT> m from s.
Definition DwmASIO.hh:937
static bool Write(boost::asio::local::stream_protocol::socket &s, int16_t value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(S &s, std::multimap< _keyT, _valueT, _Compare, _Alloc > &m, boost::system::error_code &ec)
Reads a multimap<_keyT,_valueT> m from s.
Definition DwmASIO.hh:856
static bool Write(boost::asio::ip::tcp::socket &s, bool value, boost::system::error_code &ec)
Write value to the given socket s.
static bool Read(boost::asio::generic::stream_protocol::socket &s, double &val, boost::system::error_code &ec)
Reads val from s, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
T has asio read members.
Definition DwmASIOCapable.hh:128
T has asio write members.
Definition DwmASIOCapable.hh:136
Concept for the types of ASIO sockets we can utilize.
Definition DwmASIO.hh:68