This commit is contained in:
Areloch 2017-11-05 22:33:32 -06:00
parent f51ce3084f
commit d666322a1b
23 changed files with 9203 additions and 7477 deletions

View file

@ -32,6 +32,9 @@
class ConsoleBaseType;
class SimObject;
#include <array>
#include <vector>
#include "core/stringTable.h"
#include "core/stream/stream.h"
@ -47,27 +50,26 @@ class SimFieldDictionary
public:
struct Entry
{
Entry() : type( NULL ) {};
Entry() : type(NULL) {};
StringTableEntry slotName;
char *value;
Entry *next;
ConsoleBaseType *type;
};
enum
{
HashTableSize = 19
};
Entry *mHashTable[HashTableSize];
//Entry *mHashTable[HashTableSize];
std::vector<Entry> mHashTable[HashTableSize];
private:
static Entry *smFreeList;
void freeEntry(Entry *entry);
Entry* addEntry( U32 bucket, StringTableEntry slotName, ConsoleBaseType* type, char* value = 0 );
Entry* addEntry(U32 bucket, StringTableEntry slotName, ConsoleBaseType* type, char* value = 0);
static U32 getHashValue( StringTableEntry slotName );
static U32 getHashValue( const String& fieldName );
static U32 getHashValue(StringTableEntry slotName);
static U32 getHashValue(const String& fieldName);
U32 mNumFields;
@ -88,7 +90,7 @@ public:
const char *getFieldValue(StringTableEntry slotName);
U32 getFieldType(StringTableEntry slotName) const;
Entry *findDynamicField(const String &fieldName) const;
Entry *findDynamicField( StringTableEntry fieldName) const;
Entry *findDynamicField(StringTableEntry fieldName) const;
void writeFields(SimObject *obj, Stream &strem, U32 tabStop);
void printFields(SimObject *obj);
void assignFrom(SimFieldDictionary *dict);
@ -103,6 +105,7 @@ class SimFieldDictionaryIterator
{
SimFieldDictionary * mDictionary;
S32 mHashIndex;
S32 mVecIndex;
SimFieldDictionary::Entry * mEntry;
public: