Base Module VST 3.7
SDK for developing VST plug-in
FDynLibrary Class Reference

Platform independent dynamic library loader. More...

#include <fdynlib.h>

+ Inheritance diagram for FDynLibrary:

Public Member Functions

 FDynLibrary (const char *name=nullptr, bool addExtension=true)
 Constructor. More...
 
 ~FDynLibrary () override
 Destructor. More...
 
bool init (const char *name, bool addExtension=true)
 Loads the library if not already loaded. More...
 
void * getProcAddress (const char *name)
 Returns the address of the procedure name. More...
 
bool isLoaded ()
 Returns true when the library was successfully loaded. More...
 
bool unload ()
 Unloads the library if it is loaded. More...
 
void * getPlatformInstance () const
 Returns the platform dependent representation of the library instance. More...
 
- Public Member Functions inherited from FObject
 FObject ()=default
 default constructor... More...
 
 FObject (const FObject &)
 
FObjectoperator= (const FObject &)
 overloads operator "=" as the reference assignment More...
 
virtual ~FObject ()
 destructor... More...
 
virtual FClassID isA () const
 a local alternative to getFClassID () More...
 
virtual bool isA (FClassID s) const
 evaluates if the passed ID is of the FObject type More...
 
virtual bool isTypeOf (FClassID s, bool=true) const
 evaluates if the passed ID is of the FObject type More...
 
int32 getRefCount ()
 returns the current interface reference count More...
 
FUnknown * unknownCast ()
 get FUnknown interface from object More...
 
tresult queryInterface (const TUID _iid, void **obj) SMTG_OVERRIDE
 please refer to FUnknown::queryInterface () More...
 
uint32 addRef () SMTG_OVERRIDE
 please refer to FUnknown::addref () More...
 
uint32 release () SMTG_OVERRIDE
 please refer to FUnknown::release () More...
 
void update (FUnknown *, int32) SMTG_OVERRIDE
 empty virtual method that should be overridden by derived classes for data updates upon changes More...
 
virtual void addDependent (IDependent *dep)
 adds dependency to the object More...
 
virtual void removeDependent (IDependent *dep)
 removes dependency from the object More...
 
virtual void changed (int32 msg=kChanged)
 Inform all dependents, that the object has changed. More...
 
virtual void deferUpdate (int32 msg=kChanged)
 Similar to triggerUpdates, except only delivered in idle (usefull in collecting updates). More...
 
virtual void updateDone (int32)
 empty virtual method that should be overridden by derived classes More...
 
virtual bool isEqualInstance (FUnknown *d)
 
template<class C >
IPtr< C > fromUnknown (FUnknown *unknown)
 

Public Attributes

OBJ_METHODS(FDynLibrary, FObject) protected void * instance
 

Additional Inherited Members

- Static Public Member Functions inherited from FObject
static FClassID getFClassID ()
 return Class ID as an ASCII string (statically) More...
 
static void setUpdateHandler (IUpdateHandler *handler)
 set method for the local attribute More...
 
static IUpdateHandler * getUpdateHandler ()
 get method for the local attribute More...
 
static bool classIDsEqual (FClassID ci1, FClassID ci2)
 compares (evaluates) 2 class IDs More...
 
static FObjectunknownToObject (FUnknown *unknown)
 pointer conversion from FUnknown to FObject More...
 
template<class Class >
static IPtr< Class > fromUnknown (FUnknown *unknown)
 convert from FUnknown to FObject More...
 
- Static Public Attributes inherited from FObject
static const FUID iid
 Special UID that is used to cast an FUnknown pointer to a FObject. More...
 
- Protected Attributes inherited from FObject
int32 refCount = 1
 COM-model local reference count. More...
 
- Static Protected Attributes inherited from FObject
static IUpdateHandler * gUpdateHandler = nullptr
 

Detailed Description

Platform independent dynamic library loader.

Constructor & Destructor Documentation

◆ FDynLibrary()

FDynLibrary ( const char *  name = nullptr,
bool  addExtension = true 
)

Constructor.

Loads the specified dynamic library.

Parameters
[in]namethe path of the library to load.
[in]addExtensionif true append the platform dependent default extension to name.
Remarks
  • If name specifies a full path, the FDynLibrary searches only that path for the library.
  • If name specifies a relative path or a name without path, FDynLibrary uses a standard search strategy of the current platform to find the library;
  • If name is NULL the library is not loaded.
    • Use init() to load the library.

◆ ~FDynLibrary()

~FDynLibrary ( )
override

Destructor.

The destructor unloads the library.

Member Function Documentation

◆ init()

bool init ( const char *  name,
bool  addExtension = true 
)

Loads the library if not already loaded.

This function is normally called by FDynLibrary().

Remarks
If the library is already loaded, this call has no effect.

◆ getProcAddress()

void * getProcAddress ( const char *  name)

Returns the address of the procedure name.

◆ isLoaded()

bool isLoaded ( )
inline

Returns true when the library was successfully loaded.

◆ unload()

bool unload ( )

Unloads the library if it is loaded.

This function is called by ~FDynLibrary ().

◆ getPlatformInstance()

void * getPlatformInstance ( ) const
inline

Returns the platform dependent representation of the library instance.

Member Data Documentation

◆ instance

OBJ_METHODS (FDynLibrary, FObject) protected void* instance
Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.