concordia-library/concordia/example.cpp
rjawor 4b921decae limits control
Former-commit-id: 83d90cb63b3f1447938d16010e66f4345dfe0617
2014-03-14 11:30:17 +01:00

17 lines
553 B
C++

#include "concordia/example.hpp"
Example::Example(const string & sentence, const SUFFIX_MARKER_TYPE & id)
throw (ConcordiaException):
_sentence(sentence),
_id(id) {
//check if the example id exceeds space reserved for it in the suffix marker
if (id >= (SUFFIX_MARKER_TYPE_MAX_VALUE+1) / SUFFIX_MARKER_DIVISOR) {
throw ConcordiaException("Example id too large.");
}
}
Example::~Example() {
}