diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-07-16 13:44:50 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-07-16 13:44:50 +0100 |
commit | cfcecc439949d7f939fcb3cfcf3e9e46fc7ec483 (patch) | |
tree | 5d269a256f31ec31eeb387eb49e5e2678c301c83 | |
parent | Add assertions in places where the model pointer is required to valid (diff) | |
download | slicer-cfcecc439949d7f939fcb3cfcf3e9e46fc7ec483.tar.bz2 slicer-cfcecc439949d7f939fcb3cfcf3e9e46fc7ec483.tar.xz slicer-cfcecc439949d7f939fcb3cfcf3e9e46fc7ec483.zip |
Group enum functions properly
-rw-r--r-- | slicer/slicer/modelPartsTypes.impl.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 0ded2a2..c8407c9 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -350,6 +350,26 @@ namespace Slicer { return metadata; } + template<typename T> + T ModelPartForEnum<T>::lookup(const std::string & val) + { + auto i = enumerations.right.find(val); + if (i == enumerations.right.end()) { + throw InvalidEnumerationSymbol(val, typeid(T).name()); + } + return i->second; + } + + template<typename T> + const std::string & ModelPartForEnum<T>::lookup(T val) + { + auto i = enumerations.left.find(val); + if (i == enumerations.left.end()) { + throw InvalidEnumerationValue((::Ice::Int)val, typeid(T).name()); + } + return i->second; + } + // ModelPartForSequence template<typename T> ModelPartForSequence<T>::ModelPartForSequence(T * s) : @@ -380,26 +400,6 @@ namespace Slicer { return metadata; } - template<typename T> - T ModelPartForEnum<T>::lookup(const std::string & val) - { - auto i = enumerations.right.find(val); - if (i == enumerations.right.end()) { - throw InvalidEnumerationSymbol(val, typeid(T).name()); - } - return i->second; - } - - template<typename T> - const std::string & ModelPartForEnum<T>::lookup(T val) - { - auto i = enumerations.left.find(val); - if (i == enumerations.left.end()) { - throw InvalidEnumerationValue((::Ice::Int)val, typeid(T).name()); - } - return i->second; - } - // ModelPartForDictionaryElementInserter template<typename T> ModelPartForDictionaryElementInserter<T>::ModelPartForDictionaryElementInserter(T * d) : |