Ares
Public Member Functions | Public Attributes

Helpers::Alex::DistinctCollector< T > Class Template Reference

#include <src/Utilities/Helpers.Alex.h>

List of all members.

Public Member Functions

bool Collect (T value)
std::tr1::function< bool(T)> getCollector ()
void forEach (std::tr1::function< bool(T)> action)

Public Attributes

std::set< T,
StrictWeakComparer< T > > 
Value

template<typename T>
class Helpers::Alex::DistinctCollector< T >


Member Function Documentation

template<typename T >
bool Helpers::Alex::DistinctCollector< T >::Collect ( value) [inline]
                                              {
                                Value.insert(value);
                                return true;
                        }
template<typename T >
void Helpers::Alex::DistinctCollector< T >::forEach ( std::tr1::function< bool(T)>  action) [inline]
                                                                      {
                                if(action) {
                                        for(auto iterator = Value.begin(); iterator != Value.end(); iterator++) {
                                                T Obj = *iterator;
                                                if(!action(Obj)) {
                                                        return;
                                                }
                                        }
                                }
                        }
template<typename T >
std::tr1::function<bool (T)> Helpers::Alex::DistinctCollector< T >::getCollector ( ) [inline]
                                                                {
                                return [&](T obj) -> bool { return Collect(obj); };
                        }

Member Data Documentation

template<typename T >
std::set<T, StrictWeakComparer<T> > Helpers::Alex::DistinctCollector< T >::Value

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines