Claw  1.7.3
Public Types | Public Member Functions | List of all members
claw::max_vector< E, Comp, Container > Class Template Reference

Fill a container with some values, keeping only all the "maximum" inserted values. More...

#include <max_vector.hpp>

Public Types

typedef E value_type
 The type of the values stored in the container.
typedef Comp comparator_type
 The comparator used to compare the values inserted.
typedef Container container_type
 The type of the container in which the values are stored.

Public Member Functions

 max_vector ()
 Constructor.
 max_vector (const value_type &e)
 Constructor with an initial value.
void add (const value_type &e)
 Insert a value in the vector.
const container_typeget_v () const
 Get the stored values.

Detailed Description

template<typename E, typename Comp = std::less<E>, typename Container = std::vector<E>>
class claw::max_vector< E, Comp, Container >

Fill a container with some values, keeping only all the "maximum" inserted values.

Adding a value greater than the previous ones remove all the old values.

Template parameters:

Definition at line 55 of file max_vector.hpp.

Constructor & Destructor Documentation

template<typename E , typename Comp , typename Container >
claw::max_vector< E, Comp, Container >::max_vector ( const value_type e)
explicit

Constructor with an initial value.

Parameters
eélément ajouté.

Definition at line 47 of file max_vector.tpp.

Member Function Documentation

template<typename E , typename Comp , typename Container >
void claw::max_vector< E, Comp, Container >::add ( const value_type e)

Insert a value in the vector.

Parameters
eThe value to insert.

Definition at line 58 of file max_vector.tpp.

Referenced by claw::ai::game::select_random_action< Method >::operator()().


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