Public Types | Public Member Functions | Protected Attributes

mln::fun::i2v::array< T > Class Template Reference

#include <array.hh>

Inheritance diagram for mln::fun::i2v::array< T >:
Inheritance graph

List of all members.

Public Types

typedef Function_v2v< void > category
typedef i2v::array< Texact_t

typedef T result
 Returned value types.
typedef std::vector< T >::reference mutable_result

Public Member Functions

void append (const T &val)
 Append a new value in the function.
void init_ (unsigned n)
 Initialize an empty function.
result operator() (unsigned i) const
 Const access to the ith value.
mutable_result operator() (unsigned i)
 Read-Write access to the ith value.
void reserve (unsigned n)
 Pre-allocate space.
void resize (unsigned n)
 Set the function size to n.
void resize (unsigned n, const T &val)
 Set the function size to n and initialize the value with val.
unsigned size () const
 Return the number of values.
const std::vector< T > & std_vector () const
 Return the underlying std::vector.

 array ()
 Constructors.
 array (unsigned n)
 Constructs a function with nvalues.
 array (unsigned n, const T &val)
 Constructs a function with nvalues and val as default value.
 array (const util::array< T > &from)
 Used in from_to().
 array (const std::vector< T > &from)
 Used in from_to().

Protected Attributes

std::vector< Tv_

template<typename T>
class mln::fun::i2v::array< T >


Member Typedef Documentation

typedef Function_v2v<void> mln::Function_v2v< i2v::array< T > >::category [inherited]
typedef i2v::array< T > mln::Object< i2v::array< T > >::exact_t [inherited]
template<typename T>
typedef std::vector<T>::reference mln::fun::i2v::array< T >::mutable_result
template<typename T>
typedef T mln::fun::i2v::array< T >::result

Returned value types.


Constructor & Destructor Documentation

template<typename T >
mln::fun::i2v::array< T >::array (  )  [inline]

Constructors.

Default.

template<typename T >
mln::fun::i2v::array< T >::array ( unsigned  n  )  [inline]

Constructs a function with nvalues.

template<typename T>
mln::fun::i2v::array< T >::array ( unsigned  n,
const T val 
) [inline]

Constructs a function with nvalues and val as default value.

template<typename T>
mln::fun::i2v::array< T >::array ( const util::array< T > &  from  )  [inline]

Used in from_to().

Constructs that function from an util::array. Always prefer using from_to instead of this constructor.

template<typename T>
mln::fun::i2v::array< T >::array ( const std::vector< T > &  from  )  [inline]

Used in from_to().

Constructs that function from an std::vector. Always prefer using from_to instead of this constructor.


Member Function Documentation

template<typename T>
void mln::fun::i2v::array< T >::append ( const T val  )  [inline]

Append a new value in the function.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::convert::over_load::from_to_().

template<typename T >
void mln::fun::i2v::array< T >::init_ ( unsigned  n  )  [inline]

Initialize an empty function.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::init_().

template<typename T >
array< T >::result mln::fun::i2v::array< T >::operator() ( unsigned  i  )  const [inline]

Const access to the ith value.

References mln::fun::i2v::array< T >::v_.

template<typename T >
array< T >::mutable_result mln::fun::i2v::array< T >::operator() ( unsigned  i  )  [inline]

Read-Write access to the ith value.

References mln::fun::i2v::array< T >::v_.

template<typename T >
void mln::fun::i2v::array< T >::reserve ( unsigned  n  )  [inline]

Pre-allocate space.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::convert::over_load::from_to_().

template<typename T >
void mln::fun::i2v::array< T >::resize ( unsigned  n  )  [inline]
template<typename T>
void mln::fun::i2v::array< T >::resize ( unsigned  n,
const T val 
) [inline]

Set the function size to n and initialize the value with val.

References mln::fun::i2v::array< T >::v_.

template<typename T >
unsigned mln::fun::i2v::array< T >::size (  )  const [inline]
template<typename T >
const std::vector< T > & mln::fun::i2v::array< T >::std_vector (  )  const [inline]

Return the underlying std::vector.

References mln::fun::i2v::array< T >::v_.

Referenced by mln::value::lut_vec< S, T >::lut_vec().


Member Data Documentation

template<typename T>
std::vector<T> mln::fun::i2v::array< T >::v_ [protected]