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