HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VdfConnectorMap< Connector > Class Template Reference

#include <connectorMap.h>

Public Types

using key_type = TfToken
 
using mapped_type = Connector *
 
using value_type = _Pair
 
using pointer = _Pair *
 
using reference = _Pair &
 
using const_reference = const _Pair &
 
using size_type = typename _Vector::size_type
 
using difference_type = typename _Vector::difference_type
 
using iterator = typename _Vector::const_iterator
 
using reverse_iterator = typename _Vector::const_reverse_iterator
 
using const_iterator = typename _Vector::const_iterator
 
using const_reverse_iterator = typename _Vector::const_reverse_iterator
 

Public Member Functions

 VdfConnectorMap ()=default
 Creates an empty vector. More...
 
 VdfConnectorMap (size_t n)
 
 ~VdfConnectorMap ()
 Destroys all connector instances owned by this map. More...
 
const_iterator begin () const
 Returns a const_iterator pointing to the beginning of the map. More...
 
const_iterator end () const
 Returns a const_iterator pointing to the end of the map. More...
 
const_reverse_iterator rbegin () const
 Returns a const_reverse_iterator pointing to the beginning of the map. More...
 
const_reverse_iterator rend () const
 Returns a const_reverse_iterator pointing to the end of the map. More...
 
size_type size () const
 Returns the size of the map. More...
 
bool empty () const
 Returns true if the map's size is 0. More...
 
void swap (VdfConnectorMap &x)
 Swaps the contents of this map with x. More...
 
void clear ()
 
const_iterator find (const key_type &k) const
 Finds the element with key k. More...
 
bool operator== (const VdfConnectorMap &x) const
 Test two maps for equality. More...
 
bool operator!= (const VdfConnectorMap &x) const
 
template<typename... Args>
std::pair< const_iterator, bool > try_emplace (const key_type &k, Args &&...args)
 
template<typename... Args>
std::pair< typename
VdfConnectorMap< Connector >
::const_iterator, bool > 
try_emplace (const key_type &k, Args &&...args)
 

Friends

void swap (VdfConnectorMap &lhs, VdfConnectorMap &rhs)
 Swaps the contents of lhs and rhs. More...
 

Detailed Description

template<typename Connector>
class VdfConnectorMap< Connector >

Maps names to inputs or outputs (a.k.a. connectors.)

VdfConnectorMap is intended to map TfToken names to VdfInput or VdfOutput pointers on behalf of VdfNode. The map is responsible for constructing Connector objects and retains ownership of the pointed-to objects.

Only a limited subset of the associative container interface is provided and lookup is implemented with a linear search. This can be efficient for storing small numbers of elements, especially when key comparison is quick.

Definition at line 34 of file connectorMap.h.

Member Typedef Documentation

template<typename Connector>
using VdfConnectorMap< Connector >::const_iterator = typename _Vector::const_iterator

Definition at line 51 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::const_reference = const _Pair&

Definition at line 46 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::const_reverse_iterator = typename _Vector::const_reverse_iterator

Definition at line 52 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::difference_type = typename _Vector::difference_type

Definition at line 48 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::iterator = typename _Vector::const_iterator

Definition at line 49 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::key_type = TfToken

Definition at line 41 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::mapped_type = Connector*

Definition at line 42 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::pointer = _Pair*

Definition at line 44 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::reference = _Pair&

Definition at line 45 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::reverse_iterator = typename _Vector::const_reverse_iterator

Definition at line 50 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::size_type = typename _Vector::size_type

Definition at line 47 of file connectorMap.h.

template<typename Connector>
using VdfConnectorMap< Connector >::value_type = _Pair

Definition at line 43 of file connectorMap.h.

Constructor & Destructor Documentation

template<typename Connector>
VdfConnectorMap< Connector >::VdfConnectorMap ( )
default

Creates an empty vector.

template<typename Connector>
VdfConnectorMap< Connector >::VdfConnectorMap ( size_t  n)
inlineexplicit

Creates a map that can hold at least n elements without reallocation.

Definition at line 61 of file connectorMap.h.

template<typename Connector>
VdfConnectorMap< Connector >::~VdfConnectorMap ( )
inline

Destroys all connector instances owned by this map.

Definition at line 66 of file connectorMap.h.

Member Function Documentation

template<typename Connector>
const_iterator VdfConnectorMap< Connector >::begin ( void  ) const
inline

Returns a const_iterator pointing to the beginning of the map.

Definition at line 71 of file connectorMap.h.

template<typename Connector >
void VdfConnectorMap< Connector >::clear ( )

Erases all of the elements.

This destroys all connector instances owned by this map.

Definition at line 176 of file connectorMap.h.

template<typename Connector>
bool VdfConnectorMap< Connector >::empty ( void  ) const
inline

Returns true if the map's size is 0.

Definition at line 96 of file connectorMap.h.

template<typename Connector>
const_iterator VdfConnectorMap< Connector >::end ( void  ) const
inline

Returns a const_iterator pointing to the end of the map.

Definition at line 76 of file connectorMap.h.

template<typename Connector >
VdfConnectorMap< Connector >::const_iterator VdfConnectorMap< Connector >::find ( const key_type k) const

Finds the element with key k.

Definition at line 149 of file connectorMap.h.

template<typename Connector>
bool VdfConnectorMap< Connector >::operator!= ( const VdfConnectorMap< Connector > &  x) const
inline

Definition at line 124 of file connectorMap.h.

template<typename Connector>
bool VdfConnectorMap< Connector >::operator== ( const VdfConnectorMap< Connector > &  x) const
inline

Test two maps for equality.

Definition at line 120 of file connectorMap.h.

template<typename Connector>
const_reverse_iterator VdfConnectorMap< Connector >::rbegin ( ) const
inline

Returns a const_reverse_iterator pointing to the beginning of the map.

Definition at line 81 of file connectorMap.h.

template<typename Connector>
const_reverse_iterator VdfConnectorMap< Connector >::rend ( ) const
inline

Returns a const_reverse_iterator pointing to the end of the map.

Definition at line 86 of file connectorMap.h.

template<typename Connector>
size_type VdfConnectorMap< Connector >::size ( void  ) const
inline

Returns the size of the map.

Definition at line 91 of file connectorMap.h.

template<typename Connector>
void VdfConnectorMap< Connector >::swap ( VdfConnectorMap< Connector > &  x)
inline

Swaps the contents of this map with x.

Definition at line 101 of file connectorMap.h.

template<typename Connector>
template<typename... Args>
std::pair<const_iterator, bool> VdfConnectorMap< Connector >::try_emplace ( const key_type k,
Args &&...  args 
)

Inserts an element with key k if one does not already exist.

If a new element is inserted, a new Connector is constructed by forwarding args. Otherwise, args are not moved.

Returns a pair of (const_iterator, bool) where the iterator points to the element in the map for key and bool is true if a new element was inserted.

template<typename Connector>
template<typename... Args>
std::pair<typename VdfConnectorMap<Connector>::const_iterator, bool> VdfConnectorMap< Connector >::try_emplace ( const key_type k,
Args &&...  args 
)

Definition at line 164 of file connectorMap.h.

Friends And Related Function Documentation

template<typename Connector>
void swap ( VdfConnectorMap< Connector > &  lhs,
VdfConnectorMap< Connector > &  rhs 
)
friend

Swaps the contents of lhs and rhs.

Definition at line 106 of file connectorMap.h.


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