Visual Computing Library
Loading...
Searching...
No Matches
vcl::View< It > Class Template Reference

The View class is a simple class that stores and exposes two iterators begin and end. More...

#include <vclib/types/view.h>

Inheritance diagram for vcl::View< It >:

Public Types

using iterator = It
 
using const_iterator = It
 

Public Member Functions

 View (It begin, It end)
 
auto begin () const
 
auto end () const
 

Protected Attributes

It mBegin
 
It mEnd
 

Detailed Description

template<typename It>
class vcl::View< It >

The View class is a simple class that stores and exposes two iterators begin and end.

It is useful for classes that expose multiple containers, and they do not expose the classic member functions begin()/end(). In these cases, it is possible to expose the view of a selected container by returning a View object initialized with the begin/end iterators.

For example, a Mesh can expose Vertex and Face containers. The mesh exposes the member functions:

  • vertexBegin()
  • vertexEnd()
  • faceBegin()
  • faceEnd() To allow view iteration over vertices, the Mesh could expose a vertices() member function that returns a View object that is constructed in this way:
auto vertices() { return View{vertexBegin(), vertexEnd()}; }
The View class is a simple class that stores and exposes two iterators begin and end.
Definition view.h:67

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