From 89e42ed3613e5852834f929f9468f83333e08bab Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 29 Oct 2011 00:17:57 -0700 Subject: [PATCH] Move plCreatableUUID somewhere less annoying. --- Sources/Plasma/Apps/plFileEncrypt/main.cpp | 1 - Sources/Plasma/Apps/plFileSecure/main.cpp | 2 -- .../Apps/plPageInfo/plAllCreatables.cpp | 1 - Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp | 1 + .../NucleusLib/pnNetCommon/CMakeLists.txt | 1 + .../plCreatableUuid.h} | 23 ++++++++++++------- .../pnNetCommon/pnNetCommonCreatable.h | 3 +++ .../Plasma/NucleusLib/pnUUID/CMakeLists.txt | 3 +-- Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp | 22 ------------------ Sources/Plasma/NucleusLib/pnUUID/pnUUID.h | 15 ------------ 10 files changed, 21 insertions(+), 51 deletions(-) rename Sources/Plasma/NucleusLib/{pnUUID/pnUUIDCreatable.h => pnNetCommon/plCreatableUuid.h} (74%) diff --git a/Sources/Plasma/Apps/plFileEncrypt/main.cpp b/Sources/Plasma/Apps/plFileEncrypt/main.cpp index e96947ba..0b1f894b 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/main.cpp +++ b/Sources/Plasma/Apps/plFileEncrypt/main.cpp @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plFile/plEncryptedStream.h" #include "pnProduct/pnProduct.h" #include "hsUtils.h" -#include "pnUUID/pnUUIDCreatable.h" void EncryptFiles(const char* dir, const char* ext, bool encrypt); diff --git a/Sources/Plasma/Apps/plFileSecure/main.cpp b/Sources/Plasma/Apps/plFileSecure/main.cpp index a55b58ed..6503def1 100644 --- a/Sources/Plasma/Apps/plFileSecure/main.cpp +++ b/Sources/Plasma/Apps/plFileSecure/main.cpp @@ -45,8 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnProduct/pnProduct.h" #include "hsUtils.h" -#include "pnUUID/pnUUIDCreatable.h" - #include #include diff --git a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp index c814d1a0..ce7c10f5 100644 --- a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp +++ b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp @@ -61,7 +61,6 @@ REGISTER_NONCREATABLE( plDispatchBase ); #include "pnModifier/pnModifierCreatable.h" #include "pnNetCommon/pnNetCommonCreatable.h" #include "pnTimer/pnTimerCreatable.h" -#include "pnUUID/pnUUIDCreatable.h" #include "plResMgr/plResMgrCreatable.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index b5a57150..f7e935cd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -61,6 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnMessage/plCameraMsg.h" #include "pnTimer/plTimerCallbackManager.h" #include "plVault/plVault.h" +#include "pnNetCommon/plCreatableUuid.h" #include "plNetClient/plNetClientMgr.h" #include "plNetClient/plNetLinkingMgr.h" #include "plNetTransport/plNetTransport.h" diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index 6487445f..13974a33 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories("../../NucleusLib/inc") include_directories("../../PubUtilLib") set(pnNetCommon_HEADERS + plCreatableUuid.h plGenericVar.h plNetAddress.h plNetApp.h diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h b/Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h similarity index 74% rename from Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h rename to Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h index 0b327aea..4d76dd8c 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h @@ -39,16 +39,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#ifndef pnCreatableUUID_h_inc +#define pnCreatableUUID_h_inc -#ifndef pnUUIDCreatable_inc -#define pnUUIDCreatable_inc +#include "pnUUID/pnUUID.h" +#include "pnFactory/plCreatable.h" -#include "pnFactory/plCreator.h" +class plCreatableUuid : public plUUID, public plCreatable { +public: + CLASSNAME_REGISTER( plCreatableUuid ); + GETINTERFACE_ANY( plCreatableUuid, plCreatable ); + plCreatableUuid() { } + plCreatableUuid(const plCreatableUuid& other) : plUUID(other) { } + plCreatableUuid(const plUUID& other) : plUUID(other) { } -#include "pnUUID.h" - -REGISTER_CREATABLE( plCreatableUuid ); - -#endif // pnUUIDCreatable_inc + void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); } + void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); } +}; +#endif //pnCreatableUUID_h_inc diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h index 0f28f4ac..6b6b24b7 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h @@ -57,6 +57,9 @@ REGISTER_CREATABLE( plCreatableGenericValue ); #include "pnNetCommon.h" REGISTER_CREATABLE( plCreatableStream ); +#include "plCreatableUuid.h" +REGISTER_CREATABLE( plCreatableUuid ); + #endif // pnNetCommonCreatable_inc diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt index bccb3d67..2d9cb98b 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -13,11 +13,10 @@ endif(WIN32) set(pnUUID_HEADERS pnUUID.h - pnUUIDCreatable.h ) add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) -target_link_libraries(pnUUID CoreLib pnFactory) +target_link_libraries(pnUUID CoreLib) if(WIN32) target_link_libraries(pnUUID pnUtils) target_link_libraries(pnUUID Rpcrt4) diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index cf4291c6..f6c6073e 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -73,25 +73,3 @@ const char * plUUID::AsString() const { ToStdString(str); return str.c_str(); } - -/***************************************************************************** -* -* plCreatableUuid -* -***/ - -//============================================================================ -plCreatableUuid::plCreatableUuid () { -} - -//============================================================================ -plCreatableUuid::plCreatableUuid (const plCreatableUuid & other) -: plUUID(other) -{ -} - -//============================================================================ -plCreatableUuid::plCreatableUuid (const plUUID & other) -: plUUID(other) -{ -} diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 24828014..7d1a21af 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifdef HS_BUILD_FOR_WIN32 #include "pnUtils/pnUtils.h" #endif -#include "pnFactory/plCreatable.h" class hsStream; @@ -93,18 +92,4 @@ public: static plUUID Generate(); }; -class plCreatableUuid : public plUUID, public plCreatable { -public: - CLASSNAME_REGISTER( plCreatableUuid ); - GETINTERFACE_ANY( plCreatableUuid, plCreatable ); - - plCreatableUuid (); - plCreatableUuid (const plCreatableUuid & other); - plCreatableUuid (const plUUID & other); - - void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); } - void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); } -}; - - #endif // pnUUID_h_inc