/** * Write encoded payload to the given buffer. */ void Table::fill(OutBuffer& buffer) const { // add size buffer.add(static_cast<uint32_t>(size()-4)); // loop through the fields for (auto iter(_fields.begin()); iter != _fields.end(); ++iter) { // encode the field name ShortString name(iter->first); name.fill(buffer); // encode the element type buffer.add((uint8_t) iter->second->typeID()); // encode element iter->second->fill(buffer); } }