LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::Common::PropertyCode::PropertyAccessor Class Reference

Provide function to read write and check a property. More...

#include <linguisticProcessing/common/PropertyCode/PropertyAccessor.h>

Public Member Functions

 PropertyAccessor (const std::string &name, const LinguisticCode &mask, const LinguisticCode &emptyNessMask)
 Constructor.
 
 ~PropertyAccessor ()
 
 PropertyAccessor (const PropertyAccessor &)
 
PropertyAccessor & operator= (const PropertyAccessor &)
 
const std::string & getPropertyName () const
 Get the property name.
 
LinguisticCode readValue (const LinguisticCode &code) const
 read a property in a coded int.
 
void writeValue (const LinguisticCode &value, LinguisticCode &code) const
 write a property value in a coded int.
 
bool equal (const LinguisticCode &l1, const LinguisticCode &l2) const
 check property equality for two linguisticCode
 
bool empty (const LinguisticCode &l) const
 Test if the given code has property data.
 

Friends

class PropertyAccessorPrivate
 

Detailed Description

Provide function to read write and check a property.

Class that provide read/write methods for a property

Author
Benoit Mathieu

Definition at line 30 of file PropertyAccessor.h.

Constructor & Destructor Documentation

◆ PropertyAccessor() [1/2]

Lima::Common::PropertyCode::PropertyAccessor::PropertyAccessor ( const std::string &  name,
const LinguisticCode &  mask,
const LinguisticCode &  emptyNessMask 
)

Constructor.

Parameters
nameproperty name
maskproperty mask
maskmask use to test emptyNess of property. Different from mask \ only for subproperties.

Definition at line 73 of file PropertyAccessor.cpp.

◆ ~PropertyAccessor()

Lima::Common::PropertyCode::PropertyAccessor::~PropertyAccessor ( )

Definition at line 80 of file PropertyAccessor.cpp.

◆ PropertyAccessor() [2/2]

Lima::Common::PropertyCode::PropertyAccessor::PropertyAccessor ( const PropertyAccessor &  pa)

Definition at line 86 of file PropertyAccessor.cpp.

Member Function Documentation

◆ empty()

bool Lima::Common::PropertyCode::PropertyAccessor::empty ( const LinguisticCode &  l) const

Test if the given code has property data.

In the case of a simple property, property is empty if equal to 0. In the case of a subproperty, the subproperty can be empty and have a non null value, if the parent property is non null.

return true if the given code has an empty property

Parameters
l
Returns
true if property is empty for l.

Definition at line 130 of file PropertyAccessor.cpp.

◆ equal()

bool Lima::Common::PropertyCode::PropertyAccessor::equal ( const LinguisticCode &  l1,
const LinguisticCode &  l2 
) const

check property equality for two linguisticCode

Parameters
l1
l2
Returns
true if l1 and l2 have same property value

Definition at line 123 of file PropertyAccessor.cpp.

◆ getPropertyName()

const std::string & Lima::Common::PropertyCode::PropertyAccessor::getPropertyName ( ) const

Get the property name.

Returns
property name

Definition at line 100 of file PropertyAccessor.cpp.

◆ operator=()

PropertyAccessor & Lima::Common::PropertyCode::PropertyAccessor::operator= ( const PropertyAccessor &  pa)

Definition at line 91 of file PropertyAccessor.cpp.

◆ readValue()

LinguisticCode Lima::Common::PropertyCode::PropertyAccessor::readValue ( const LinguisticCode &  code) const

read a property in a coded int.

This function extract the coded value of a property, which allows to perform comparison.

Parameters
codecoded int from which to read the property
Returns
coded value of the property

Definition at line 105 of file PropertyAccessor.cpp.

◆ writeValue()

void Lima::Common::PropertyCode::PropertyAccessor::writeValue ( const LinguisticCode &  value,
LinguisticCode &  code 
) const

write a property value in a coded int.

This function writes the given coded property value in the given coded int, overriding previous value of the property.

Parameters
valuecoded property value to write. This value can hold several property data.
codecoded int to write to.

Definition at line 115 of file PropertyAccessor.cpp.

Friends And Related Symbol Documentation

◆ PropertyAccessorPrivate

friend class PropertyAccessorPrivate
friend

Definition at line 32 of file PropertyAccessor.h.


The documentation for this class was generated from the following files: