FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | List of all members
Fiber::ElementProxy< Iterator > Class Template Reference

A proxy for Iterators, such that an Iterator's element looks like an Iterator's element (!), even though it isn't (the internal storage layout may be different). More...

#include <Iterator.hpp>

Public Types

enum  { SIZE = Components }
 
typedef element_value_t value_type
 

Public Member Functions

 ElementProxy (const Iterator &Owner, index_t Idx)
 Construct an ElementProxy as a reference to a specific element in a given array, which is accessed via the given Iterator.
 
 operator array_t () const
 Implicit type conversion into an array element.
 
ElementProxyoperator= (const array_t &v)
 Assign an array element.
 
ElementProxyoperator= (const ElementProxy &in)
 Assign an array element from another element proxy.
 
Eagle::Assignment< ElementProxy, 0 > operator= (const element_value_t &x)
 Overloading of the assignment operator such that the comma operator may be used to assign components successively.
 
ElementProxyoperator+= (const array_t &v)
 Self-addition operator.
 
ElementProxyoperator-= (const array_t &v)
 Self-substraction operator.
 
element_value_t & operator[] (int c) const
 access a component of the element
 

Detailed Description

template<class Iterator>
class Fiber::ElementProxy< Iterator >

A proxy for Iterators, such that an Iterator's element looks like an Iterator's element (!), even though it isn't (the internal storage layout may be different).

Parameters
IteratorThe Iterator must export
array_t(typedef) the type of each component
Components(enum) the number of components
getComponent(intidx,int c) a function returning a reference to the c'th component of the idx'th index in the field.

Constructor & Destructor Documentation

◆ ElementProxy()

template<class Iterator >
Fiber::ElementProxy< Iterator >::ElementProxy ( const Iterator Owner,
index_t  Idx 
)
inline

Construct an ElementProxy as a reference to a specific element in a given array, which is accessed via the given Iterator.

Parameters
Ownerthe Iterator referring to the array

Member Function Documentation

◆ operator array_t()

Implicit type conversion into an array element.

Note
This function creates a temporary object; it is convenient, but slow.

References Fiber::Iterator< T >::getComponent().