13 #ifndef _FBXSDK_CORE_BASE_SET_H_ 14 #define _FBXSDK_CORE_BASE_SET_H_ 25 template <
typename Type,
typename Compare=FbxLessCompare<Type>,
typename Allocator=FbxBaseAllocator>
class FbxSet 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 typedef const Type KeyType;
37 typedef const Type ConstKeyType;
39 typedef const Type ConstValueType;
41 inline Value(
const Type& pValue) : mValue(pValue){}
42 inline KeyType& GetKey()
const {
return mValue; }
43 inline ConstKeyType& GetKey(){
return mValue; }
44 inline ValueType& GetValue()
const {
return mValue; }
45 inline ConstValueType& GetValue(){
return mValue; }
56 typedef FbxRedBlackTree<Value, Compare, Allocator>
StorageType;
61 typedef typename StorageType::IteratorType
Iterator;
67 inline void Reserve(
unsigned int pRecordCount)
69 mTree.Reserve(pRecordCount);
75 return mTree.GetSize();
83 return mTree.Insert(
Value(pValue));
91 return mTree.Remove(pValue);
103 return mTree.Empty();
135 return mTree.Find(pValue);
143 return mTree.Find(pValue);
149 return mTree.Minimum();
155 return mTree.Minimum();
161 return mTree.Maximum();
167 return mTree.Maximum();
173 return (
this == &pOther) || (mTree == pOther.mTree);
179 return !(*
this == pOther);
189 for (; lBegin !=
End(); ++lBegin)
191 if (pOther.
Find(lBegin->GetValue()) !=
NULL)
192 lReturn.
Insert(lBegin->GetValue());
204 for (; lBegin !=
End(); ++lBegin)
206 if (
Find(lBegin->GetValue()) ==
NULL)
207 lReturn.
Insert(lBegin->GetValue());
215 #ifndef DOXYGEN_SHOULD_SKIP_THIS RecordType * Minimum()
Retrieve the minimum value in the set.
FBX SDK environment definition.
Iterator Begin()
Retrieve the begin iterator of the set.
FbxPair< RecordType *, bool > Insert(const ValueType &pValue)
Insert a value.
This class defines the value type used by the set.
StorageType::RecordType RecordType
RecordType * Find(const ValueType &pValue)
Find a given value in the set.
FbxRedBlackTree< Value, Compare, Allocator > StorageType
Declaration of the storage type used by the set.
ConstIterator Begin() const
Retrieve the begin iterator of the set.
StorageType::IteratorType Iterator
const RecordType * Find(const ValueType &pValue) const
Find a given value in the set.
const RecordType * Maximum() const
Retrieve the maximum value in the set.
ConstIterator End() const
Retrieve the end iterator of the set.
void Clear()
Clear the set.
bool operator==(const FbxSet< Type, Compare, Allocator > &pOther) const
Equality operator.
void Reserve(unsigned int pRecordCount)
Preallocate memory.
int Remove(const ValueType &pValue)
Delete a value.
bool operator!=(const FbxSet< Type, Compare, Allocator > &pOther) const
Inequality operator.
This class template holds a pair of objects.
This class implements an efficient set based on value comparison, which stores values.
RecordType * Maximum()
Retrieve the maximum value in the set.
StorageType::ConstIteratorType ConstIterator
int GetSize() const
Retrieve the number of values it holds.
FbxSet Union(const FbxSet &pOther) const
Unite with another set.
bool Empty() const
Query whether the set is empty.
FbxSet Intersect(const FbxSet &pOther) const
Intersect with another set.
const RecordType * Minimum() const
Retrieve the minimum value in the set.
Iterator End()
Retrieve the end iterator of the set.