7 #ifndef PXR_USD_SDF_LIST_OP_H
8 #define PXR_USD_SDF_LIST_OP_H
102 if (_addedItems.size() != 0 ||
103 _prependedItems.size() != 0 ||
104 _appendedItems.size() != 0 ||
105 _deletedItems.size() != 0) {
108 return _orderedItems.size() != 0;
123 return _explicitItems;
129 return _prependedItems;
135 return _appendedItems;
141 return _deletedItems;
184 std::string* errMsg =
nullptr);
193 typedef std::function<
217 std::optional<SdfListOp<T>>
221 typedef std::function<
222 std::optional<ItemType>(
const ItemType&)
242 bool unusedRemoveDuplicates);
267 return _orderedItems;
290 return _isExplicit == rhs._isExplicit &&
291 _explicitItems == rhs._explicitItems &&
292 _addedItems == rhs._addedItems &&
293 _prependedItems == rhs._prependedItems &&
294 _appendedItems == rhs._appendedItems &&
295 _deletedItems == rhs._deletedItems &&
296 _orderedItems == rhs._orderedItems;
300 return !(*
this == rhs);
304 void _SetExplicit(
bool isExplicit);
307 typedef std::list<ItemType> _ApplyList;
308 typedef std::map<ItemType, typename _ApplyList::iterator, _ItemComparator>
329 template <
class ItemType>
331 const std::vector<ItemType> &
order);
332 bool _MakeUnique(std::vector<T>& items,
bool reverse=
false,
333 std::string* errMsg =
nullptr);
354 template <
class ItemType>
357 const std::vector<ItemType>&
order);
361 template <
typename T>
363 std::ostream & operator<<( std::ostream &, const SdfListOp<T> & );
379 #endif // PXR_USD_SDF_LIST_OP_H
SDF_API bool SetItems(const ItemVector &items, SdfListOpType type, std::string *errMsg=nullptr)
void swap(ArAssetInfo &lhs, ArAssetInfo &rhs)
SDF_API bool SetAppendedItems(const ItemVector &items, std::string *errMsg=nullptr)
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.
PUGI__FN void reverse(I begin, I end)
friend void SdfApplyListOrdering(std::vector< ItemType > *v, const std::vector< ItemType > &order)
**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
GLint GLint GLsizei GLint GLenum GLenum type
SDF_API bool ModifyOperations(const ModifyCallback &callback)
class SdfListOp< int > SdfIntListOp
const ItemVector & GetOrderedItems() const
const ItemVector & GetAddedItems() const
SDF_API bool SetExplicitItems(const ItemVector &items, std::string *errMsg=nullptr)
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 bool SetDeletedItems(const ItemVector &items, std::string *errMsg=nullptr)
SDF_API bool SetPrependedItems(const ItemVector &items, std::string *errMsg=nullptr)
SDF_API void SetOrderedItems(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
std::vector< ItemType > ItemVector
static SDF_API SdfListOp Create(const ItemVector &prependedItems=ItemVector(), const ItemVector &appendedItems=ItemVector(), const ItemVector &deletedItems=ItemVector())
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.
friend size_t hash_value(const SdfListOp &op)