Skip to content

Commit

Permalink
Add IntMap methodmap (#2018)
Browse files Browse the repository at this point in the history
* Add new IntHashMap and IntMap natives

This is a continuation of #579.

[HashMap] Adds new IntHashMap and IntMap natives.

This patch makes the following changes
  * Refactors StringHashMap to a generic HashMap template
  * Adds the IntHashMap class
  * Adds new IntMap natives
  * Adds IntMap tests to the tries test suite

[HashMap] Reverted rename of CharsAndLength

[HashMap] Use more descriptive template names

[HashMap] Removed old-style natives

[HashMap] Removed IntHash class

[HashMap] Reverted some search & replace errors

Co-authored-by: Geoffrey McRae <geoff@hostfission.com>

* Fix spelling mistake + include

* Fix tries test

* Update tests with clone + ContainsKey

---------

Co-authored-by: Geoffrey McRae <geoff@hostfission.com>
Co-authored-by: Nicholas Hastings <nshastings@gmail.com>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 6c3486d commit 34e9605
Show file tree
Hide file tree
Showing 20 changed files with 880 additions and 42 deletions.
2 changes: 1 addition & 1 deletion core/ConCmdManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <am-inlinelist.h>
#include <am-refcounting.h>
#include <am-utility.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>

#include "sm_globals.h"
#include "sourcemm_api.h"
Expand Down
2 changes: 1 addition & 1 deletion core/ConVarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <compat_wrappers.h>
#include "concmd_cleaner.h"
#include "PlayerManager.h"
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>

using namespace SourceHook;

Expand Down
2 changes: 1 addition & 1 deletion core/ConsoleDetours.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "sm_globals.h"
#include "sourcemm_api.h"
#include <IForwardSys.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>

namespace SourceMod {
class ICommandArgs;
Expand Down
2 changes: 1 addition & 1 deletion core/CoreConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <ITextParsers.h>
#include <IRootConsoleMenu.h>
#include <am-string.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>

using namespace SourceMod;

Expand Down
2 changes: 1 addition & 1 deletion core/HalfLife2.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <am-utility.h>
#include <am-hashset.h>
#include <am-hashmap.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sm_namehashset.h>
#include "sm_globals.h"
#include "sm_queue.h"
Expand Down
2 changes: 1 addition & 1 deletion core/UserMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <IUserMessages.h>
#include "sourcemm_api.h"
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include "sm_stringutil.h"
#include "CellRecipientFilter.h"
#include "sm_globals.h"
Expand Down
2 changes: 1 addition & 1 deletion core/logic/ADTFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include <IADTFactory.h>
#include "common_logic.h"
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>

using namespace SourceMod;

Expand Down
2 changes: 1 addition & 1 deletion core/logic/AdminCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <sh_list.h>
#include <sh_string.h>
#include <IForwardSys.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sm_namehashset.h>

using namespace SourceHook;
Expand Down
2 changes: 1 addition & 1 deletion core/logic/GameConfigs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <IGameConfigs.h>
#include <ITextParsers.h>
#include <am-refcounting.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sm_namehashset.h>
#include <unordered_set>

Expand Down
2 changes: 1 addition & 1 deletion core/logic/Native.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <am-string.h>
#include <am-utility.h>
#include <am-refcounting.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include "common_logic.h"

class CNativeOwner;
Expand Down
2 changes: 1 addition & 1 deletion core/logic/PluginSys.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <sh_string.h>
#include "common_logic.h"
#include <IRootConsoleMenu.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sm_namehashset.h>
#include "ITranslator.h"
#include "IGameConfigs.h"
Expand Down
2 changes: 1 addition & 1 deletion core/logic/ShareSys.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <am-utility.h>
#include <am-refcounting.h>
#include <sh_list.h>
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sm_namehashset.h>
#include "common_logic.h"
#include "Native.h"
Expand Down
2 changes: 1 addition & 1 deletion core/logic/Translator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define _INCLUDE_SOURCEMOD_TRANSLATOR_H_

#include "common_logic.h"
#include <sm_stringhashmap.h>
#include <sm_hashmap.h>
#include <sh_string.h>
#include <sh_vector.h>
#include "sm_memtable.h"
Expand Down
Loading

0 comments on commit 34e9605

Please sign in to comment.