24 #ifndef PXR_USD_SDF_LIST_OP_H
25 #define PXR_USD_SDF_LIST_OP_H
107 if (_addedItems.size() != 0 ||
108 _prependedItems.size() != 0 ||
109 _appendedItems.size() != 0 ||
110 _deletedItems.size() != 0) {
113 return _orderedItems.size() != 0;
128 return _explicitItems;
140 return _prependedItems;
146 return _appendedItems;
152 return _deletedItems;
158 return _orderedItems;
189 typedef std::function<
213 std::optional<SdfListOp<T>>
217 typedef std::function<
218 std::optional<ItemType>(
const ItemType&)
233 bool removeDuplicates =
false);
260 return _isExplicit == rhs._isExplicit &&
261 _explicitItems == rhs._explicitItems &&
262 _addedItems == rhs._addedItems &&
263 _prependedItems == rhs._prependedItems &&
264 _appendedItems == rhs._appendedItems &&
265 _deletedItems == rhs._deletedItems &&
266 _orderedItems == rhs._orderedItems;
270 return !(*
this == rhs);
274 void _SetExplicit(
bool isExplicit);
277 typedef std::list<ItemType> _ApplyList;
278 typedef std::map<ItemType, typename _ApplyList::iterator, _ItemComparator>
311 template <
class ItemType>
314 const std::vector<ItemType>&
order);
318 template <
typename T>
320 std::ostream & operator<<( std::ostream &, const SdfListOp<T> & );
336 #endif // PXR_USD_SDF_LIST_OP_H
void swap(ArAssetInfo &lhs, ArAssetInfo &rhs)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
ItemVector value_vector_type
const ItemVector & GetPrependedItems() const
Returns the explicit items.
SDF_API void ComposeOperations(const SdfListOp< T > &stronger, SdfListOpType op)
const ItemVector & GetExplicitItems() const
Returns the explicit items.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
const ItemVector & GetAppendedItems() const
Returns the explicit items.
SDF_API const ItemVector & GetItems(SdfListOpType type) const
Return the item vector identified by type.
GLsizei const GLchar *const * string
SDF_API bool ReplaceOperations(const SdfListOpType op, size_t index, size_t n, const ItemVector &newItems)
class SdfListOp< class SdfReference > SdfReferenceListOp
SDF_API void ClearAndMakeExplicit()
Removes all items and changes the list to be explicit.
**But if you need a result
class SdfListOp< uint64_t > SdfUInt64ListOp
SDF_API void Swap(SdfListOp< T > &rhs)
class SdfListOp< class SdfPayload > SdfPayloadListOp
class SdfListOp< class SdfUnregisteredValue > SdfUnregisteredValueListOp
std::function< std::optional< ItemType >const ItemType &) > ModifyCallback
Callback type for ModifyOperations.
class SdfListOp< class SdfPath > SdfPathListOp
class SdfListOp< int > SdfIntListOp
const ItemVector & GetOrderedItems() const
Returns the ordered items.
const ItemVector & GetAddedItems() const
Returns the explicit items.
const ItemVector & GetDeletedItems() const
Returns the deleted items.
SDF_API ItemVector GetAppliedItems() const
GLdouble GLdouble GLint GLint order
class SdfListOp< std::string > SdfStringListOp
SDF_API void SetOrderedItems(const ItemVector &items)
SDF_API void SetExplicitItems(const ItemVector &items)
SDF_API void Clear()
Removes all items and changes the list to be non-explicit.
class SdfListOp< int64_t > SdfInt64ListOp
class SdfListOp< TfToken > SdfTokenListOp
auto search(const T &set, const V &val) -> std::pair< bool, decltype(std::begin(detail::smart_deref(set)))>
A search function.
class SdfListOp< unsigned int > SdfUIntListOp
SDF_API SdfListOp()
Create an empty ListOp in non-explicit mode.
bool operator!=(const SdfListOp< T > &rhs) const
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
SDF_API void SetAddedItems(const ItemVector &items)
SDF_API void ApplyOperations(ItemVector *vec, const ApplyCallback &cb=ApplyCallback()) const
static SDF_API SdfListOp CreateExplicit(const ItemVector &explicitItems=ItemVector())
Create a ListOp in explicit mode with the given explicitItems.
SDF_API void SdfApplyListOrdering(std::vector< ItemType > *v, const std::vector< ItemType > &order)
#define PXR_NAMESPACE_CLOSE_SCOPE
SDF_API bool ModifyOperations(const ModifyCallback &callback, bool removeDuplicates=false)
std::vector< ItemType > ItemVector
SDF_API void SetDeletedItems(const ItemVector &items)
SDF_API void SetItems(const ItemVector &items, SdfListOpType type)
Sets the item vector for the given operation type.
static SDF_API SdfListOp Create(const ItemVector &prependedItems=ItemVector(), const ItemVector &appendedItems=ItemVector(), const ItemVector &deletedItems=ItemVector())
SDF_API void SetPrependedItems(const ItemVector &items)
bool operator==(const SdfListOp< T > &rhs) const
std::function< std::optional< ItemType >SdfListOpType, const ItemType &) > ApplyCallback
Callback type for ApplyOperations.
std::less< T > ItemComparator
SDF_API bool HasItem(const T &item) const
Returns true if the given item is in any of the item lists.
bool IsExplicit() const
Returns true if the list is explicit.
SDF_API void SetAppendedItems(const ItemVector &items)
friend size_t hash_value(const SdfListOp &op)