LELArrayBase.h
Classes
- LELArrayBase -- Base class for LELArray holding the mask. (full description)
Interface
- Public Members
- LELArrayBase() : itsMaskPtr(0)
- LELArrayBase (const Array<Bool>& mask) : itsMaskPtr(new Array<Bool>(mask))
- LELArrayBase (const LELArrayBase& other)
- ~LELArrayBase()
- LELArrayBase& operator= (const LELArrayBase& other)
- Bool isMasked() const
- const Array<Bool>& mask() const
- Array<Bool>& mask()
- void removeMask()
- void setMask (const Array<Bool>& other)
- void setMask (const LELArrayBase& other)
- void setMask (Array<Bool>& other)
- void setMask (const LELArrayBase& left, const LELArrayBase& right)
- void combineMask (const LELArrayBase& other)
- void combineMask (const Array<Bool>& mask)
- void combineOrAnd (Bool desiredValue, const Array<Bool>& value)
- void combineOrAnd (Bool desiredValue, Array<Bool>& value, const Array<Bool>& temp)
- void combineOrAnd (Bool desiredValue, Array<Bool>& value, const Array<Bool>& temp, const Array<Bool>& tempMask)
Review Status
- Date Reviewed:
- yyyy/mm/dd
Synopsis
This LEL class holds an array with a mask.
The mask can be a single Bool valid for all elements of the array.
Otherwise it is a full mask with the same shape as the array.
Motivation
It maskes it possible to handle an array with its mask as a single object.
To Do
Member Description
Default constructor sets to mask all true.
LELArrayBase (const Array<Bool>& mask) : itsMaskPtr(new Array<Bool>(mask))
Constructor takes mask.
LELArrayBase (const LELArrayBase& other)
Copy constructor (reference semantics)..
LELArrayBase& operator= (const LELArrayBase& other)
Assignment (reference semantics).
Does the value have a mask?
Get mask.
Remove the mask.
void setMask (const Array<Bool>& other)
Set the mask from given array (takes reference).
void setMask (const LELArrayBase& other)
Set the mask from the mask of the other value.
Set the mask from given array (takes reference).
void setMask (const LELArrayBase& left, const LELArrayBase& right)
Set the mask by combining the masks of both values.
void combineMask (const LELArrayBase& other)
void combineMask (const Array<Bool>& mask)
Combine the mask of this and the other value (by anding them).
void combineOrAnd (Bool desiredValue, Array<Bool>& value, const Array<Bool>& temp)
Combine the mask with the given value in case of an OR or AND.
It means the mask is set to true if value is desiredValue
(which should be True for OR and False for AND).
Combine for two arrays taking the true/false array values into account.
The mask and value are set to desiredValue if the temp value is desiredValue.
void combineOrAnd (Bool desiredValue, Array<Bool>& value, const Array<Bool>& temp, const Array<Bool>& tempMask)
Combine the mask with the given value in case of an OR or AND.
It means the mask is set to true if value is desiredValue
(which should be True for OR and False for AND).
Combine for two arrays taking the true/false array values and mask
into account.
The mask and value are set to desiredValue if the temp value is desiredValue
and its temp mask it true.
The mask is set to false if the temp mask is False.
void combineOrAnd (Bool desiredValue, const Array<Bool>& value)
Combine the mask with the given value in case of an OR or AND.
It means the mask is set to true if value is desiredValue
(which should be True for OR and False for AND).