LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
constraintFunctionFactory.h
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 *
8 * @file constraintFunctionFactory.h
9 * @author besancon (besanconr@zoe.cea.fr)
10 * @date Wed Mar 16 2005
11 * @version $Id$
12 * copyright Copyright (C) 2005-2012 by CEA LIST
13 * Project Automaton
14 *
15 * @brief abstract factory for constraint functions
16 *
17 *
18 ***********************************************************************/
19
20#ifndef CONSTRAINTFUNCTIONFACTORY_H
21#define CONSTRAINTFUNCTIONFACTORY_H
22
23#include "AutomatonExport.h"
24#include "constraintFunction.h"
26
27namespace Lima {
28namespace LinguisticProcessing {
29namespace Automaton {
30
32 public RegistrableFactory<AbstractConstraintFunctionFactory>
33{
34 public:
35 AbstractConstraintFunctionFactory(const std::string& factoryId);
36 virtual ConstraintFunction* create(MediaId language,
37 const LimaString& param)=0;
38 private:
39};
40
41template<typename Constraint>
44{
45 public:
46 ConstraintFunctionFactory(const std::string& factoryId):
48 ConstraintFunction* create(MediaId language,
49 const LimaString& param) override {
50 ConstraintFunction* newFunction=static_cast<ConstraintFunction*>(new Constraint(language,param));
51 return newFunction;
52 }
53 private:
54};
55
56} // end namespace
57} // end namespace
58} // end namespace
59
60#endif
#define LIMA_AUTOMATON_EXPORT
virtual ConstraintFunction * create(MediaId language, const LimaString &param)=0
ConstraintFunction * create(MediaId language, const LimaString &param) override
Defines a Factory that automatically register to a MainFactory singleton.
NAUTITIA.
QString LimaString
Definition LimaString.h:33