SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
#include "smtk/CoreExports.h"
#include "smtk/SharedFromThis.h"
#include "smtk/common/CompilerInformation.h"
#include <functional>
Go to the source code of this file.
Classes | |
class | smtk::common::Extension |
Allow extension of operator functionality in separate libraries. More... | |
Namespaces | |
smtk | |
The main namespace for the Simulation Modeling Tool Kit (SMTK). | |
smtk::common | |
Classes used throughout the toolkit. | |
Macros | |
#define | smtkDeclareExtension(exportmacro, name, cls) |
Provide a way to force registration of operator extensions at load time. More... | |
#define smtkDeclareExtension | ( | exportmacro, | |
name, | |||
cls | |||
) |
Provide a way to force registration of operator extensions at load time.
Invoke this macro in the implementation file of your Extension subclass. Then, including "smtk/AutoInit.h" and invoking smtkAutoInit() in an object file that is directly compiled into an executable target will force registration of the extension even when dynamically linked to the extension with a lazy link-loader.
The macro takes 3 arguments:
As an example, consider a subclass named AuxGeomFileTestExtension. Inside the AuxGeomFileTestExtension.cxx
file, we place:
smtkDeclareExtension( SMTKVTKEXTENSIONS_EXPORT, aux_geom_file_test, AuxGeomFileTestExtension);
Then, inside an executable, we can place:
#include "smtk/AutoInit.h" smtkAutoInit(aux_geom_file_test_extension);
and be guaranteed that the extension will be registered. Note that when you call the smtkAutoInit()
macro, you should add _extension
to the name you passed to smtkDeclareExtension()
.