On Wed, May 18, 2011 at 1:52 AM, Michael Roth <mdr...@linux.vnet.ibm.com> wrote: > A type of Visiter class that is used to walk a qobject's > structure and assign each entry to the corresponding native C type. > Command marshaling function will use this to pull out QMP command > parameters recieved over the wire and pass them as native arguments > to the corresponding C functions. > > Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com> > --- > qapi/qmp-input-visiter.c | 239 > ++++++++++++++++++++++++++++++++++++++++++++++ > qapi/qmp-input-visiter.h | 13 +++ > 2 files changed, 252 insertions(+), 0 deletions(-) > create mode 100644 qapi/qmp-input-visiter.c > create mode 100644 qapi/qmp-input-visiter.h
Pedantic note: the design pattern is commonly spelled "visitor": http://en.wikipedia.org/wiki/Visitor_pattern The fixed-size stack and hardcoded object size are unfortunate but I haven't read the code in enough detail to see if there is a feasible alternative. Stefan