dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::apartment< object_t, model > Class Template Reference

the COM apartment of one object - a device or a whole driver: its thread creates the object, runs its steps and releases it More...

#include <dx_apartment.h>

Public Member Functions

template<typename... args_t>
requires (!std::is_same_v<apartment, std::remove_cvref_t<args_t>>&& ...)
 apartment(args_t&&... args)
 the constructor returns once the thread holds the apartment and the object, built from the arguments, stands
 operator object_t&() const noexcept
template<typename args_t>
requires requires(object_t& object, args_t& args){object<< args;}
void operator <<(args_t& args)
 a parser's face, where the object has one: only the args cross to the thread
void quiet() noexcept
void sleep()
bool try_conclude() noexcept
bool try_launch()
void wake()
 ~apartment()
 the object concludes and goes on the thread that created it; a destructor running on that thread itself lets it run out detached

Detailed Description

template<typename object_t, ::COINIT model = COINIT_APARTMENTTHREADED>
class dx::apartment< object_t, model >

the COM apartment of one object - a device or a whole driver: its thread creates the object, runs its steps and releases it

An apartment threaded in-proc server whose interface carries no marshaller is bound to the thread that created it, so an object built on such a server exists only for as long as that thread holds the apartment; and the multithreaded apartment lives for as long as some thread holds it. The apartment is held wherever the object would be: a driver's map holds a device's apartment and hands out the device aliased to it, a harness holds a driver's apartment and parses through it. Only data crosses the thread boundary - the constructor's arguments, a parser's args - never a call-in gateway.

The rendezvous of every step belongs to whoever hands it over, so the thread touches nothing of this object once a step returned - a step may have released the last reference to it.

Exceptions
Whatevercreating the object or a step throws, rethrown on the thread that asked for it.

Constructor & Destructor Documentation

◆ apartment()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
template<typename... args_t>
requires (!std::is_same_v<apartment, std::remove_cvref_t<args_t>>&& ...)
dx::apartment<object_t, model>::apartment(args_t&&... args)
inline

the constructor returns once the thread holds the apartment and the object, built from the arguments, stands

◆ ~apartment()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
dx::apartment<object_t, model>::~apartment()
inline

the object concludes and goes on the thread that created it; a destructor running on that thread itself lets it run out detached

Member Function Documentation

◆ operator object_t &()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
dx::apartment<object_t, model>::operator object_t&() const
inlinenoexcept

◆ operator <<()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
template<typename args_t>
requires requires(object_t& object, args_t& args){object<< args;}
void dx::apartment<object_t, model>::operator <<(args_t& args)
inline

a parser's face, where the object has one: only the args cross to the thread

◆ quiet()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
void dx::apartment<object_t, model>::quiet()
inlinenoexcept

◆ sleep()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
void dx::apartment<object_t, model>::sleep()
inline

◆ try_conclude()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
bool dx::apartment<object_t, model>::try_conclude()
inlinenoexcept

◆ try_launch()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
bool dx::apartment<object_t, model>::try_launch()
inline

◆ wake()

template<typename object_t, ::COINIT model= COINIT_APARTMENTTHREADED>
void dx::apartment<object_t, model>::wake()
inline

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