[Bro-Dev] [JIRA] (BIT-1270) topic/gilbert/plugin-api-tweak

Siwek, Jon jsiwek at illinois.edu
Fri Oct 17 12:31:48 PDT 2014


On Oct 17, 2014, at 1:34 PM, Gilbert Clark <gc355804 at ohio.edu> wrote:

> To be honest, I'm not sure if expecting a user to return a 
> std::pair<bool, Val*> from a plugin function hook is more or less 
> obvious than an explicit wrapper.  One thing that makes this a little 
> less obvious to me is that the usage of this construct won't be limited 
> to bro folks reviewing this code: plugin authors will need to craft one 
> of these (either ValWrapper or std::pair) and return them from the 
> hook.  std::pair might actually be a little easier, since that might 
> make it more obvious what's happening there (since std::pair is vanilla 
> C++) ... but it also might not.

I think unless the API is designed to be generic, one reason std::pair<T1, T2> may be less obvious is that if it shows up in multiple places, one doesn’t really know at a glance that they express the same meaning/intention.

- Jon


More information about the bro-dev mailing list