[Openais] object database code

Steven Dake sdake at mvista.com
Mon Jan 30 09:34:44 PST 2006


On Mon, 2006-01-30 at 10:34 +0000, Patrick Caulfield wrote:
> Steven Dake wrote:
> > I wrote this attached object in-memory database today for the
> > configuration system.  It seems to work pretty well, is compact, and
> > should work for the configuration systems for groups.conf and
> > openais.conf.  Patrick comments about its functionality for redhat's xml
> > parser appreciated..
> > 
> > Objects may be created as children of other objects.  Objects
> > identifiers may be duplicated.  There can be keys in any object which
> > are unique within each object and contain a value.
> > 
> > There is data type validation functionality (yet unwritten) which will
> > validate the data for an object name or key name creation of an object
> > or a key.  If the object name is invalid for parent object it won't be
> > created and an error will be returned.  If the key name is invalid or
> > the data for the key is invalid, an error will be returned.
> > 
> > This should make the config parser code very simple.  Anything with a {
> > is a new object, anything with a } returns to the parent object for
> > object operations, anything with an = is a key/value pair.  Then the
> > parser can detect errors or missing key/values in the configuration in
> > the exec_init_fn or also using the validator functionality.
> > 
> > We can make this as an lcrso so it may be replaced if bugs pop up or we
> > need new functions in the interface.  We can pass this interface to the
> > exec_init_fn and default configuration file parser (and Patrick's
> > configuration file parser in his lcrso).
> > 
> > Comments welcome...
> 
> Can you make the handles into (void *) rather than (int) please ? then I can
> hide pointers to structs in them.

I'm not sure how this would help your situation since the handle is used
to reference the data.  Perhaps instead we could have an

object_private_set (int object_handle, void *private);

object_private_get (int object_handle, void **private);

Would that work for you?

Regards
-steve




More information about the Openais mailing list