Annwvyn::AnnDynamicLibraryHolder Class Reference

Class that handle the lifetime of a DLL. Automatically call FreeLibrary/dlclose for you. Intended to be used inside an unique_ptr. More...

#include <AnnDynamicLibraryHolder.hpp>

Public Types

using AnnDynLib = void *
 Abstract the type of what we are keeping. This type is either HMODULE or void* depending on the host system. Represed a loaded dynamic library. More...
 

Public Member Functions

 AnnDynamicLibraryHolder (AnnDynamicLibraryHolder &)=delete
 Deleted copy operation. More...
 
void operator= (AnnDynamicLibraryHolder &)=delete
 Deleted copy operation. More...
 
 AnnDynamicLibraryHolder (AnnDynamicLibraryHolder &&other) noexcept
 Move constructor. More...
 
AnnDynamicLibraryHolderoperator= (AnnDynamicLibraryHolder &&other) noexcept
 Move-assign operator. More...
 
 AnnDynamicLibraryHolder (AnnDynLib lib)
 Construct the holder. More...
 
 ~AnnDynamicLibraryHolder ()
 Destruct the holder, will FreeLibrary/dlclose the library handle/pointer. More...
 

Private Attributes

AnnDynLib heldLibrary = nullptr
 handle to dll/so that has been loaded in memory More...
 

Detailed Description

Class that handle the lifetime of a DLL. Automatically call FreeLibrary/dlclose for you. Intended to be used inside an unique_ptr.

Definition at line 17 of file AnnDynamicLibraryHolder.hpp.

Member Typedef Documentation

◆ AnnDynLib

Abstract the type of what we are keeping. This type is either HMODULE or void* depending on the host system. Represed a loaded dynamic library.

Definition at line 44 of file AnnDynamicLibraryHolder.hpp.

Constructor & Destructor Documentation

◆ AnnDynamicLibraryHolder() [1/3]

Annwvyn::AnnDynamicLibraryHolder::AnnDynamicLibraryHolder ( AnnDynamicLibraryHolder )
delete

Deleted copy operation.

◆ AnnDynamicLibraryHolder() [2/3]

Annwvyn::AnnDynamicLibraryHolder::AnnDynamicLibraryHolder ( AnnDynamicLibraryHolder &&  other)
inlinenoexcept

Move constructor.

Definition at line 26 of file AnnDynamicLibraryHolder.hpp.

◆ AnnDynamicLibraryHolder() [3/3]

Annwvyn::AnnDynamicLibraryHolder::AnnDynamicLibraryHolder ( AnnDynLib  lib)
inline

Construct the holder.

Definition at line 48 of file AnnDynamicLibraryHolder.hpp.

◆ ~AnnDynamicLibraryHolder()

Annwvyn::AnnDynamicLibraryHolder::~AnnDynamicLibraryHolder ( )
inline

Destruct the holder, will FreeLibrary/dlclose the library handle/pointer.

Definition at line 54 of file AnnDynamicLibraryHolder.hpp.

Member Function Documentation

◆ operator=() [1/2]

void Annwvyn::AnnDynamicLibraryHolder::operator= ( AnnDynamicLibraryHolder )
delete

Deleted copy operation.

◆ operator=() [2/2]

AnnDynamicLibraryHolder& Annwvyn::AnnDynamicLibraryHolder::operator= ( AnnDynamicLibraryHolder &&  other)
inlinenoexcept

Move-assign operator.

Definition at line 33 of file AnnDynamicLibraryHolder.hpp.

Member Data Documentation

◆ heldLibrary

AnnDynLib Annwvyn::AnnDynamicLibraryHolder::heldLibrary = nullptr
private

handle to dll/so that has been loaded in memory

Definition at line 69 of file AnnDynamicLibraryHolder.hpp.


The documentation for this class was generated from the following file: