FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxSimpleMap< Key, Type, Compare > Class Template Reference

#include <fbxmap.h>

Class Description

template<class Key, class Type, class Compare>
class FbxSimpleMap< Key, Type, Compare >

A simple map class representing a dictionary-like data structure.

Definition at line 255 of file fbxmap.h.

Public Types

typedef FbxMap< Key, Type, Compare >::RecordType * Iterator
 

Public Member Functions

void Add (const Key &pKey, const Type &pValue)
 Add a key-value pair as an element. More...
 
Iterator Find (const Key &pKey) const
 Find an element with a given key. More...
 
Iterator Find (const Type &pValue) const
 Find an element with a given value. More...
 
void Remove (Iterator pIterator)
 Remove an element from the map. More...
 
Iterator GetFirst () const
 Get the first element. More...
 
Iterator GetNext (Iterator pIterator) const
 Get the next element of a given element. More...
 
void Clear ()
 Remove all of the elements. More...
 
void Reserve (int pSize)
 Reserve the space for given number elements. More...
 
int GetCount () const
 Query the count of elements in the map. More...
 

Member Typedef Documentation

◆ Iterator

typedef FbxMap<Key, Type, Compare>::RecordType* Iterator

Definition at line 258 of file fbxmap.h.

Member Function Documentation

◆ Add()

void Add ( const Key &  pKey,
const Type &  pValue 
)
inline

Add a key-value pair as an element.

Parameters
pKeyThe new key.
pValueThe new value.

Definition at line 263 of file fbxmap.h.

264  {
265  mMap.Insert(pKey, pValue);
266  }

◆ Find() [1/2]

Iterator Find ( const Key &  pKey) const
inline

Find an element with a given key.

Parameters
pKeyThe given key.
Returns
The iterator pointing to the found element or NULL if fails.

Definition at line 271 of file fbxmap.h.

272  {
273  return (Iterator)mMap.Find(pKey);
274  }
FbxMap< Key, Type, Compare >::RecordType * Iterator
Definition: fbxmap.h:258

◆ Find() [2/2]

Iterator Find ( const Type &  pValue) const
inline

Find an element with a given value.

Parameters
pValueThe given value.
Returns
The iterator pointing to the found element or NULL if fails.

Definition at line 279 of file fbxmap.h.

280  {
281  Iterator lIterator = GetFirst();
282  while( lIterator )
283  {
284  if( lIterator->GetValue() == pValue )
285  {
286  return lIterator;
287  }
288  lIterator = GetNext(lIterator);
289  }
290  return 0;
291  }
Iterator GetNext(Iterator pIterator) const
Get the next element of a given element.
Definition: fbxmap.h:310
FbxMap< Key, Type, Compare >::RecordType * Iterator
Definition: fbxmap.h:258
Iterator GetFirst() const
Get the first element.
Definition: fbxmap.h:302

◆ Remove()

void Remove ( Iterator  pIterator)
inline

Remove an element from the map.

Parameters
pIteratorThe given element.

Definition at line 295 of file fbxmap.h.

296  {
297  if( pIterator ) mMap.Remove(pIterator->GetKey());
298  }

◆ GetFirst()

Iterator GetFirst ( ) const
inline

Get the first element.

Returns
The the heading element.

Definition at line 302 of file fbxmap.h.

303  {
304  return (Iterator)mMap.Minimum();
305  }
FbxMap< Key, Type, Compare >::RecordType * Iterator
Definition: fbxmap.h:258

◆ GetNext()

Iterator GetNext ( Iterator  pIterator) const
inline

Get the next element of a given element.

Parameters
pIteratorThe given element.
Returns
The next element.

Definition at line 310 of file fbxmap.h.

311  {
312  return (Iterator)pIterator ? pIterator->Successor() : 0;
313  }
FbxMap< Key, Type, Compare >::RecordType * Iterator
Definition: fbxmap.h:258

◆ Clear()

void Clear ( )
inline

Remove all of the elements.

Definition at line 316 of file fbxmap.h.

317  {
318  mMap.Clear();
319  }

◆ Reserve()

void Reserve ( int  pSize)
inline

Reserve the space for given number elements.

Parameters
pSizeThe given number.

Definition at line 323 of file fbxmap.h.

324  {
325  mMap.Reserve(pSize);
326  }

◆ GetCount()

int GetCount ( ) const
inline

Query the count of elements in the map.

Returns
The count of elements.

Definition at line 330 of file fbxmap.h.

331  {
332  return mMap.GetSize();
333  }

The documentation for this class was generated from the following file: