![]() |
|
Maps names to inputs or outputs (a.k.a. More...
#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. | |
| VdfConnectorMap (size_t n) | |
Creates a map that can hold at least n elements without reallocation. | |
| ~VdfConnectorMap () | |
| Destroys all connector instances owned by this map. | |
| const_iterator | begin () const |
| Returns a const_iterator pointing to the beginning of the map. | |
| const_iterator | end () const |
| Returns a const_iterator pointing to the end of the map. | |
| const_reverse_iterator | rbegin () const |
| Returns a const_reverse_iterator pointing to the beginning of the map. | |
| const_reverse_iterator | rend () const |
| Returns a const_reverse_iterator pointing to the end of the map. | |
| size_type | size () const |
| Returns the size of the map. | |
| bool | empty () const |
Returns true if the map's size is 0. | |
| void | swap (VdfConnectorMap &x) |
Swaps the contents of this map with x. | |
| void | clear () |
| Erases all of the elements. | |
| const_iterator | find (const key_type &k) const |
Finds the element with key k. | |
| bool | operator== (const VdfConnectorMap &x) const |
| Test two maps for equality. | |
| bool | operator!= (const VdfConnectorMap &x) const |
| template<typename... Args> | |
| std::pair< const_iterator, bool > | try_emplace (const key_type &k, Args &&... args) |
Inserts an element with key k if one does not already exist. | |
| 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. | |
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.
| using const_iterator = typename _Vector::const_iterator |
Definition at line 51 of file connectorMap.h.
| using const_reference = const _Pair& |
Definition at line 46 of file connectorMap.h.
| using const_reverse_iterator = typename _Vector::const_reverse_iterator |
Definition at line 52 of file connectorMap.h.
| using difference_type = typename _Vector::difference_type |
Definition at line 48 of file connectorMap.h.
| using iterator = typename _Vector::const_iterator |
Definition at line 49 of file connectorMap.h.
Definition at line 41 of file connectorMap.h.
| using mapped_type = Connector* |
Definition at line 42 of file connectorMap.h.
| using pointer = _Pair* |
Definition at line 44 of file connectorMap.h.
| using reference = _Pair& |
Definition at line 45 of file connectorMap.h.
| using reverse_iterator = typename _Vector::const_reverse_iterator |
Definition at line 50 of file connectorMap.h.
| using size_type = typename _Vector::size_type |
Definition at line 47 of file connectorMap.h.
| using value_type = _Pair |
Definition at line 43 of file connectorMap.h.
|
default |
Creates an empty vector.
|
inlineexplicit |
Creates a map that can hold at least n elements without reallocation.
Definition at line 61 of file connectorMap.h.
|
inline |
Destroys all connector instances owned by this map.
Definition at line 66 of file connectorMap.h.
|
inline |
Returns a const_iterator pointing to the beginning of the map.
Definition at line 71 of file connectorMap.h.
| void clear |
Erases all of the elements.
This destroys all connector instances owned by this map.
Definition at line 176 of file connectorMap.h.
|
inline |
Returns true if the map's size is 0.
Definition at line 96 of file connectorMap.h.
|
inline |
Returns a const_iterator pointing to the end of the map.
Definition at line 76 of file connectorMap.h.
| VdfConnectorMap< Connector >::const_iterator find | ( | const key_type & | k | ) | const |
Finds the element with key k.
Definition at line 149 of file connectorMap.h.
|
inline |
Definition at line 124 of file connectorMap.h.
|
inline |
Test two maps for equality.
Definition at line 120 of file connectorMap.h.
|
inline |
Returns a const_reverse_iterator pointing to the beginning of the map.
Definition at line 81 of file connectorMap.h.
|
inline |
Returns a const_reverse_iterator pointing to the end of the map.
Definition at line 86 of file connectorMap.h.
|
inline |
Returns the size of the map.
Definition at line 91 of file connectorMap.h.
|
inline |
Swaps the contents of this map with x.
Definition at line 101 of file connectorMap.h.
| std::pair< const_iterator, bool > 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 \k and bool is true if a new element was inserted.
| std::pair< typename VdfConnectorMap< Connector >::const_iterator, bool > try_emplace | ( | const key_type & | k, |
| Args &&... | args | ||
| ) |
Definition at line 164 of file connectorMap.h.
|
friend |
Swaps the contents of lhs and rhs.
Definition at line 106 of file connectorMap.h.