Cbeam
|
Manages the initialization and deinitialization of COM. More...
#include <com_initializer.hpp>
Public Member Functions | |
com_initializer (const bool multi_threaded, const bool do_throw=true) | |
Constructor: If we are on Windows and COM is not initialized, initialize it in the specified mode. | |
~com_initializer () noexcept | |
Destructor: Deinitializes COM in case the constructor initialized it. Does nothing if COM was already initialized at construction time. | |
bool | should_deinitialize_on_destruction () const |
Checks if COM will be deinitialized upon destruction of this object. | |
com_initializer (const com_initializer &)=delete | |
com_initializer & | operator= (const com_initializer &)=delete |
Protected Attributes | |
bool | _deinitialize_on_destruction |
Manages the initialization and deinitialization of COM.
This class will initialize COM for the process when created and deinitialize it when destroyed. It does nothing on non-Windows platforms. It also does nothing if COM is already initialized.
|
inline |
Constructor: If we are on Windows and COM is not initialized, initialize it in the specified mode.
multi_threaded | If true, initializes COM in multithreaded apartment (MTA) mode. If false, initializes COM in single-threaded apartment (STA) mode. |
do_throw | If true, throw a cbeam::error::runtime_error in case COM cannot be initialized. Default: true. Note that it is not error if COM was already initialized. |
|
inlinenoexcept |
Destructor: Deinitializes COM in case the constructor initialized it. Does nothing if COM was already initialized at construction time.
|
delete |
|
delete |
|
inline |
Checks if COM will be deinitialized upon destruction of this object.
|
protected |