aboutsummaryrefslogtreecommitdiff
path: root/SrcShared/Patches/EmPatchModuleMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'SrcShared/Patches/EmPatchModuleMap.h')
-rw-r--r--SrcShared/Patches/EmPatchModuleMap.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/SrcShared/Patches/EmPatchModuleMap.h b/SrcShared/Patches/EmPatchModuleMap.h
new file mode 100644
index 0000000..0e242a9
--- /dev/null
+++ b/SrcShared/Patches/EmPatchModuleMap.h
@@ -0,0 +1,100 @@
+/* -*- mode: C++; tab-width: 4 -*- */
+/* ===================================================================== *\
+ Copyright (c) 1998-2001 Palm, Inc. or its subsidiaries.
+ Copyright (c) 2001 PocketPyro, Inc.
+ All rights reserved.
+
+ This file is part of the Palm OS Emulator.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+\* ===================================================================== */
+
+#ifndef EmPatchModuleMap_h
+#define EmPatchModuleMap_h
+
+#include "EmPatchIf.h" // IEmPatchModuleMap
+#include "EmPatchModule.h" // IEmPatchModule
+
+
+typedef map<string, IEmPatchModule*> SimplePatchModuleMap;
+
+
+// EmPatchModuleMap defines a mapped list of Patch Modules created
+
+class EmPatchModuleMap : public EcmObject,
+ ecm_implements IEmPatchModuleMap
+{
+ public:
+// ==============================================================================
+// * constructors
+// ==============================================================================
+ EmPatchModuleMap();
+ virtual ~EmPatchModuleMap() {}
+
+
+// ==============================================================================
+// * Helper functions
+// ==============================================================================
+ enum EPmOperation
+ {
+ EPMOpInitializeAll,
+ EPMOpResetAll,
+ EPMOpDisposeAll,
+ EPMOpClearAll,
+ EPMOpLoadAll
+ };
+
+ Err DoAll(EPmOperation todo, IEmPatchContainer *IP = NULL);
+
+
+// ==============================================================================
+// * interface implementations
+// ==============================================================================
+// ==============================================================================
+// * BEGIN IEmPatchModuleMap
+// ==============================================================================
+ Err InitializeAll(IEmPatchContainer &containerI)
+ {
+ return DoAll(EPMOpInitializeAll, &containerI);
+ }
+
+ Err ResetAll()
+ {
+ return DoAll(EPMOpResetAll);
+ }
+
+ Err DisposeAll()
+ {
+ return DoAll(EPMOpDisposeAll);
+ }
+
+ Err ClearAll()
+ {
+ return DoAll(EPMOpClearAll);
+ }
+
+ Err LoadAll()
+ {
+ return DoAll(EPMOpLoadAll);
+ }
+
+ Err AddModule (IEmPatchModule *moduleIP);
+
+ Err GetModuleByName (const string &nameStr, IEmPatchModule *& moduleIP);
+
+// ==============================================================================
+// * BEGIN IEmPatchModuleMap
+// ==============================================================================
+
+ private:
+ SimplePatchModuleMap fModMap;
+};
+
+
+Err AddStaticPatchModules();
+
+
+#endif // EmPatchModuleMap_h