proxygen
fizz::detail::WriterVector< N, T > Struct Template Reference

#include <Types-inl.h>

Public Member Functions

void writeVector (const std::vector< T > &data, folly::io::Appender &out)
 

Detailed Description

template<class N, class T>
struct fizz::detail::WriterVector< N, T >

Definition at line 117 of file Types-inl.h.

Member Function Documentation

template<class N , class T >
void fizz::detail::WriterVector< N, T >::writeVector ( const std::vector< T > &  data,
folly::io::Appender out 
)
inline

Definition at line 118 of file Types-inl.h.

References folly::pushmi::detail::t, fizz::detail::write(), and folly::io::detail::Writable< Derived >::writeBE().

118  {
119  // First do a pass to compute the size of the data
120  size_t len = 0;
121  for (const auto& t : data) {
122  len += getSize<T>(t);
123  }
124 
125  out.writeBE<N>(folly::to<N>(len));
126  for (const auto& t : data) {
127  write(t, out);
128  }
129  }
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
void writeBE(T value)
Definition: Cursor.h:744

The documentation for this struct was generated from the following file: