30 #include "../Parcel/ObjStream.h" 34 #if defined(_WIN32) && defined(HR_ENGINE_SHARED) 36 # define MR_DllDeclare __declspec( dllexport ) 38 # define MR_DllDeclare __declspec( dllimport ) 41 # define MR_DllDeclare 45 namespace ObjFacTools {
64 mDllId == pId.mDllId &&
65 mClassId == pId.mClassId;
71 namespace DllObjectFactory {
121 typename std::enable_if<
122 std::is_base_of<ObjectFromFactory, T>::value,
123 std::shared_ptr<T>>::type &obj)
133 obj->Serialize(archive);
143 auto dynObj = std::dynamic_pointer_cast<T>(
150 ThrowUnexpected(oid);
152 obj = std::move(dynObj);
153 obj->Serialize(archive);
Unique identifier for a Factory Object.
Definition: DllObjectFactory.h:54
virtual ~ObjectFromFactory()
Definition: DllObjectFactory.h:93
constexpr bool operator==(const ObjectFromFactoryId &pId) const noexcept
Definition: DllObjectFactory.h:61
ObjectFromFactoryId mId
Definition: DllObjectFactory.h:89
uint16_t MR_UInt16
Definition: MR_Types.h:42
MR_UInt16 mDllId
Definition: DllObjectFactory.h:56
MR_DllDeclare void Clean() noexcept
Must be called at the end of the program.
Definition: DllObjectFactory.cpp:63
bool IsWriting() const
Definition: ObjStream.h:71
MR_DllDeclare std::shared_ptr< ObjectFromFactory > CreateObject(const ObjectFromFactoryId &pId)
Fast Object Creation function.
Definition: DllObjectFactory.cpp:68
const ObjectFromFactoryId & GetTypeId() const noexcept
Definition: DllObjectFactory.h:95
MR_DllDeclare void Init() noexcept
Must be called at the beginning of the program.
Definition: DllObjectFactory.cpp:58
Base class for parcel serializers.
Definition: ObjStream.h:58
MR_UInt16 mClassId
Definition: DllObjectFactory.h:57
void Serialize(Parcel::ObjStream &pArchive)
Definition: DllObjectFactory.cpp:83
static void SerializeShared(Parcel::ObjStream &archive, typename std::enable_if< std::is_base_of< ObjectFromFactory, T >::value, std::shared_ptr< T >>::type &obj)
Serialize a shared pointer to a serializable object.
Definition: DllObjectFactory.h:120
#define MR_DllDeclare
Definition: DllObjectFactory.h:41
Base class for object created with a Dll Factory.
Definition: DllObjectFactory.h:86
ObjectFromFactory(const ObjectFromFactoryId &pId) noexcept
Definition: DllObjectFactory.h:92
Definition: Announcement.h:24