DUECA/DUSIME
Loading...
Searching...
No Matches
dueca::fixvector_withdefault< N, T, DEFLT, BASE > Class Template Reference

Fixed-sized vector, with a numeric default. More...

#include <fixvector_withdefault.hxx>

Inheritance diagram for dueca::fixvector_withdefault< N, T, DEFLT, BASE >:
Collaboration diagram for dueca::fixvector_withdefault< N, T, DEFLT, BASE >:

Public Member Functions

 fixvector_withdefault (const T &defval)
 constructor with default value for the data
 fixvector_withdefault (const std::initializer_list< T > &e)
 constructor with initializer list
 fixvector_withdefault ()
 constructor without default value for the data
 fixvector_withdefault (const fixvector< N, T > &other)
 copy constructor; copies the data
template<class InputIt>
 fixvector_withdefault (InputIt first, InputIt last)
 construct from iterators
fixvector_withdefault< N, T, DEFLT, BASE > & operator= (const fixvector_withdefault< N, T, DEFLT, BASE > &other)
 assignment operator
fixvector_withdefault< N, T, DEFLT, BASE > & operator= (const T &val)
 assignment operator, to value type
bool operator== (const fixvector_withdefault< N, T, DEFLT, BASE > &other) const
 equality test
bool operator!= (const fixvector_withdefault< N, T, DEFLT, BASE > &other) const
 inequality test
void setDefault ()
 Set all elements to the default value.
Public Member Functions inherited from dueca::fixvector< N, T >
 fixvector (const T &defval)
 constructor with default value for the data
 fixvector (const std::initializer_list< T > &e)
 constructor with initializer list
 fixvector ()
 constructor without default value for the data
 fixvector (const fixvector< N, T > &other)
 copy constructor; copies the data
template<class InputIt>
 fixvector (InputIt first, InputIt last)
 construct from iterators
 ~fixvector ()
 destructor
 operator pointer (void)
 obtain a pointer directly to the data
 operator const_pointer (void) const
 obtain a const pointer directly to the data
iterator begin ()
 more-or-less stl-compatible iterator
iterator end ()
 more-or-less stl-compatible iterator
const_iterator begin () const
 more-or-less stl-compatible iterator
const_iterator end () const
 more-or-less stl-compatible iterator
size_t size () const
 size of the vector
fixvector< N, T > & operator= (const fixvector< N, T > &other)
 assignment operator
fixvector< N, T > & operator= (const T &val)
 assignment operator, to value type
bool operator== (const fixvector< N, T > &other) const
 equality test
bool operator!= (const fixvector< N, T > &other) const
 inequality test
template<typename idx_t>
const T & operator[] (idx_t ii) const
 access elements of the vector.
template<typename idx_t>
T & operator[] (idx_t ii)
 access elements of the vector.
void resize (size_t s)
 forced resize of the vector, is seldom possible, so may throw
const T * ptr () const
 access as const pointer
T * ptr ()
 access as pointer
reference front ()
 access first element
const_reference front () const
 access first element
reference back ()
 access last element
const_reference back () const
 access last element

Static Public Attributes

static constexpr const char * classname = "fixvector_default"
 class name, for reflection

Additional Inherited Members

Public Types inherited from dueca::fixvector< N, T >
typedef T value_type
 Type of the contained object.
typedef T * pointer
 Type of a pointer to the contained object.
typedef T & reference
 Type of a reference to the contained object.
typedef const T & const_reference
 Type of a reference to the contained object.
typedef const T * const_pointer
 Type of a pointer to the contained object.
typedef pointer iterator
 Define the iterator type.
typedef const_pointer const_iterator
 Define the const iterator type.
typedef ::std::reverse_iterator< const_iteratorconst_reverse_iterator
 Define the reverse const iterator type.
typedef ::std::reverse_iterator< iteratorreverse_iterator
 Define the reverse iterator type.
typedef ::std::random_access_iterator_tag iterator_category
 Show random access is possible.
typedef ::size_t size_type
 Size of the underlying thing.
typedef ::std::ptrdiff_t difference_type
 Pointer difference.
Protected Attributes inherited from dueca::fixvector< N, T >
d [N]
 Data space.

Detailed Description

template<size_t N, typename T, int DEFLT, unsigned BASE = 1>
class dueca::fixvector_withdefault< N, T, DEFLT, BASE >

Fixed-sized vector, with a numeric default.

Implementing most stl-like interfaces, but using a fixed vector length; efficiently packed in DCO objects.

Template Parameters
NSize of the vector
TDatatype. Note that the conversions int->T and unsigned->T must exist.
DEFLTDefault (integer) value
BASEDefault base, default=1, initial and default values are T(DEFLT)/T(BASE)

Constructor & Destructor Documentation

◆ fixvector_withdefault()

template<size_t N, typename T, int DEFLT, unsigned BASE = 1>
dueca::fixvector_withdefault< N, T, DEFLT, BASE >::fixvector_withdefault ( const T & defval)
inline

constructor with default value for the data

Parameters
defvaldefault fill value

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/dueca-4.2.8-build/dueca-4.2.8/dueca/fixvector_withdefault.hxx