[libavg-devel] [Fwd: Dynamic Node Creation Enhancements]
Nick Hebner
hebnern at gmail.com
Thu Feb 7 18:27:25 CET 2008
Hey,
Has this email been received by the mailing list now? I don't mean to pry,
I'm just wondering because its been forwarded three times now, but has not
received any response. I always seem to break the mailing list with my patch
inclusions, so in the future should I just host them elsewhere and provide a
link?
Thanks,
Nick
On Feb 7, 2008 2:36 AM, Ulrich von Zadow <uzadow at libavg.de> wrote:
> Hi,
>
> forwarded due to mailing list configuration issues...
>
> Cheers,
>
> Uli
>
> -------- Original Message --------
> Subject: Dynamic Node Creation Enhancements
> Date: Tue, 05 Feb 2008 19:08:41 +0100
> From: libavg-devel-owner at datenhain.de
> To: libavg-devel-owner at datenhain.de
>
> Hey All,
>
> Over the weekend, I took a little break from audio to work on some
> enhancements to dynamic node creation. With the included patch, nodes
> may be created through Player::createNode(typeString,
> argsPythonDictionary). (e.g. newNode = Player.createNode("video",
> {"href":"video.mpg"}) ). To support this, I have reworked how arguments
> are passed to node constructors, and created a generic registration
> mechanism for adding support for different types of nodes (also
> resulting in the ability to dynamically build/change the avg DTD). The
> changes are discussed below.
>
> NodeDefinition
> A NodeDefinition is basically represents all of the information formerly
> found in the avg DTD, that is information about what a type of node is.
> It is composed of a type string, all valid arguments and their default
> values, all valid child nodes, and a function that may be used to build
> a node of this type (Node::buildNode() is a generic template NodeBuilder
> function that can be used in most cases). NodeDefinitions may be
> extended by subclasses, making inheritance of arguments/child nodes
> simple. Each node type now implements a static getNodeDefinition()
> function which returns the information about the type.
>
> NodeFactory
> NodeDefinitions are registered with a NodeFactory, which can then
> construct nodes of the registered type. The NodeFactory handles
> validation of arguments passed to the create function based on the
> registered NodeDefinition of the type being created. Also, all unset
> args are replaced with the default values defined in the NodeDefinition
> for the type so the node constructor may safely request any arg defined
> in its NodeDefinition. Additionally, the NodeFactory can dynamically
> build a DTD from the complete set of NodeDefinitions currently
> registered with it. The DTD contains a single special entity called
> %anyNode; which contains a | separated list of all of the node types
> registered, and can be used for generic container nodes (e.g. avg and
> div). The dynamic nature of the DTD is very flexible, and has been
> designed with the idea of node plugins in mind, however, it is now less
> visible then before. It would be nice to make the full DTD available to
> the designer (should we add a Player::getDTD() that returns the
> current DTD string in python?).
>
> Arg/ArgList
> An ArgList is the structure passed to node constructors. It may be build
> from either an xmlNode or a python dictionary object. It provides a
> simple interface for getting arguments in various formats.
>
> The dynamic node tests currently in place have been expanded to use both
> interfaces, and all still pass.
>
> Well, thats all I have for now. Please let me know what you think of the
> attached patch.
>
> Thanks,
> Nick Hebner
>
>
> --
>
> Ulrich von Zadow | +49-172-7872715
> Jabber: cocacoder at jabber.berlin.ccc.de
> Skype: uzadow
>
>
> _______________________________________________
> libavg-devel mailing list
> libavg-devel at datenhain.de
> https://mail.datenhain.de/mailman/listinfo/libavg-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.datenhain.de/pipermail/libavg-devel/attachments/20080207/8b4924b2/attachment.htm
More information about the libavg-devel
mailing list