fbxsdk/core/base/fbxmultimap.h Source File

fbxmultimap.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_BASE_MULTIMAP_H_
14 #define _FBXSDK_CORE_BASE_MULTIMAP_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
18 #include <fbxsdk/fbxsdk_nsbegin.h>
19 
23 {
24 public:
25  struct Pair
26  {
27  FbxHandle mKey;
28  FbxHandle mItem;
29  };
30 
37  bool Add(FbxHandle pKey, FbxHandle pItem);
38 
43  bool Remove(FbxHandle pKey);
44 
49  bool RemoveItem(FbxHandle pItem);
50 
56  bool SetItem(FbxHandle pKey, FbxHandle pItem);
57 
64  FbxHandle Get(FbxHandle pKey, int* pIndex=NULL);
65 
67  void Clear();
68 
74  FbxHandle GetFromIndex(int pIndex, FbxHandle* pKey=NULL);
75 
80  bool RemoveFromIndex(int pIndex);
81 
84  int GetCount() const { return mSetCount; }
85 
87  void Swap();
88 
90  void Sort();
91 
92 /*****************************************************************************************************************************
93 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
94 *****************************************************************************************************************************/
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96  FbxMultiMap(int pItemPerBlock=20);
97  FbxMultiMap(const FbxMultiMap& pOther);
98  ~FbxMultiMap();
99 
100  FbxMultiMap& operator=(const FbxMultiMap&);
101 
102 private:
103  Pair* FindEqual(FbxHandle pKey) const;
104 
105  Pair* mSetArray;
106  int mSetCount;
107  int mBlockCount;
108  int mItemPerBlock;
109  bool mIsChanged;
110 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
111 };
112 
113 #include <fbxsdk/fbxsdk_nsend.h>
114 
115 #endif /* _FBXSDK_CORE_BASE_MULTIMAP_H_ */
FBX SDK environment definition.
#define NULL
Definition: fbxarch.h:210
int GetCount() const
Get number of items in the array.
Definition: fbxmultimap.h:84
FbxHandle mKey
Definition: fbxmultimap.h:27
#define FBXSDK_DLL
Definition: fbxarch.h:173
FbxHandle mItem
Definition: fbxmultimap.h:28
Class to manipulate a map that can contain multiple times the same key.
Definition: fbxmultimap.h:22