Inflection
Morphology Inflection
Loading...
Searching...
No Matches
DisplayValue.hpp
1/*
2 * Copyright 2017-2024 Apple Inc. All rights reserved.
3 */
4#pragma once
5
6#include <inflection/dialog/fwd.hpp>
7#include <inflection/dialog/SemanticFeature.hpp>
8#include <inflection/Object.hpp>
9#include <map>
10#include <string>
11
18class INFLECTION_CLASS_API inflection::dialog::DisplayValue
19 : public virtual ::inflection::Object
20{
21public:
23 typedef ::inflection::Object super;
25
26private:
27 ::std::u16string displayString { };
28 ::std::map<SemanticFeature, ::std::u16string> constraintMap { };
29
30public:
34 virtual const ::std::u16string& getDisplayString() const;
40 virtual const ::std::u16string* getFeatureValue(const SemanticFeature& feature) const;
44 virtual const ::std::map<::inflection::dialog::SemanticFeature, ::std::u16string>& getConstraintMap() const;
50 bool operator==(const DisplayValue& o) const;
56 std::size_t operator()(const DisplayValue& displayValue) const noexcept;
57
63 DisplayValue(const ::std::u16string& displayString, const ::std::map<SemanticFeature, ::std::u16string>& constraintMap);
68 explicit DisplayValue(const ::std::u16string& value);
74 DisplayValue(const SpeakableString& value, const SemanticFeature& speakFeature);
78 ~DisplayValue() override;
79
80private:
81 DisplayValue& operator=(const DisplayValue& other) = delete;
82
83 friend class SemanticFeatureModel;
84};
Inflection's root object.
Definition Object.hpp:14
Represents a display value with constraint values.
std::size_t operator()(const DisplayValue &displayValue) const noexcept
DisplayValue(const SpeakableString &value, const SemanticFeature &speakFeature)
bool operator==(const DisplayValue &o) const
virtual const ::std::u16string & getDisplayString() const
virtual const ::std::u16string * getFeatureValue(const SemanticFeature &feature) const
virtual const ::std::map<::inflection::dialog::SemanticFeature, ::std::u16string > & getConstraintMap() const
DisplayValue(const ::std::u16string &displayString, const ::std::map< SemanticFeature, ::std::u16string > &constraintMap)
DisplayValue(const ::std::u16string &value)
A semantic model that contains display data for semantic values and provides feature functions for de...
Represents a single semantic feature.
Represents a string with both a spoken and written representation.
The C++ namespace for Inflection.
Definition fwd.hpp:11