FACT++  1.0
template<typename S >
std::vector<uint16_t> htoncpy ( const S &  s)

Definition at line 72 of file ByteOrder.h.

Referenced by FTM::Header::HtoN(), FTM::StaticData::HtoN(), FTM::DynamicData::HtoN(), FTM::FtuList::HtoN(), and FTM::Error::HtoN().

73 {
74  if (sizeof(S)%2)
75  throw std::logic_error("htoncpy: size of "+std::string(typeid(S).name())+" not a multiple of 2");
76 
77  std::vector<uint16_t> v(sizeof(S)/2);
78 
79  std::transform(reinterpret_cast<const uint16_t*>(&s),
80  reinterpret_cast<const uint16_t*>(&s)+sizeof(S)/2,
81  v.begin(), htons);
82 
83  return v;
84 }

+ Here is the caller graph for this function: