16 #ifndef SELECTOR_MANAGER_H 17 #define SELECTOR_MANAGER_H 38 for (
unsigned int i = 0; i < manager.
selectors.size(); i++)
58 for (
unsigned int i = 0; i <
selectors.size(); i++)
84 vector<unsigned long long> dataToReplace;
85 unsigned long long oldData;
86 for (
unsigned int i = 0; i <
selectors.size(); i++)
88 switch (
selectors.at(i)->canBeInserted(data, oldData))
98 rejectedData.insert(pair<unsigned long long, T*>(data->getConstructId(), data));
103 dataToReplace.push_back(oldData);
113 for (
unsigned int i = 0; i < dataToReplace.size(); i++)
115 typename std::map<unsigned long long, T*>::iterator it =
selectedData.find(dataToReplace.at(i));
119 T* previousData = it->second;
128 rejectedData.insert(pair<unsigned long long, T*>(previousData->getConstructId(), previousData));
134 for (
unsigned int i = 0; i <
selectors.size(); i++)
141 selectedData.insert(pair<unsigned long long, T*>(data->getConstructId(), data));
bool deletable
Flag to know if a data may be deleted if rejected (by default, yes)
std::map< unsigned long long, T * > selectedData
Contains accepted data (rays)
std::vector< Selector< T > * > & getSelectors() const
Return the Selector's list.
void addSelector(Selector< T > *selector)
Add a Selector to the list.
bool appendData(T *data)
Append data (typically a ray) and loop on Selectors to filter.
std::map< unsigned long long, T * > & getSelectedData()
Get the selected data.
void setDeletable(bool _isDeletable)
Set deletable flag.
Base class for Selector (used to keep or disable rays according different criterias) ...
bool isDeletable()
Return true if this may be deleted.
void reset()
Reset all the Selector and clear the local data.
SelectorManager()
Constructor.
SelectorManager(const SelectorManager< T > &manager)
Copy constructor.
virtual ~SelectorManager()
Destructor.
std::vector< Selector< T > * > selectors
Pointers list of Selector.
std::map< unsigned long long, T * > rejectedData
Contains rejected data (rays) if deletable set to false.