ivutils
Loading...
Searching...
No Matches
storage_prototype Struct Reference

Storage template prototype for a vector. More...

#include <vector_3c.h>

Public Types

typedef double value_type
 Storage class should define value_type, double used as example here.
 

Public Member Functions

 storage_prototype ()
 Storage class should have default constructor.
 
 storage_prototype (storage_prototype &other)
 Storage class should have copy constructor.
 
void resize (size_t new_dim)
 Storage class should have resize function for setting new size.
 
void resize (size_t new_dim, const value_type &value)
 Same as storage_prototype::resize(size_t) but with a value to be set for all new elements.
 
size_t dim () const
 Storage class should provide function for querying vector dimension.
 
value_typeoperator[] (size_t i) const
 Storage class should provide [] operator for randomly accessing its elements for read and write (size_t index).
 
value_typeoperator[] (int i) const
 Storage class should provide [] operator for randomly accessing its elements for read and write (integer index).
 

Detailed Description

Storage template prototype for a vector.

Member Function Documentation

◆ operator[]()

value_type & storage_prototype::operator[] ( int  i) const

Storage class should provide [] operator for randomly accessing its elements for read and write (integer index).

Integer index is used for compatibility with old Vector_3 code.

◆ resize()

void storage_prototype::resize ( size_t  new_dim)

Storage class should have resize function for setting new size.

It is called for "result" vectors created by default constructor to communicate actual dimension, implementation may be skipped if dimension is preset. New elements must be initialized by 0.


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