From cfcecc439949d7f939fcb3cfcf3e9e46fc7ec483 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 16 Jul 2017 13:44:50 +0100 Subject: Group enum functions properly --- slicer/slicer/modelPartsTypes.impl.h | 40 ++++++++++++++++++------------------ 1 file 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 + T ModelPartForEnum::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 + const std::string & ModelPartForEnum::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 ModelPartForSequence::ModelPartForSequence(T * s) : @@ -380,26 +400,6 @@ namespace Slicer { return metadata; } - template - T ModelPartForEnum::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 - const std::string & ModelPartForEnum::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 ModelPartForDictionaryElementInserter::ModelPartForDictionaryElementInserter(T * d) : -- cgit v1.2.3