19#include "boost/tuple/tuple.hpp"
22namespace LinguisticProcessing {
32 std::multimap<std::string,ConstraintFunction*>::iterator
33 func=m_constraintMap.begin(),
34 func_end=m_constraintMap.end();
36 for (;func!=func_end;func++) {
37 if ((*func).second!=0) {
38 delete (*func).second;
42 m_constraintMap.clear();
53 std::multimap<std::string,ConstraintFunction*>::const_iterator
55 boost::tie(it,it_end)=m_constraintMap.equal_range(
id);
56 for (;it!=it_end; it++) {
57 if ((*it).second->getComplementString() == complement
58 &&
static_cast<MediaId
>((*it).second->getLanguage()) == language) {
74 std::multimap<std::string,ConstraintFunction*>::const_iterator
75 it=m_constraintMap.begin(),
76 it_end=m_constraintMap.end();
77 for (;it!=it_end; it++) {
78 if ((*it).second==functionPtr) {
80 complement=(*it).second->getComplementString();
96 m_constraintMap.insert(make_pair(
id,newConstraint));
100 LDEBUG <<
"ConstraintFunctionManager::createConstraintFunction( id:"<<
id
101 <<
", language:" << language <<
",complement:" << complement <<
")->" << newConstraint
105 return newConstraint;
ConstraintFunctionManager()
ConstraintFunction * createConstraintFunction(const std::string &id, MediaId language, const LimaString &complement=LimaString())
~ConstraintFunctionManager()
bool getFunctionName(const ConstraintFunction *functionPtr, std::string &id, LimaString &complement) const
ConstraintFunction * getConstraintFunction(const std::string &id, MediaId language, const LimaString &complement=LimaString())
static std::shared_ptr< AbstractConstraintFunctionFactory > getFactory(const std::string &id)
get the factory corresponding to the given id