ome-xml  5.2.0
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ome::xml::model::OMEModel Class Referenceabstract

OME model interface (abstract top-level container) More...

#include <ome/xml/model/OMEModel.h>

+ Inheritance diagram for ome::xml::model::OMEModel:

Public Types

typedef std::vector< ome::compat::shared_ptr< Reference > > reference_list_type
 A list of Reference objects.
 
typedef std::map< std::string, ome::compat::shared_ptr< OMEModelObject > > object_map_type
 A map of string model object identifiers to model objects.
 
typedef std::map< ome::compat::shared_ptr< OMEModelObject >, reference_list_typereference_map_type
 A map of model objects to list of Reference objects.
 
typedef reference_map_type::size_type size_type
 Size type for reference map.
 

Public Member Functions

virtual ~OMEModel ()
 Destructor.
 
virtual ome::compat::shared_ptr< OMEModelObjectaddModelObject (const std::string &id, ome::compat::shared_ptr< OMEModelObject > &object)=0
 Add a model object to the model. More...
 
virtual ome::compat::shared_ptr< OMEModelObjectremoveModelObject (const std::string &id)=0
 Remove a model object from the model. More...
 
virtual ome::compat::shared_ptr< OMEModelObjectgetModelObject (const std::string &id) const =0
 Retrieve a model object from the model. More...
 
virtual const object_map_typegetModelObjects () const =0
 Retrieve all model objects from the model. More...
 
virtual bool addReference (ome::compat::shared_ptr< OMEModelObject > &a, ome::compat::shared_ptr< Reference > &b)=0
 Add a reference to a model object. More...
 
virtual const reference_map_typegetReferences () const =0
 Retrieve all references from the model. More...
 
virtual size_type resolveReferences ()=0
 Resolve all references. More...
 

Protected Member Functions

 OMEModel ()
 Constructor.
 

Private Member Functions

 OMEModel (const OMEModel &)
 Copy constructor (deleted).
 
OMEModeloperator= (const OMEModel &)
 Assignment operator (deleted).
 

Detailed Description

OME model interface (abstract top-level container)

Member Function Documentation

virtual ome::compat::shared_ptr<OMEModelObject> ome::xml::model::OMEModel::addModelObject ( const std::string &  id,
ome::compat::shared_ptr< OMEModelObject > &  object 
)
pure virtual

Add a model object to the model.

Note that the concrete implementation will not add types derived from Reference.

Parameters
idthe model object identifier.
objectthe model object to add.
Returns
the model object.
Todo:
What is the point of returning the object? The object is returned under all conditions, even when adding the object failed (e.g. if the object was a Reference). Should it be possible to insert null objects?

Referenced by ome::xml::model::LightSource::update(), ome::xml::model::Shape::update(), ome::xml::model::Annotation::update(), ome::xml::model::ChannelRef::update(), ome::xml::model::ExperimentRef::update(), ome::xml::model::PlateRef::update(), ome::xml::model::FilterRef::update(), ome::xml::model::ProjectRef::update(), ome::xml::model::AnnotationRef::update(), ome::xml::model::FilterSetRef::update(), ome::xml::model::ReagentRef::update(), ome::xml::model::ROIRef::update(), ome::xml::model::DichroicRef::update(), ome::xml::model::ImageRef::update(), ome::xml::model::WellSampleRef::update(), ome::xml::model::DatasetRef::update(), ome::xml::model::InstrumentRef::update(), ome::xml::model::ExperimenterGroupRef::update(), ome::xml::model::MicrobeamManipulationRef::update(), ome::xml::model::ExperimenterRef::update(), ome::xml::model::Pump::update(), ome::xml::model::Leader::update(), ome::xml::model::Detector::update(), ome::xml::model::ObjectiveSettings::update(), ome::xml::model::DetectorSettings::update(), ome::xml::model::Screen::update(), ome::xml::model::Dichroic::update(), ome::xml::model::Reagent::update(), ome::xml::model::Objective::update(), ome::xml::model::FilterSet::update(), ome::xml::model::Project::update(), ome::xml::model::ROI::update(), ome::xml::model::Experiment::update(), ome::xml::model::LightSourceSettings::update(), ome::xml::model::Filter::update(), ome::xml::model::PlateAcquisition::update(), ome::xml::model::Dataset::update(), ome::xml::model::ExperimenterGroup::update(), ome::xml::model::Well::update(), ome::xml::model::MicrobeamManipulation::update(), ome::xml::model::WellSample::update(), ome::xml::model::Experimenter::update(), ome::xml::model::Plate::update(), ome::xml::model::Instrument::update(), ome::xml::model::Pixels::update(), ome::xml::model::Channel::update(), ome::xml::model::Image::update(), and ~OMEModel().

