src
Public Member Functions | List of all members
re2c::uniq_vector_t< value_t > Class Template Reference

#include <uniq_vector.h>

Public Member Functions

 uniq_vector_t ()
 
size_t size () const
 
const value_t & operator[] (size_t i) const
 
size_t find_or_add (const value_t &v)
 

Detailed Description

template<typename value_t>
class re2c::uniq_vector_t< value_t >

Definition at line 13 of file uniq_vector.h.

Constructor & Destructor Documentation

template<typename value_t>
re2c::uniq_vector_t< value_t >::uniq_vector_t ( )
inline

Definition at line 18 of file uniq_vector.h.

19  : elems ()
20  {}

Member Function Documentation

template<typename value_t>
size_t re2c::uniq_vector_t< value_t >::find_or_add ( const value_t &  v)
inline

Definition at line 29 of file uniq_vector.h.

30  {
31  const size_t size = elems.size ();
32  for (size_t i = 0; i < size; ++i)
33  {
34  if (elems[i] == v)
35  {
36  return i;
37  }
38  }
39  elems.push_back (v);
40  return size;
41  }
size_t size() const
Definition: uniq_vector.h:21

Here is the caller graph for this function:

template<typename value_t>
const value_t& re2c::uniq_vector_t< value_t >::operator[] ( size_t  i) const
inline

Definition at line 25 of file uniq_vector.h.

26  {
27  return elems[i];
28  }
template<typename value_t>
size_t re2c::uniq_vector_t< value_t >::size ( ) const
inline

Definition at line 21 of file uniq_vector.h.

22  {
23  return elems.size ();
24  }

Here is the caller graph for this function:


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