Most of the Messenger interface is accessor functions -- 53% --
19 functions out of a total of 39 .

16 of those have both 'get' and 'set', while 3 are get-only.  
Those 3 do not have the word 'get' in their names, so you have 
to look at code to realize that they are accessors like the others.

Could we consider single accessors for everything ?
This would require that all enumtypes use 0 to mean "not a value".
( It has always seemed to me that this is a good policy anyway.
You always need that non-value sooner or later. )

This change would reduce the size of the messenger interface by a 
large fraction -- 9 fns, which seems like a good thing,
and would reduce the fraction of simple accessors to one-third of
the interface.  It would also unify the naming convention.  
( Accessors that must be get-only would simply not take an input, 
as now. )

typedef enum {
} pn_accept_mode_t;

pn_messenger_get_accept_mode ( pn_messenger_t * messenger,
                               pn_accept_mode_t mode
  if ( mode )
    messenger->accept_mode = mode;

  return messenger->accept_mode;

Reply via email to