@@ -304,20 +304,31 @@ struct ProxyServerMethodTraits : public ProxyMethodTraits<MethodParams>
304304{
305305};
306306
307- static constexpr int FIELD_IN = 1 ;
308- static constexpr int FIELD_OUT = 2 ;
309- static constexpr int FIELD_OPTIONAL = 4 ;
310- static constexpr int FIELD_REQUESTED = 8 ;
311- static constexpr int FIELD_BOXED = 16 ;
307+ static constexpr int FIELD_IN = 1 ; // !< See Accessor::in.
308+ static constexpr int FIELD_OUT = 2 ; // !< See Accessor::out.
309+ static constexpr int FIELD_OPTIONAL = 4 ; // !< See Accessor::optional.
310+ static constexpr int FIELD_REQUESTED = 8 ; // !< See Accessor::requested.
311+ static constexpr int FIELD_BOXED = 16 ; // !< See Accessor::boxed.
312312
313313// ! Accessor type holding flags that determine how to access a message field.
314314template <typename Field, int flags>
315315struct Accessor : public Field
316316{
317+ // ! Field is present from the Cap'n Proto Params struct (client -> server).
317318 static const bool in = flags & FIELD_IN;
319+ // ! Field is present from the Cap'n Proto Results struct (server -> client).
318320 static const bool out = flags & FIELD_OUT;
321+ // ! Field has a companion has{Name} boolean field in the Cap'n Proto struct.
322+ // ! This is used to represent optional primitive values (e.g. C++
323+ // ! std::optional<int>) because Cap'n Proto doesn't allow primitive fields to
324+ // ! be unset.
319325 static const bool optional = flags & FIELD_OPTIONAL;
326+ // ! Results field has a companion want{Name} boolean field in the Params
327+ // ! struct. Used for optional output parameters (e.g. C++ int*) and set to
328+ // ! true if the caller passed a non-null pointer and wants the result.
320329 static const bool requested = flags & FIELD_REQUESTED;
330+ // ! Field is a Cap'n Proto pointer type (struct, list, text, data,
331+ // ! interface) as opposed to a primitive type (bool, int, float, enum).
321332 static const bool boxed = flags & FIELD_BOXED;
322333};
323334
0 commit comments