HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iterator.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/arch/hints.h"
#include "pxr/base/tf/diagnosticLite.h"
#include <iterator>
#include <type_traits>
#include <utility>
+ Include dependency graph for iterator.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Tf_ShouldIterateOverCopy< T >
 
struct  Tf_IteratorInterface< T, Reverse >
 
struct  Tf_IteratorInterface< const T, Reverse >
 
struct  Tf_IteratorInterface< T, true >
 
struct  Tf_IteratorInterface< const T, true >
 
class  TfIterator< T, Reverse >
 
class  Tf_ProxyReferenceReverseIterator< UnderlyingIterator >
 

Macros

#define TF_FOR_ALL(iter, c)
 
#define TF_REVERSE_FOR_ALL(iter, c)
 

Functions

template<class T >
TfIterator< typename
std::remove_reference< T >
::type
TfMakeIterator (T &&container)
 
template<class T >
TfIterator< typename
std::remove_reference< T >
::type, true > 
TfMakeReverseIterator (T &&container)
 
template<class T , size_t N>
constexpr size_t TfArraySize (const T(&array)[N]) noexcept
 

Detailed Description

A simple iterator adapter for STL containers.

Definition in file iterator.h.

Macro Definition Documentation

#define TF_FOR_ALL (   iter,
 
)

Macro for iterating over a container.

For any container c of type T, the following loop

for (TfIterator<T> i = c.begin(); i; ++i) {
...
}

is equivalent to

...
}

Definition at line 390 of file iterator.h.

#define TF_REVERSE_FOR_ALL (   iter,
 
)

Macro for iterating over a container in reverse.

Operates like TF_FOR_ALL, but iterates the container in reverse order.

Definition at line 399 of file iterator.h.

Function Documentation

template<class T , size_t N>
constexpr size_t TfArraySize ( const T(&)  array[N])
noexcept

Returns the number of elements in a statically sized array.

This function is an implementation of the array version of C++17's std::size()

Definition at line 407 of file iterator.h.

template<class T >
TfIterator<typename std::remove_reference<T>::type> TfMakeIterator ( T &&  container)

Helper functions for creating TfIterator objects.

Definition at line 359 of file iterator.h.

template<class T >
TfIterator<typename std::remove_reference<T>::type, true> TfMakeReverseIterator ( T &&  container)

Definition at line 367 of file iterator.h.