CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DynamicLinker.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25
26
27// DynamicLinker.h: interface for the OdaDynamicLinkerI class.
28//
30
31#if !defined(_ODADYNAMICLINKERI_H_INCLUDED_)
32#define _ODADYNAMICLINKERI_H_INCLUDED_
33
34class OdRxDictionary;
36
37#include "RxDictionary.h"
38#include "RxModule.h"
39
40class OdRxModule;
45
51
52#include "TD_PackPush.h"
53
72{
73public:
75
80 virtual void addReactor (
81 OdRxDLinkerReactor* pReactor) = 0;
86 virtual void removeReactor (
87 OdRxDLinkerReactor* pReactor) = 0;
88
99 const OdString& moduleFileName, bool silent = true) = 0;
100
106 virtual bool unloadModule(
107 const OdString& moduleFileName) = 0;
108
109
113 virtual bool unloadUnreferenced() = 0;
114
123 const OdString& applicationName,
124 bool silent = true) = 0;
125
133
137 virtual OdRxDictionaryPtr sysRegistry() const = 0;
138
144 OdRxModule* pModuleObj, bool bSilent = true) = 0;
145
149 virtual int getModuleCount() const = 0;
150
155 int index,
156 OdString& key) const = 0;
157
162 const OdString& key) const = 0;
163};
164
169
170
175
183template <class TClass>
186 OdRxClass* pClass = (OdRxClass*)clsdict->getAt(sClassName).get();
187 if(pClass)
188 return (TClass*)pClass->create().get();
189 if(!sAppName.isEmpty()) {
190 odrxDynamicLinker()->loadApp(sAppName, false);
191 pClass = (OdRxClass*)clsdict->getAt(sClassName).get();
192 if(pClass)
193 return (TClass*)pClass->create().get();
194 }
195 throw OdError( sClassName + OD_T( " class was not found" ) ); //FELIX_CHANGE
196}
197
198
199inline OdRxModulePtr odrxLoadApp(const OdString& applicationName) { return odrxDynamicLinker()->loadApp(applicationName); }
200
201inline OdRxModulePtr odrxSafeLoadApp(const OdString& applicationName) { return odrxDynamicLinker()->loadApp(applicationName, false); }
202
203#include "TD_PackPop.h"
204
205#endif // !defined(_ODADYNAMICLINKERI_H_INCLUDED_)
206
OdSmartPtr< OdRxDynamicLinker > OdRxDynamicLinkerPtr
OdSmartPtr< TClass > odrxSafeCreateObject(const OdString &sClassName, const OdString &sAppName=OdString::kEmpty)
OdSmartPtr< OdRxModule > OdRxModulePtr
Definition: DynamicLinker.h:44
OdRxModulePtr odrxSafeLoadApp(const OdString &applicationName)
OdSmartPtr< OdRxSystemServices > OdRxSystemServicesPtr
Definition: DynamicLinker.h:50
OdRxModulePtr odrxLoadApp(const OdString &applicationName)
FIRSTDLL_EXPORT OdRxDynamicLinker * odrxDynamicLinker()
#define OD_T(x)
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
FIRSTDLL_EXPORT OdRxDictionaryPtr odrxClassDictionary()
virtual OdRxObjectPtr create() const
virtual OdRxObjectPtr getAt(const OdString &key) const =0
virtual bool unloadUnreferenced()=0
virtual int getModuleCount() const =0
virtual OdRxModulePtr loadApp(const OdString &applicationName, bool silent=true)=0
virtual OdRxModule * loadModuleObj(OdRxModule *pModuleObj, bool bSilent=true)=0
virtual OdRxSystemServicesPtr sysServices() const =0
virtual OdRxModulePtr loadModule(const OdString &moduleFileName, bool silent=true)=0
virtual bool unloadModule(const OdString &moduleFileName)=0
virtual void addReactor(OdRxDLinkerReactor *pReactor)=0
ODRX_DECLARE_MEMBERS(OdRxDynamicLinker)
virtual void removeReactor(OdRxDLinkerReactor *pReactor)=0
virtual OdRxModulePtr getModule(const OdString &key) const =0
virtual OdRxDictionaryPtr sysRegistry() const =0
virtual OdRxModulePtr getModule(int index, OdString &key) const =0
OdRxObject * get()
Definition: RxObject.h:503
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
GLuint index
Definition: gles2_ext.h:265