Base Module VST 3.6.11 SDK for developing VST Plug-in

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Namespaces | Macros | Typedefs | Functions
fobject.h File Reference

Basic Object implementing FUnknown. More...

`#include "pluginterfaces/base/funknown.h"`
`#include "pluginterfaces/base/iupdatehandler.h"`
`#include "base/source/fdebug.h"`

## Classes
class | FObject
| Implements FUnknown and IDependent. More...

## Namespaces
| Steinberg
| Steinberg::Singleton
| Automatic creation and destruction of singleton instances.

## Macros
#define | SINGLETON(ClassName)
#define | OBJ_METHODS(className, baseClass)
#define | REFCOUNT_METHODS(BaseClass)
| Delegate refcount functions to BaseClass. More...
Macros to implement FUnknown::queryInterface ().
Examples: class Foo : public FObject, public IFoo2, public IFoo3 { ... DEFINE_INTERFACES DEF_INTERFACE (IFoo2) DEF_INTERFACE (IFoo3) END_DEFINE_INTERFACES (FObject) REFCOUNT_METHODS(FObject) // Implement IFoo2 interface ... // Implement IFoo3 interface ... ... };
#define | DEFINE_INTERFACES
| Start defining interfaces. More...
#define | DEF_INTERFACE(InterfaceName) QUERY_INTERFACE (iid, obj, InterfaceName::iid, InterfaceName)
| Add a interfaces. More...
#define | END_DEFINE_INTERFACES(BaseClass)
| End defining interfaces. More...
Convenient macros to implement Steinberg::FUnknown::queryInterface ().
Examples: class Foo : public FObject, public IFoo2, public IFoo3 { ... DEF_INTERFACES_2(IFoo2,IFoo3,FObject) REFCOUNT_METHODS(FObject) ... };
#define | DEF_INTERFACES_1(InterfaceName, BaseClass)
#define | DEF_INTERFACES_2(InterfaceName1, InterfaceName2, BaseClass)
#define | DEF_INTERFACES_3(InterfaceName1, InterfaceName2, InterfaceName3, BaseClass)
#define | DEF_INTERFACES_4(InterfaceName1, InterfaceName2, InterfaceName3, InterfaceName4, BaseClass)
Convenient macros to implement Steinberg::FUnknown methods.
Examples: class Foo : public FObject, public IFoo2, public IFoo3 { ... FUNKNOWN_METHODS2(IFoo2,IFoo3,FObject) ... };
#define | FUNKNOWN_METHODS(InterfaceName, BaseClass)
#define | FUNKNOWN_METHODS2(InterfaceName1, InterfaceName2, BaseClass)
#define | FUNKNOWN_METHODS3(InterfaceName1, InterfaceName2, InterfaceName3, BaseClass)
#define | FUNKNOWN_METHODS4(InterfaceName1, InterfaceName2, InterfaceName3, InterfaceName4, BaseClass)

## Typedefs
typedef FIDString | FClassID

## Functions
template<class C >
C * | FCast (const FObject *object)
| FCast overload 1 - FObject to FObject. More...
template<class C >
C * | FCast (FUnknown *unknown)
| FCast overload 2 - FUnknown to FObject. More...
template<class C >
C * | FUCast (FObject *object)
| FUCast - casting from FUnknown to Interface. More...
template<class C >
C * | FUCast (FUnknown *object)
template<class T >
void | AssignShared (T *&dest, T *newPtr)
template<class T >
void | AssignSharedDependent (IDependent *_this, T *&dest, T *newPtr)
template<class T >
void | AssignSharedDependent (IDependent *_this, IPtr< T > &dest, T *newPtr)
template<class T >
void | SafeReleaseDependent (IDependent *_this, T *&dest)
template<class T >
void | SafeReleaseDependent (IDependent *_this, IPtr< T > &dest)
void | registerInstance (FObject **o)
| registers an instance (type FObject) More...
bool | isTerminated ()
| Returns true when singleton instances were already released. More...
void | lockRegister ()
| lock and unlock the singleton registration for multi-threading safety More...
void | unlockRegister ()
Convenience methods that call release or delete respectively
on a pointer if it is non-zero, and then set the pointer to zero. Note: you should prefer using IPtr or OPtr instead of these methods whenever possible. Examples: ~Foo () { // instead of ... if (somePointer) { somePointer->release (); somePointer = 0; } // ... just being lazy I write SafeRelease (somePointer) }
template<class I >
void | SafeRelease (I *&ptr)
template<class I >
void | SafeRelease (IPtr< I > &ptr)
template<class T >
void | SafeDelete (T *&ptr)

## Detailed Description

Basic Object implementing FUnknown.

## Macro Definition Documentation

#define SINGLETON | ( |  | ClassName | ) |

Value:
static ClassName* instance (bool create = true) \
{ \
static Steinberg::FObject* inst = nullptr; \
if (inst == nullptr && create && Steinberg::Singleton::isTerminated () == false) \
{ \
Steinberg::Singleton::lockRegister (); \
if (inst == nullptr) \
{ \
inst = NEW ClassName; \
Steinberg::Singleton::registerInstance (&inst); \
} \
Steinberg::Singleton::unlockRegister (); \
} \
return (ClassName*)inst; \
}
Steinberg::FObject
Implements FUnknown and IDependent.
Definition: fobject.h:83
Steinberg::Singleton::registerInstance
void registerInstance(FObject **o)
registers an instance (type FObject)
Definition: fobject.cpp:146
Steinberg::Singleton::isTerminated
bool isTerminated()
Returns true when singleton instances were already released.
Definition: fobject.cpp:133
NEW
#define NEW
Definition: fdebug.h:209
Steinberg::Singleton::unlockRegister
void unlockRegister()
Definition: fobject.cpp:141
Steinberg::Singleton::lockRegister
void lockRegister()
lock and unlock the singleton registration for multi-threading safety
Definition: fobject.cpp:135

#define OBJ_METHODS | ( |  | className,
|  |  | baseClass
| ) |  |

Value:
static inline Steinberg::FClassID getFClassID () {return (#className);} \
virtual Steinberg::FClassID isA () const SMTG_OVERRIDE {return className::getFClassID ();} \
virtual bool isA (Steinberg::FClassID s) const SMTG_OVERRIDE {return isTypeOf (s, false);} \
virtual bool isTypeOf (Steinberg::FClassID s, bool askBaseClass = true) const SMTG_OVERRIDE \
{ return (classIDsEqual (s, #className) ? true : (askBaseClass ? baseClass::isTypeOf (s, true) : false)); }
Steinberg::FClassID
FIDString FClassID
Definition: fobject.h:54

#define REFCOUNT_METHODS | ( |  | BaseClass | ) |

Value:
virtual Steinberg::uint32 PLUGIN_API addRef ()SMTG_OVERRIDE{ return BaseClass::addRef (); } \
virtual Steinberg::uint32 PLUGIN_API release ()SMTG_OVERRIDE{ return BaseClass::release (); }

Delegate refcount functions to BaseClass.

BaseClase must implement ref counting.

#define DEFINE_INTERFACES

Value:
Steinberg::tresult PLUGIN_API queryInterface (const Steinberg::TUID iid, void** obj) SMTG_OVERRIDE \
{

Start defining interfaces.

#define DEF_INTERFACE | ( |  | InterfaceName | ) | QUERY_INTERFACE (iid, obj, InterfaceName::iid, InterfaceName)

Add a interfaces.

#define END_DEFINE_INTERFACES | ( |  | BaseClass | ) |

Value:
return BaseClass::queryInterface (iid, obj); \
}

End defining interfaces.

#define DEF_INTERFACES_1 | ( |  | InterfaceName,
|  |  | BaseClass
| ) |  |

Value:
DEFINE_INTERFACES \
DEF_INTERFACE (InterfaceName) \
END_DEFINE_INTERFACES (BaseClass)
END_DEFINE_INTERFACES
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition: fobject.h:393
DEF_INTERFACE
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition: fobject.h:387

#define DEF_INTERFACES_2 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | BaseClass
| ) |  |

Value:
DEFINE_INTERFACES \
DEF_INTERFACE (InterfaceName1) \
DEF_INTERFACE (InterfaceName2) \
END_DEFINE_INTERFACES (BaseClass)
END_DEFINE_INTERFACES
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition: fobject.h:393
DEF_INTERFACE
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition: fobject.h:387

#define DEF_INTERFACES_3 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | InterfaceName3,
|  |  | BaseClass
| ) |  |

Value:
DEFINE_INTERFACES \
DEF_INTERFACE (InterfaceName1) \
DEF_INTERFACE (InterfaceName2) \
DEF_INTERFACE (InterfaceName3) \
END_DEFINE_INTERFACES (BaseClass)
END_DEFINE_INTERFACES
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition: fobject.h:393
DEF_INTERFACE
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition: fobject.h:387

#define DEF_INTERFACES_4 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | InterfaceName3,
|  |  | InterfaceName4,
|  |  | BaseClass
| ) |  |

Value:
DEFINE_INTERFACES \
DEF_INTERFACE (InterfaceName1) \
DEF_INTERFACE (InterfaceName2) \
DEF_INTERFACE (InterfaceName3) \
DEF_INTERFACE (InterfaceName4) \
END_DEFINE_INTERFACES (BaseClass)
END_DEFINE_INTERFACES
#define END_DEFINE_INTERFACES(BaseClass)
End defining interfaces.
Definition: fobject.h:393
DEF_INTERFACE
#define DEF_INTERFACE(InterfaceName)
Add a interfaces.
Definition: fobject.h:387

#define FUNKNOWN_METHODS | ( |  | InterfaceName,
|  |  | BaseClass
| ) |  |

Value:
DEF_INTERFACES_1(InterfaceName,BaseClass) \
REFCOUNT_METHODS(BaseClass)
DEF_INTERFACES_1
#define DEF_INTERFACES_1(InterfaceName, BaseClass)
Definition: fobject.h:413
REFCOUNT_METHODS
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition: fobject.h:353

#define FUNKNOWN_METHODS2 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | BaseClass
| ) |  |

