LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
numericTransition.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 numericTransition.h
9 * @author besancon (besanconr@zoe.cea.fr)
10 * @date Tue Oct 29 2002
11 * copyright Copyright (C) 2002 by CEA LIST
12 * Project Automaton
13 *
14 * @brief numeric transition (can be en interval value)
15 *
16 ***********************************************************************/
17
18#ifndef NUMERICTRANSITION_H
19#define NUMERICTRANSITION_H
20
21#include "AutomatonExport.h"
22#include <iostream>
23#include <limits>
25
26#ifdef WIN32
27#undef min
28#undef max
29#endif
30namespace Lima {
31namespace LinguisticProcessing {
32namespace Automaton {
33
35{
36 public:
38 NumericTransition(uint64_t, uint64_t, uint64_t, bool keep=true);
40 virtual ~NumericTransition();
41 NumericTransition& operator = (const NumericTransition&);
42
43 NumericTransition* clone() const override;
44 NumericTransition* create() const override;
45
46 std::string printValue() const override;
47 bool operator== (const TransitionUnit&) const override;
48 bool operator== (const uint64_t&) const;
49
50 bool compare(const LinguisticAnalysisStructure::AnalysisGraph& graph,
51 const LinguisticGraphVertex& vertex,
52 AnalysisContent& analysis,
54 const LinguisticAnalysisStructure::MorphoSyntacticData* data) const override;
55
56 TypeTransition type() const override;
57
58 uint64_t value() const;
59 uint64_t min() const;
60 uint64_t max() const;
61 void setValue(uint64_t);
62 void setMin(uint64_t);
63 void setMax(uint64_t);
64 void setMinMax(uint64_t, uint64_t);
65 bool isInterval() const;
66
67 static const uint64_t noValue ;
68
69 private:
70 uint64_t m_value;
71 uint64_t m_min;
72 uint64_t m_max;
73};
74
75/***********************************************************************/
76// inline access functions
77/***********************************************************************/
78inline uint64_t NumericTransition::value() const { return m_value; }
79inline uint64_t NumericTransition::min() const { return m_min; }
80inline uint64_t NumericTransition::max() const { return m_max; }
81inline void NumericTransition::setValue(uint64_t val) { m_value = val; }
82inline void NumericTransition::setMin(uint64_t min) { m_min = min; }
83inline void NumericTransition::setMax(uint64_t max) { m_max = max; }
84inline void NumericTransition::setMinMax(uint64_t min,
85 uint64_t max) {
86 m_min = min;
87 m_max = max; }
88
89/***********************************************************************/
90// other inline functions
91/***********************************************************************/
93 return new NumericTransition(*this); }
96
98
99inline bool NumericTransition::isInterval() const {
100 if (m_value == noValue) { return true; }
101 return false;
102}
103
104
105} // end namespace
106} // end namespace
107} // end namespace
108
109#endif
#define LIMA_AUTOMATON_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.