[ome-devel] enum type for acqusition enums

josh.moore at gmx.de josh.moore at gmx.de
Wed May 27 16:49:43 BST 2009


Bernhard Holländer writes:
 > Hi!

Hi, Bernhard,

 > Quick question: are there enum types in OmeroCpp that match the
 > enums defined in acquisition.ome.xml?

There's possibly some confusion here. There are both enumerations in
Ice and in the OMERO object model. The enums in the *.ome.xml files
become omero.model classes in OmeroCpp. For example,

        <enum id="ome.model.enums.FilterType">
                <entry name="LongPass"/>
                <entry name="ShortPass"/>
                <entry name="BandPass"/>
                <entry name="MultiPass"/>
                <entry name="Other"/>
                <entry name="Unknown"/>
        </enum>

becomes omero::model::FilterType, and the entries are created as rows
in your db on initialization. Other values can then be added as
necessary via omero::api::ITypePrx.

To use them in a graph which you are passing to the server, it
suffices to have an unloaded value with the proper id, or conversely,
an object with only the "value" field loaded:

  FilterTyprPtr ft = new FilterType();
  ft->setValue( rstring("LongPass") );

Ice enumerations, on the other hand, are generated as static fields:

  https://trac.openmicroscopy.org.uk/omero/browser/trunk/examples/OmeroClients/enumerations.cpp

Hope that clears things up.
~Josh.


More information about the ome-devel mailing list