CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
DynamicLinker.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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#include "LoadReasons.h"
40
41class OdRxModule;
46
52
53#include "TD_PackPush.h"
54
72class FIRSTDLL_EXPORT OdRxDynamicLinker : public OdRxObject
73{
74public:
76
81 virtual void addReactor (
82 OdRxDLinkerReactor* pReactor) = 0;
87 virtual void removeReactor (
88 OdRxDLinkerReactor* pReactor) = 0;
89
100 const OdString& moduleFileName, bool silent = true) = 0;
101
107 virtual bool unloadModule(
108 const OdString& moduleFileName) = 0;
109
110
114 virtual bool unloadUnreferenced() = 0;
115
124 const OdString& applicationName,
125 bool silent = true) = 0;
127 const OdString& applicationName,
128 OdaApp::LoadReasons loadReason,
129 bool silent = true) = 0;
130
138
142 virtual OdRxDictionaryPtr sysRegistry() const = 0;
143
149 OdRxModule* pModuleObj, bool bSilent = true) = 0;
150
154 virtual int getModuleCount() const = 0;
155
160 int index,
161 OdString& key) const = 0;
162
167 const OdString& key) const = 0;
168};
169
174
175
180
188template <class TClass>
191 OdRxClass* pClass = (OdRxClass*)clsdict->getAt(sClassName).get();
192 if(pClass)
193 return (TClass*)pClass->create().get();
194 if(!sAppName.isEmpty()) {
195 odrxDynamicLinker()->loadApp(sAppName, false);
196 pClass = (OdRxClass*)clsdict->getAt(sClassName).get();
197 if(pClass)
198 return (TClass*)pClass->create().get();
199 }
200 throw OdError( sClassName + OD_T( " class was not found" ) ); //FELIX_CHANGE
201}
202
203
204inline OdRxModulePtr odrxLoadApp(const OdString& applicationName) { return odrxDynamicLinker()->loadApp(applicationName); }
205
206inline OdRxModulePtr odrxSafeLoadApp(const OdString& applicationName) { return odrxDynamicLinker()->loadApp(applicationName, false); }
207
208#include "TD_PackPop.h"
209
210#endif // !defined(_ODADYNAMICLINKERI_H_INCLUDED_)
211
OdSmartPtr< OdRxDynamicLinker > OdRxDynamicLinkerPtr
OdSmartPtr< TClass > odrxSafeCreateObject(const OdString &sClassName, const OdString &sAppName=OdString::kEmpty)
OdSmartPtr< OdRxModule > OdRxModulePtr
OdRxModulePtr odrxSafeLoadApp(const OdString &applicationName)
OdSmartPtr< OdRxSystemServices > OdRxSystemServicesPtr
OdRxModulePtr odrxLoadApp(const OdString &applicationName)
FIRSTDLL_EXPORT OdRxDynamicLinker * odrxDynamicLinker()
OdSmartPtr< OdRxDictionary > OdRxDictionaryPtr
Definition Gs.h:93
#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 loadApp(const OdString &applicationName, OdaApp::LoadReasons loadReason, bool silent=true)=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:100
GLuint index
Definition gles2_ext.h:265