Value:
DEF_INTERFACES_2(InterfaceName1,InterfaceName2,BaseClass) \
REFCOUNT_METHODS(BaseClass)
REFCOUNT_METHODS
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition: fobject.h:353
DEF_INTERFACES_2
#define DEF_INTERFACES_2(InterfaceName1, InterfaceName2, BaseClass)
Definition: fobject.h:419

#define FUNKNOWN_METHODS3 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | InterfaceName3,
|  |  | BaseClass
| ) |  |

Value:
DEF_INTERFACES_3(InterfaceName1,InterfaceName2,InterfaceName3,BaseClass) \
REFCOUNT_METHODS(BaseClass)
REFCOUNT_METHODS
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition: fobject.h:353
DEF_INTERFACES_3
#define DEF_INTERFACES_3(InterfaceName1, InterfaceName2, InterfaceName3, BaseClass)
Definition: fobject.h:426

#define FUNKNOWN_METHODS4 | ( |  | InterfaceName1,
|  |  | InterfaceName2,
|  |  | InterfaceName3,
|  |  | InterfaceName4,
|  |  | BaseClass
| ) |  |

Value:
DEF_INTERFACES_4(InterfaceName1,InterfaceName2,InterfaceName3,InterfaceName4,BaseClass) \
REFCOUNT_METHODS(BaseClass)
REFCOUNT_METHODS
#define REFCOUNT_METHODS(BaseClass)
Delegate refcount functions to BaseClass.
Definition: fobject.h:353
DEF_INTERFACES_4
#define DEF_INTERFACES_4(InterfaceName1, InterfaceName2, InterfaceName3, InterfaceName4, BaseClass)
Definition: fobject.h:434
Empty

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