MCPcopy Create free account
hub / github.com/comaps/comaps / Write

Method Write

libs/indexer/route_relation.hpp:62–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 7

WriteToSinkFunction · 0.85
WriteNonEmptyFunction · 0.85
GetRGBAMethod · 0.80
WriteNonEmptyMethod · 0.80
WriteFunction · 0.50
IsEmptyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected