Beta matching MxAtom classes (#847)

* Beta matching MxAtom classes

* Remove unused getter

* Restore operator!= for modern compilers
This commit is contained in:
MS
2024-04-25 11:43:42 -04:00
committed by GitHub
parent 31f5143741
commit 612eec6889
6 changed files with 180 additions and 69 deletions

View File

@@ -15,10 +15,11 @@
// for the combined key_value_pair, which doesn't seem possible with <map>.
// SIZE 0x14
class MxAtomIdCounter {
class MxAtom {
public:
// always inlined
MxAtomIdCounter(const char* p_str)
// FUNCTION: BETA10 0x10123720
MxAtom(const char* p_str)
{
m_key = p_str;
m_value = 0;
@@ -26,23 +27,28 @@ public:
void Inc();
void Dec();
inline MxString* GetKey() { return &m_key; }
inline MxU16 GetValue() { return m_value; }
// FUNCTION: BETA10 0x101236d0
inline MxString& GetKey() { return m_key; }
// SYNTHETIC: BETA10 0x10124a50
// MxAtom::`scalar deleting destructor'
private:
MxString m_key;
MxU16 m_value;
};
struct MxAtomIdCounterCompare {
struct MxAtomCompare {
// FUNCTION: LEGO1 0x100ad120
int operator()(MxAtomIdCounter* const& p_val0, MxAtomIdCounter* const& p_val1) const
// FUNCTION: BETA10 0x10123980
int operator()(MxAtom* const& p_val0, MxAtom* const& p_val1) const
{
return strcmp(p_val0->GetKey()->GetData(), p_val1->GetKey()->GetData()) > 0;
return strcmp(p_val0->GetKey().GetData(), p_val1->GetKey().GetData()) > 0;
}
};
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare> {};
class MxAtomSet : public set<MxAtom*, MxAtomCompare> {};
enum LookupMode {
e_exact = 0,
@@ -55,74 +61,160 @@ enum LookupMode {
class MxAtomId {
public:
MxAtomId(const char*, LookupMode);
MxAtomId& operator=(const MxAtomId& p_atomId);
~MxAtomId();
MxAtomId() { this->m_internal = 0; }
MxAtomId& operator=(const MxAtomId& p_atomId);
// FUNCTION: BETA10 0x100178d0
inline MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; }
#ifdef COMPAT_MODE
// Required for modern compilers.
// MSVC 4.20 uses a synthetic function from INCLUDE/UTILITY that inverts operator==
inline MxBool operator!=(const MxAtomId& p_atomId) const { return this->m_internal != p_atomId.m_internal; }
#endif
// FUNCTION: BETA10 0x10025d40
MxAtomId() { this->m_internal = 0; }
void Clear();
// FUNCTION: BETA10 0x100735e0
const char* GetInternal() const { return m_internal; }
private:
MxAtomIdCounter* GetCounter(const char*, LookupMode);
// FUNCTION: BETA10 0x101236f0
MxAtomId& operator=(const MxString& p_key)
{
m_internal = p_key.GetData();
return *this;
}
MxAtom* GetAtom(const char*, LookupMode);
void Destroy();
const char* m_internal; // 0x00
};
// SYNTHETIC: BETA10 0x1002b520
// ??9@YAHABVMxAtomId@@0@Z
// aka MxAtomId::operator!=
// SYNTHETIC: LEGO1 0x100ad170
// MxAtomIdCounter::~MxAtomIdCounter
// MxAtom::~MxAtom
// clang-format off
// TEMPLATE: LEGO1 0x100ad480
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::iterator::_Dec
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::iterator::_Dec
// clang-format on
// clang-format off
// TEMPLATE: LEGO1 0x100ad780
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Lbound
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Lbound
// clang-format on
// clang-format off
// TEMPLATE: LEGO1 0x100ad4d0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Insert
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Insert
// clang-format on
// TEMPLATE: BETA10 0x101237a0
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::const_iterator::operator*
// clang-format off
// TEMPLATE: LEGO1 0x100af6d0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::~_Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCou
// TEMPLATE: BETA10 0x10131170
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::~_Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >
// clang-format on
// clang-format off
// TEMPLATE: LEGO1 0x100af7a0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::iterator::_Inc
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::iterator::_Inc
// clang-format on
// clang-format off
// TEMPLATE: LEGO1 0x100af7e0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::erase
// TEMPLATE: BETA10 0x10131210
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::erase
// clang-format on
// TEMPLATE: BETA10 0x10131460
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::size
// clang-format off
// TEMPLATE: LEGO1 0x100afc40
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Erase
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Erase
// clang-format on
// clang-format off
// TEMPLATE: LEGO1 0x100afc80
// set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::~set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >
// TEMPLATE: BETA10 0x10132080
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::~set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >
// clang-format on
// TEMPLATE: LEGO1 0x100afe40
// Set<MxAtomIdCounter *,MxAtomIdCounterCompare>::~Set<MxAtomIdCounter *,MxAtomIdCounterCompare>
// TEMPLATE: BETA10 0x101320e0
// Set<MxAtom *,MxAtomCompare>::~Set<MxAtom *,MxAtomCompare>
// TEMPLATE: BETA10 0x10132140
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::begin
// clang-format off
// GLOBAL: LEGO1 0x101013f0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Nil
// GLOBAL: BETA10 0x10201264
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Nil
// clang-format on
// TEMPLATE: BETA10 0x10132170
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::begin
// TEMPLATE: BETA10 0x101321d0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::size
// TEMPLATE: BETA10 0x101321f0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::erase
// TEMPLATE: BETA10 0x101237f0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::end
// TEMPLATE: BETA10 0x101238b0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::find
// clang-format off
// TEMPLATE: BETA10 0x101238e0
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::find
// clang-format on
// SYNTHETIC: BETA10 0x10123bf0
// MxAtom::~MxAtom
// TEMPLATE: BETA10 0x10123c50
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::insert
// SYNTHETIC: BETA10 0x10130fc0
// MxAtomSet::MxAtomSet
// TEMPLATE: BETA10 0x10131030
// Set<MxAtom *,MxAtomCompare>::Set<MxAtom *,MxAtomCompare>
// clang-format off
// TEMPLATE: BETA10 0x101310a0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >
// TEMPLATE: BETA10 0x10131120
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >
// TEMPLATE: BETA10 0x10131f30
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Init
// clang-format on
// SYNTHETIC: BETA10 0x101322a0
// MxAtomSet::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x101322e0
// MxAtomSet::~MxAtomSet
#endif // MXATOM_H

View File

@@ -3,7 +3,7 @@
#include "mxtypes.h"
class MxAtomIdCounterSet;
class MxAtomSet;
class MxDSAction;
class MxEventManager;
class MxMusicManager;
@@ -26,7 +26,7 @@ MxEventManager* EventManager();
MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager();
MxAtomIdCounterSet* AtomIdCounterSet();
MxAtomSet* AtomSet();
MxObjectFactory* ObjectFactory();
void DeleteObject(MxDSAction& p_dsAction);

View File

@@ -5,7 +5,7 @@
#include "mxcriticalsection.h"
#include "mxstring.h"
class MxAtomIdCounterSet;
class MxAtomSet;
class MxDSAction;
class MxEntity;
class MxEventManager;
@@ -69,7 +69,7 @@ public:
MxVariableTable* GetVariableTable() const { return this->m_variableTable; }
MxMusicManager* GetMusicManager() const { return this->m_musicManager; }
MxEventManager* GetEventManager() const { return this->m_eventManager; }
MxAtomIdCounterSet* GetAtomIdCounterSet() const { return this->m_atomIdCounterSet; }
MxAtomSet* GetAtomSet() const { return this->m_atomSet; }
MxLong HandleEndAction(MxParam& p_param);
// SYNTHETIC: LEGO1 0x100aefd0
@@ -90,7 +90,7 @@ protected:
MxEventManager* m_eventManager; // 0x38
MxTimer* m_timer; // 0x3c
MxStreamer* m_streamer; // 0x40
MxAtomIdCounterSet* m_atomIdCounterSet; // 0x44
MxAtomSet* m_atomSet; // 0x44
MxCriticalSection m_criticalSection; // 0x48
MxBool m_timerRunning; // 0x64
};