You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Clean up documentation
Signed-off-by: ahcorde <ahcorde@gmail.com>
* Added extra space between brief and params
Signed-off-by: ahcorde <ahcorde@gmail.com>
* @brief This class allows loading and unloading of dynamically linked libraries which contain class definitions from which objects can be created/destroyed during runtime (i.e. class_loader). Libraries loaded by a ClassLoader are only accessible within scope of that ClassLoader object.
75
+
* @brief This class allows loading and unloading of dynamically linked libraries which contain class
76
+
* definitions from which objects can be created/destroyed during runtime (i.e. class_loader).
77
+
* Libraries loaded by a ClassLoader are only accessible within scope of that ClassLoader object.
81
78
*/
82
79
classClassLoader
83
80
{
@@ -89,21 +86,24 @@ class ClassLoader
89
86
using UniquePtr = std::unique_ptr<Base, DeleterType<Base>>;
90
87
91
88
/**
92
-
* @brief Constructor for ClassLoader
89
+
* @brief Constructor for ClassLoader
90
+
*
93
91
* @param library_path - The path of the runtime library to load
94
-
* @param ondemand_load_unload - Indicates if on-demand (lazy) unloading/loading of libraries occurs as plugins are created/destroyed
92
+
* @param ondemand_load_unload - Indicates if on-demand (lazy) unloading/loading of libraries
* @brief Destructor for ClassLoader. All libraries opened by this ClassLoader are unloaded automatically.
99
+
* @brief Destructor for ClassLoader. All libraries opened by this ClassLoader are unloaded automatically.
101
100
*/
102
101
CLASS_LOADER_PUBLIC
103
102
virtual~ClassLoader();
104
103
105
104
/**
106
-
* @brief Indicates which classes (i.e. class_loader) that can be loaded by this object
105
+
* @brief Indicates which classes (i.e. class_loader) that can be loaded by this object
106
+
*
107
107
* @return vector of strings indicating names of instantiable classes derived from <Base>
108
108
*/
109
109
template<classBase>
@@ -113,12 +113,12 @@ class ClassLoader
113
113
}
114
114
115
115
/**
116
-
* @brief Generates an instance of loadable classes (i.e. class_loader).
116
+
* @brief Generates an instance of loadable classes (i.e. class_loader).
117
117
*
118
118
* It is not necessary for the user to call loadLibrary() as it will be invoked automatically
119
119
* if the library is not yet loaded (which typically happens when in "On Demand Load/Unload" mode).
120
120
*
121
-
* @param derived_class_name The name of the class we want to create (@see getAvailableClasses())
121
+
* @param derived_class_name The name of the class we want to create (@see getAvailableClasses())
122
122
* @return A std::shared_ptr<Base> to newly created plugin object
123
123
*/
124
124
template<classBase>
@@ -174,6 +174,7 @@ class ClassLoader
174
174
175
175
/**
176
176
* @brief Indicates if a plugin class is available
177
+
*
177
178
* @param Base - polymorphic type indicating base class
178
179
* @param class_name - the name of the plugin class
179
180
* @return true if yes it is available, false otherwise
@@ -188,40 +189,64 @@ class ClassLoader
188
189
189
190
/**
190
191
* @brief Gets the full-qualified path and name of the library associated with this class loader
192
+
*
193
+
* @return the full-qualified path and name of the library
191
194
*/
192
195
CLASS_LOADER_PUBLIC
193
196
const std::string & getLibraryPath() const;
194
197
195
198
/**
196
-
* @brief Indicates if a library is loaded within the scope of this ClassLoader. Note that the library may already be loaded internally through another ClassLoader, but until loadLibrary() method is called, the ClassLoader cannot create objects from said library. If we want to see if the library has been opened by somebody else, @see isLibraryLoadedByAnyClassloader()
197
-
* @param library_path The path to the library to load
199
+
* @brief Indicates if a library is loaded within the scope of this ClassLoader.
200
+
*
201
+
* Note that the library may already be loaded internally through another ClassLoader,
202
+
* but until loadLibrary() method is called, the ClassLoader cannot create objects from said library.
203
+
* If we want to see if the library has been opened by somebody else, @see isLibraryLoadedByAnyClassloader()
204
+
*
205
+
* @param library_path The path to the library to load
198
206
* @return true if library is loaded within this ClassLoader object's scope, otherwise false
199
207
*/
200
208
CLASS_LOADER_PUBLIC
201
209
boolisLibraryLoaded() const;
202
210
203
211
/**
204
-
* @brief Indicates if a library is loaded by some entity in the plugin system (another ClassLoader), but not necessarily loaded by this ClassLoader
212
+
* @brief Indicates if a library is loaded by some entity in the plugin system (another ClassLoader),
213
+
* but not necessarily loaded by this ClassLoader.
214
+
*
205
215
* @return true if library is loaded within the scope of the plugin system, otherwise false
206
216
*/
207
217
CLASS_LOADER_PUBLIC
208
218
boolisLibraryLoadedByAnyClassloader() const;
209
219
210
220
/**
211
-
* @brief Indicates if the library is to be loaded/unloaded on demand...meaning that only to load a lib when the first plugin is created and automatically shut it down when last active plugin is destroyed.
221
+
* @brief Indicates if the library is to be loaded/unloaded on demand...meaning that only to load
222
+
* a lib when the first plugin is created and automatically shut it down when last active plugin
223
+
* is destroyed.
224
+
*
225
+
* @return true if ondemand load and unload is active, otherwise false
212
226
*/
213
227
CLASS_LOADER_PUBLIC
214
228
boolisOnDemandLoadUnloadEnabled() const;
215
229
216
230
/**
217
-
* @brief Attempts to load a library on behalf of the ClassLoader. If the library is already opened, this method has no effect. If the library has been already opened by some other entity (i.e. another ClassLoader or global interface), this object is given permissions to access any plugin classes loaded by that other entity. This is
218
-
* @param library_path The path to the library to load
231
+
* @brief Attempts to load a library on behalf of the ClassLoader. If the library is already
232
+
* opened, this method has no effect. If the library has been already opened by some other entity
233
+
* (i.e. another ClassLoader or global interface), this object is given permissions to access any
234
+
* plugin classes loaded by that other entity.
219
235
*/
220
236
CLASS_LOADER_PUBLIC
221
237
voidloadLibrary();
222
238
223
239
/**
224
-
* @brief Attempts to unload a library loaded within scope of the ClassLoader. If the library is not opened, this method has no effect. If the library is opened by other another ClassLoader, the library will NOT be unloaded internally -- however this ClassLoader will no longer be able to instantiate class_loader bound to that library. If there are plugin objects that exist in memory created by this classloader, a warning message will appear and the library will not be unloaded. If loadLibrary() was called multiple times (e.g. in the case of multiple threads or purposefully in a single thread), the user is responsible for calling unloadLibrary() the same number of times. The library will not be unloaded within the context of this classloader until the number of unload calls matches the number of loads.
240
+
* @brief Attempts to unload a library loaded within scope of the ClassLoader. If the library is
241
+
* not opened, this method has no effect. If the library is opened by other another ClassLoader,
242
+
* the library will NOT be unloaded internally -- however this ClassLoader will no longer be able
243
+
* to instantiate class_loader bound to that library. If there are plugin objects that exist in
244
+
* memory created by this classloader, a warning message will appear and the library will not be
245
+
* unloaded. If loadLibrary() was called multiple times (e.g. in the case of multiple threads or
246
+
* purposefully in a single thread), the user is responsible for calling unloadLibrary() the same
247
+
* number of times. The library will not be unloaded within the context of this classloader until
248
+
* the number of unload calls matches the number of loads.
249
+
*
225
250
* @return The number of times more unloadLibrary() has to be called for it to be unbound from this ClassLoader
226
251
*/
227
252
CLASS_LOADER_PUBLIC
@@ -230,6 +255,7 @@ class ClassLoader
230
255
private:
231
256
/**
232
257
* @brief Callback method when a plugin created by this class loader is destroyed
* @brief As the library may be unloaded in "on-demand load/unload" mode, unload maybe called from createInstance(). The problem is that createInstance() locks the plugin_ref_count as does unloadLibrary(). This method is the implementation of unloadLibrary but with a parameter to decide if plugin_ref_mutex_ should be locked
348
+
* @brief As the library may be unloaded in "on-demand load/unload" mode, unload maybe called from
349
+
* createInstance(). The problem is that createInstance() locks the plugin_ref_count as does
350
+
* unloadLibrary(). This method is the implementation of unloadLibrary but with a parameter to
351
+
* decide if plugin_ref_mutex_ should be locked.
352
+
*
323
353
* @param lock_plugin_ref_count - Set to true if plugin_ref_count_mutex_ should be locked, else false
324
-
* @return The number of times unloadLibraryInternal has to be called again for it to be unbound from this ClassLoader
354
+
* @return The number of times unloadLibraryInternal has to be called again for it to be unbound
0 commit comments