30 const std::map<std::string,LinguisticCode> symbol2code);
51 const std::string& name,
54 const std::map<std::string,LinguisticCode> symbol2code) :
57 m_emptyNessMask(emptyNessMask),
59 m_symbol2code(symbol2code),
60 m_accessor(name,mask,emptyNessMask)
63 for (map<string,LinguisticCode>::const_iterator it=symbol2code.begin();
64 it!=symbol2code.end();
78 m_emptyNessMask(pmp.m_emptyNessMask),
79 m_code2symbol(pmp.m_code2symbol),
80 m_symbol2code(pmp.m_symbol2code),
81 m_accessor(pmp.m_accessor)
99 const std::map<std::string,LinguisticCode> symbol2code) :
122 return m_d->m_accessor;
127 auto it = m_d->m_symbol2code.find(symbolicValue);
128 if (it == m_d->m_symbol2code.end())
131 LWARN <<
"Ask for unknown value " << symbolicValue
132 <<
" for property " << m_d->m_name;
142 auto it = m_d->m_code2symbol.find(val);
143 if (it == m_d->m_code2symbol.cend())
146 LWARN <<
"Ask for unknown value " << val <<
" (extracted from " << value
147 <<
") for property " << m_d->m_name;
160 return m_d->m_emptyNessMask;
165 return m_d->m_code2symbol;
170 return m_d->m_symbol2code;
175 return m_d->m_symbol2code.size();
#define PROPERTYCODELOGINIT
Provide function to read write and check a property.
PropertyManagerPrivate & operator=(const PropertyManagerPrivate &pmp)
static std::string s_none
LinguisticCode m_emptyNessMask
std::map< LinguisticCode, std::string > m_code2symbol
~PropertyManagerPrivate()
PropertyAccessor m_accessor
PropertyManagerPrivate(const std::string &name, const LinguisticCode &mask, const LinguisticCode &emptyNessMask, const std::map< std::string, LinguisticCode > symbol2code)
std::map< std::string, LinguisticCode > m_symbol2code
Provide tools to manage a specific property.
const std::map< LinguisticCode, std::string > & getCode2Symbol() const
Get the Code -> Symbol mapping.
LinguisticCode getEmptyNessMask() const
The emptyNessMask is the mask use to check if property is empty.
const std::string & getPropertySymbolicValue(const LinguisticCode &value) const
The coded property value can hold several property data.
PropertyManager(const std::string &name, const LinguisticCode &mask, const LinguisticCode &emptyNessMask, const std::map< std::string, LinguisticCode > symbol2code)
constructor
size_t getNbValues() const
give the number of values for this property
LinguisticCode getMask() const
Get the property mask.
const PropertyAccessor & getPropertyAccessor() const
give the corresponding PropertyAccessor
const std::map< std::string, LinguisticCode > & getSymbol2Code() const
Get the Symbol -> Code mapping.
LinguisticCode getPropertyValue(const std::string &symbolicValue) const
Get the coded property value from the symbolic value.
PropertyManager & operator=(const PropertyManager &)