monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] nvm.experiment.encapsulation progress report and reques


From: Zack Weinberg
Subject: [Monotone-devel] nvm.experiment.encapsulation progress report and request for comments
Date: Sat, 26 Jan 2008 23:42:06 -0500

I've gotten to a point with nvm.experiment.encapsulation where I would
like to solicit advice on how to proceed.   No functions below the
level of cmd_*.cc make use of an app_state directly, but there are
about 20 wrapper functions exposed by the database and key_store
objects that give access to some component of the app_state; most of
these are for single lua hooks or single members of the options
structure.

I'm specifically wanting advice on what to do with the single lua
hooks.  These are, in some sense, global functions that happen to be
defined in a different way than the usual; but I can imagine scenarios
where we would want to have multiple lua states active (different
trust functions for different projects in the same database, perhaps)
so I don't want to make the lua_hooks object global.  I don't like the
idea of passing the entire lua_hooks object down from the CMD
functions, either, though that's what I ended up doing for netsync.
But I'm not a fan of the present wrapper-function approach either.  I
hacked up some "bound method object" functors so that the database
object (for instance) could hold pointers to just the hooks that are
relevant to it rather than to the entire lua_hooks object, but that
winds up being really ugly in lua_hooks.hh and not notably cleaner
anywhere else.

Thoughts?
zw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]