LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
PropertyManager.h
Go to the documentation of this file.
1// Copyright 2002-2020 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/***************************************************************************
7 * Copyright (C) 2004 by CEA LIST *
8 * *
9 ***************************************************************************/
10
11#ifndef LIMA_COMMON_PROPERTYCODE_PROPERTYMANAGER_H
12#define LIMA_COMMON_PROPERTYCODE_PROPERTYMANAGER_H
13
15#include "PropertyAccessor.h"
16
17#include <map>
18
19namespace Lima
20{
21namespace Common
22{
23namespace PropertyCode
24{
25
26class PropertyManagerPrivate;
34{
36public:
37
45 PropertyManager(const std::string& name,
46 const LinguisticCode& mask,
47 const LinguisticCode& emptyNessMask,
48 const std::map<std::string,LinguisticCode> symbol2code);
49
51
53 PropertyManager& operator=(const PropertyManager&);
54
59 const PropertyAccessor& getPropertyAccessor() const;
60
65 LinguisticCode getMask() const;
66
75 LinguisticCode getEmptyNessMask() const;
76
82 LinguisticCode getPropertyValue(const std::string& symbolicValue) const;
83
90 const std::string& getPropertySymbolicValue(const LinguisticCode& value) const;
91
96 const std::map<LinguisticCode,std::string>& getCode2Symbol() const;
97
102 const std::map<std::string,LinguisticCode>& getSymbol2Code() const;
103
108 size_t getNbValues() const;
109
110private:
111 std::unique_ptr<PropertyManagerPrivate> m_d;
112};
113
114#define GET_PROPERTY_MANAGER(language, property) \
115 static_cast<const Lima::Common::MediaticData::LanguageData&>(\
116 Lima::Common::MediaticData::MediaticData::single().mediaData( language ))\
117 .getPropertyCodeManager().getPropertyManager( property );
118
119#define GET_PROPERTY_ACCESSOR(language, property) \
120 static_cast<const Lima::Common::MediaticData::LanguageData&>(\
121 Lima::Common::MediaticData::MediaticData::single().mediaData( language ))\
122 .getPropertyCodeManager().getPropertyAccessor( property )
123} // PropertyCode
124} // Common
125} // Lima
126
127
128#endif
#define LIMA_PROPERTYCODE_EXPORT
Provide function to read write and check a property.
Provide tools to manage a specific property.
NAUTITIA.