-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3099 from joshmoore/dsl-units
DB 5.1__DEV11: unit support for time
- Loading branch information
Showing
41 changed files
with
1,422 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (C) 2014 University of Dundee & Open Microscopy Environment. | ||
* All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, write to the Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*/ | ||
|
||
#ifndef CLASS_TIME | ||
#define CLASS_TIME | ||
|
||
#include <omero/model/UnitsTime.ice> | ||
|
||
module omero { | ||
|
||
module model { | ||
|
||
/** | ||
* Unit of time which is used through the model. This is not | ||
* an [omero::model::IObject] implementation and as such does | ||
* not have an ID value. Instead, the entire object is embedded | ||
* into the containing class, so that the value and unit rows | ||
* can be found on the table itself (e.g. planeInfo.exposureTime | ||
* and planeInfo.exposureTimeUnit). | ||
**/ | ||
["protected"] class Time | ||
{ | ||
|
||
double value; | ||
|
||
UnitsTime unit; | ||
|
||
/** | ||
* Actual value for this unit-based field. The interpretation of | ||
* the value is only possible along with the [omero::model::UnitsTime] | ||
* enum. | ||
**/ | ||
double getValue(); | ||
|
||
void setValue(double time); | ||
|
||
/** | ||
* [omero::model::UnitsTime] instance which is an [omero::model::IObject] | ||
* meaning that its ID is sufficient for identying equality. | ||
**/ | ||
UnitsTime getUnit(); | ||
|
||
void setUnit(UnitsTime unit); | ||
|
||
Time copy(); | ||
|
||
}; | ||
}; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,101 @@ | ||
#* | ||
* $Id$ | ||
* | ||
* Copyright 2006 University of Dundee. All rights reserved. | ||
* Use is subject to license terms supplied in LICENSE.txt | ||
* | ||
*# | ||
/* | ||
* $$Id$$ | ||
* | ||
* Copyright 2006 University of Dundee. All rights reserved. | ||
* Use is subject to license terms supplied in LICENSE.txt | ||
* | ||
*/ | ||
|
||
// | ||
// ObjectFactory registrar generated by templates/cpp_objs_reg.vm | ||
// | ||
|
||
\#include <omero/ObjectFactoryRegistrar.h> | ||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
\#include <omero/model/${type.shortname}I.h> | ||
#end | ||
#end | ||
|
||
namespace omero { | ||
namespace model { | ||
|
||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
#set( $ObjFac = "${type.shortname}ObjectFactory" ) | ||
class ${ObjFac} : virtual public Ice::ObjectFactory { | ||
public: | ||
${ObjFac}() : Ice::ObjectFactory() { } | ||
|
||
~${ObjFac}() {} | ||
|
||
Ice::ObjectPtr create(const std::string& type) { | ||
return new omero::model::${type.shortname}I(); | ||
} | ||
|
||
void destroy() {} | ||
}; | ||
#end | ||
#end | ||
|
||
class PermissionsObjectFactory : virtual public Ice::ObjectFactory { | ||
public: | ||
PermissionsObjectFactory() : Ice::ObjectFactory() { } | ||
|
||
~PermissionsObjectFactory() {} | ||
|
||
Ice::ObjectPtr create(const std::string& type) { | ||
return new omero::model::PermissionsI(); | ||
} | ||
|
||
void destroy() {} | ||
|
||
}; | ||
|
||
void conditionalAdd(const std::string& name, const Ice::CommunicatorPtr& ic, const Ice::ObjectFactoryPtr& of) { | ||
|
||
if (0==ic->findObjectFactory(name)) { | ||
ic->addObjectFactory(of, name); | ||
} | ||
|
||
} | ||
|
||
void registerObjectFactory(const Ice::CommunicatorPtr ic) { | ||
conditionalAdd("::omero::model::Permissions", ic, new PermissionsObjectFactory()); | ||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
conditionalAdd("::omero::model::${type.shortname}", ic, new ${type.shortname}ObjectFactory()); | ||
#end | ||
#end | ||
} | ||
|
||
} // End model | ||
} // End omero | ||
#stop | ||
#* | ||
* $Id$ | ||
* | ||
* Copyright 2006 University of Dundee. All rights reserved. | ||
* Use is subject to license terms supplied in LICENSE.txt | ||
* | ||
*# | ||
/* | ||
* $$Id$$ | ||
* | ||
* Copyright 2006 University of Dundee. All rights reserved. | ||
* Use is subject to license terms supplied in LICENSE.txt | ||
* | ||
*/ | ||
|
||
// | ||
// ObjectFactory registrar generated by templates/cpp_objs_reg.vm | ||
// | ||
|
||
\#include <omero/ObjectFactoryRegistrar.h> | ||
\#include <omero/model/TimeI.h> | ||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
\#include <omero/model/${type.shortname}I.h> | ||
#end | ||
#end | ||
|
||
namespace omero { | ||
namespace model { | ||
|
||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
#set( $ObjFac = "${type.shortname}ObjectFactory" ) | ||
class ${ObjFac} : virtual public Ice::ObjectFactory { | ||
|
||
public: | ||
${ObjFac}() : Ice::ObjectFactory() { } | ||
|
||
~${ObjFac}() {} | ||
|
||
Ice::ObjectPtr create(const std::string& /*type*/) { | ||
return new omero::model::${type.shortname}I(); | ||
} | ||
|
||
void destroy() {} | ||
|
||
}; | ||
#end | ||
#end | ||
|
||
class PermissionsObjectFactory : virtual public Ice::ObjectFactory { | ||
|
||
public: | ||
PermissionsObjectFactory() : Ice::ObjectFactory() { } | ||
|
||
~PermissionsObjectFactory() {} | ||
|
||
Ice::ObjectPtr create(const std::string& /*type*/) { | ||
return new omero::model::PermissionsI(); | ||
} | ||
|
||
void destroy() {} | ||
|
||
}; | ||
|
||
class TimeObjectFactory : virtual public Ice::ObjectFactory { | ||
|
||
public: | ||
TimeObjectFactory() : Ice::ObjectFactory() { } | ||
|
||
~TimeObjectFactory() {} | ||
|
||
Ice::ObjectPtr create(const std::string& type) { | ||
return new omero::model::TimeI(); | ||
} | ||
|
||
void destroy() {} | ||
|
||
}; | ||
|
||
void conditionalAdd(const std::string& name, const Ice::CommunicatorPtr& ic, const Ice::ObjectFactoryPtr& of) { | ||
|
||
if (0==ic->findObjectFactory(name)) { | ||
ic->addObjectFactory(of, name); | ||
} | ||
|
||
} | ||
|
||
void registerObjectFactory(const Ice::CommunicatorPtr ic) { | ||
conditionalAdd("::omero::model::Permissions", ic, new PermissionsObjectFactory()); | ||
conditionalAdd("::omero::model::Time", ic, new TimeObjectFactory()); | ||
#foreach($type in $types) | ||
#if(!$type.abstract) | ||
conditionalAdd("::omero::model::${type.shortname}", ic, new ${type.shortname}ObjectFactory()); | ||
#end | ||
#end | ||
} | ||
|
||
} // End model | ||
} // End omero | ||
#stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.