Tags: firewood/mcrouter
Tags
Add a field visitor interface to the generated structures Summary: Support visitor interface in generated structures and add method for converting Carbon structs into folly::dynamic. The interface of visitors: class Visitor { /** * Called when we enter a mixin. * * param id mixin id * param mixinName name of mixin class * param t value of mixin * return false iff we should skip recursive processing of this mixin. */ template <class T> bool enterMixin(uint16_t id, folly::StringPiece mixinName, const T& t); /** * Called when we exit from mixin. * * return false iff we should stop further processing of current struct and * should go one level up. */ bool leaveMixin(); /** * Called on each field of Carbon struct. * * param id field id * param fieldName name of field * param t value of the field * return false iff we should skip all further fields in the current struct and go one level up. */ template <class T> bool visitField(uint16_t id, folly::StringPiece fieldName, const T& t); }; Reviewed By: jmswen Differential Revision: D3814414 fbshipit-source-id: 0cae105fa4f5547a173ee02242b909275ea6aaf3
PreviousNext