+ Here is the caller graph for this function:

virtual bool ome::xml::model::OMEModel::addReference ( ome::compat::shared_ptr< OMEModelObject > &  a,
ome::compat::shared_ptr< Reference > &  b 
)
pure virtual

Add a reference to a model object.

Parameters
athe model object to reference.
bthe reference to add.
Returns
true
Todo:
There is no validation of whether the model object was valid for this model (as for the java implementation). The return type is an artifact of the java map implementation. Consider removing the return type and throwing if the model object is not already present in the object map; or adding the object to the object map implicitly and not throwing.

Referenced by ome::xml::model::Annotation::update(), ome::xml::model::LightPath::update(), ome::xml::model::Reagent::update(), ome::xml::model::Screen::update(), ome::xml::model::Plane::update(), ome::xml::model::Laser::update(), ome::xml::model::Project::update(), ome::xml::model::ROI::update(), ome::xml::model::Experiment::update(), ome::xml::model::FilterSet::update(), ome::xml::model::PlateAcquisition::update(), ome::xml::model::ExperimenterGroup::update(), ome::xml::model::Dataset::update(), ome::xml::model::WellSample::update(), ome::xml::model::Well::update(), ome::xml::model::MicrobeamManipulation::update(), ome::xml::model::Experimenter::update(), ome::xml::model::Plate::update(), ome::xml::model::Pixels::update(), ome::xml::model::Channel::update(), ome::xml::model::Image::update(), and ~OMEModel().

+ Here is the caller graph for this function:

virtual ome::compat::shared_ptr<OMEModelObject> ome::xml::model::OMEModel::getModelObject ( const std::string &  id) const
pure virtual

Retrieve a model object from the model.

Parameters
idthe model object identifier of the model object to retrieve.
Returns
the model object or null if the identifier does not exist.
Todo:
: Would a const reference be better for the return?

Implemented in ome::xml::model::detail::OMEModel.

Referenced by ~OMEModel().

+ Here is the caller graph for this function:

virtual const object_map_type& ome::xml::model::OMEModel::getModelObjects ( ) const
pure virtual

Retrieve all model objects from the model.

Returns
a reference to the object model map.

Implemented in ome::xml::model::detail::OMEModel.

Referenced by ~OMEModel().

+ Here is the caller graph for this function:

virtual const reference_map_type& ome::xml::model::OMEModel::getReferences ( ) const
pure virtual

Retrieve all references from the model.

Returns
a reference to the reference map.

Implemented in ome::xml::model::detail::OMEModel.

Referenced by ~OMEModel().

+ Here is the caller graph for this function:

virtual ome::compat::shared_ptr<OMEModelObject> ome::xml::model::OMEModel::removeModelObject ( const std::string &  id)
pure virtual

Remove a model object from the model.

Parameters
idthe model object identifier of the model object to remove.
Returns
the model object or null if the identifier does not exist.

Implemented in ome::xml::model::detail::OMEModel.

Referenced by ~OMEModel().

+ Here is the caller graph for this function:

virtual size_type ome::xml::model::OMEModel::resolveReferences ( )
pure virtual

Resolve all references.

Check for invalid references and null model objects.

Returns
the number of unhandled references.
Todo:
This method is a bit of a wart in the design. The model should not allow invalid references or insertion of null model objects to begin with.

Implemented in ome::xml::model::detail::OMEModel.

Referenced by ~OMEModel().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: