| 60 | |
| 61 | template <class TSink> |
| 62 | void Write(TSink & sink) const |
| 63 | { |
| 64 | WriteToSink(sink, uint8_t(m_type)); |
| 65 | |
| 66 | uint8_t flags = 0; |
| 67 | |
| 68 | if (m_color != kEmptyColor) |
| 69 | flags |= HasColor; |
| 70 | if (!m_name.IsEmpty()) |
| 71 | flags |= HasName; |
| 72 | |
| 73 | for (int i = 0; i < CountIdx; ++i) |
| 74 | if (!m_params[i].empty()) |
| 75 | flags |= (1 << i); |
| 76 | |
| 77 | WriteToSink(sink, flags); |
| 78 | |
| 79 | if (flags & HasColor) |
| 80 | WriteToSink(sink, m_color.GetRGBA()); |
| 81 | |
| 82 | if (flags & HasName) |
| 83 | m_name.WriteNonEmpty(sink); |
| 84 | |
| 85 | rw::Write(sink, m_network); |
| 86 | rw::Write(sink, m_ref); |
| 87 | |
| 88 | for (int i = 0; i < CountIdx; ++i) |
| 89 | if (!m_params[i].empty()) |
| 90 | rw::WriteNonEmpty(sink, m_params[i]); |
| 91 | } |
| 92 | |
| 93 | template <class TSource> |
| 94 | void Read(TSource & src) |
nothing calls this directly
no test coverage detected