[Clam-devel] [PATCH] (work-in-progress) ProcessingFactory managing Metadata

Andreas Calvo flipy.bcn at gmail.com
Fri Jul 6 02:55:23 PDT 2007


Finishied coding the ProcessingFactory metadata support, now moving to use
it on the ProcessingTree of NetworkEditor.

Methods:
- GetListOfKeys(attribute, value): returns a list of Keys that have
"attribute" with "value".
- GetValuesFor(attribute): returns a list of Values of unique occurrence of
"attribute" in all processings stored.
- GetValuesOf(key): returns a list of Attributes of "key".
- GetValuesFrom(key, attribute): returns a list of Values from "key" that
matches attribute name "attribute".
- AddAttribute(key, name, value): add a new attribute "name" with "value" to
"key". (TODO: check if "key" exists on the Factory).
- ProcessingsClear: clears the ProcessingFactory. (TODO: clear a specific
key? or attribute?)
- ProcessingCount: return the elements on the ProcessingFactory

Type Definitions:
- Key (currently type from RegistryKey)
- Keys (list of type Key)
- Value (std::string)
- Values (list of Value)
- Attribute (struct with a std::string Name and a Value)
- Attributes (list of type Attribute)
- ProcessingAttributes (map with Key and Attributes)

Note: check the ProcessingFactoryTest.cxx under test/UnitTests to see a more
comprensive example.

WARNING: Pau, this is not based on latest repository update, so it will need
to do some workaround.

On 7/5/07, Pau Arumi <parumi at iua.upf.edu> wrote:
>
> En/na Andreas Calvo ha escrit:
> > This patch the early steps to add and manage metadata to the Processing
> > Factory.
> > Now it does uses a string to store metadata, but it will change to a
> > struct (for easy manage).
> > With this patch it is possible to retrieve information of a given
> > category and of a given key.
> > New methods will be added:
> > - to retrieve information for a key and attributes
> > - to retrieve attributes (no values) from a key
> > - to retrieve unique names of attributes
> >
> >
> > any suggestion will be really appreciated
>
>
> Although not finished I've committed it (revision 10349) with
> implementation comments in ProcessingFactory.*xx
> and new tests to be passed (now commented out).
>
> An advice:try to do it test-driven which means: implement only the
> simpler code that pass the current tests.
>
> //      CPPUNIT_TEST( testAddAttribute_nonExistingKey );
> //      CPPUNIT_TEST( testGetValueFor_nonExistingKey );
> //      CPPUNIT_TEST( testGetValueFor_nonExistingAttribute );
> //      CPPUNIT_TEST( testGetValueFor_existingAttribute );
>
>
>
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070706/87dd8c4c/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ProcessingFactory_metadata.patch
Type: text/x-patch
Size: 8978 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070706/87dd8c4c/attachment-0003.bin>


More information about the clam-devel mailing list