Kanzi 4.0.0-beta2
kanzi::qnx::QnxContextMethods Class Reference

Class representing QNX context methods. More...

#include <kanzi/platform/platform/windowing_ng/qnx_screen/qnx_screen_context.hpp>

Inheritance diagram for kanzi::qnx::QnxContextMethods:
[legend]

Public Member Functions

bool flush () const noexcept
 Flushes any pending requests.
 
KZ_NO_DISCARD optional< size_t > getDeviceCount () const noexcept
 Tries to get the number of input devices associated with the context.
 
KZ_NO_DISCARD optional< size_t > getDisplayCount () const noexcept
 Tries to get the number of displays associated with the context.
 
KZ_NO_DISCARD QnxEvent getNextEvent (int timeOut) const noexcept
 Gets a next event from the context.
 
KZ_NO_DISCARD optional< vector< QnxDisplay::NativeHandleType > > getQnxDisplayHandles () const noexcept
 Tries to get the native display handles associated with the context.
 
- Public Member Functions inherited from kanzi::qnx::QnxPropertyHost< QnxContextMethods, KANZI_GENERATE_QNX_PROPERTY_HOST_SIGNATURE(context)>
KZ_NO_DISCARD optional< string > getPropertyCv (size_t stringBufferSize, int propertyName) const noexcept
 Gets QNX property consisting of a string.
 
KZ_NO_DISCARD optional< vector< int > > getPropertyIv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of ints.
 
KZ_NO_DISCARD optional< int > getPropertyIvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single int.
 
KZ_NO_DISCARD optional< vector< long long > > getPropertyLlv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of long longs.
 
KZ_NO_DISCARD optional< long long > getPropertyLlvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single long long.
 
KZ_NO_DISCARD optional< vector< T > > getPropertyPv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of pointers.
 
KZ_NO_DISCARD optional< T > getPropertyPvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single pointer.
 
bool setPropertyCv (int propertyName, string_view propertyValue) const noexcept
 Sets QNX property consisting of a string.
 
bool setPropertyIv (int propertyName, int propertyValue) const noexcept
 Sets QNX property consisting of a single int.
 
bool setPropertyIv (int propertyName, span< int > propertyValue) const noexcept
 Sets QNX property consisting of ints.
 
bool setPropertyLlv (int propertyName, long long propertyValue) const noexcept
 Sets QNX property consisting of a single long long.
 
bool setPropertyLlv (int propertyName, span< long long > propertyValue) const noexcept
 Sets QNX property consisting of long longs.
 
bool setPropertyPv (int propertyName, span< void * > propertyValue) const noexcept
 Sets QNX property consisting of pointers.
 
bool setPropertyPv (int propertyName, void *propertyValue) const noexcept
 Sets QNX property consisting of a single pointer.
 

Protected Member Functions

 QnxContextMethods () noexcept=default
 Constructor.
 
 QnxContextMethods (const NativeHandleType &handle) noexcept
 Constructor.
 
- Protected Member Functions inherited from kanzi::OptionalHandle< screen_context_t, nullptr, screen_destroy_context >
KZ_NO_DISCARD optional< screen_context_t > createOptional () const noexcept
 Creates a kanzi::optional copy of the native handle.
 
KZ_NO_DISCARD const screen_context_t get () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD screen_context_t get () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD const screen_context_t getNativeHandle () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD screen_context_t getNativeHandle () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD bool hasValue () const noexcept
 Checks if a handle is stored.
 
KZ_NO_DISCARD operator bool () const noexcept
 Conversion operator to bool.
 
KZ_NO_DISCARD screen_context_t && operator* () &&noexcept
 Provides access to stored handle via rvalue reference.
 
KZ_NO_DISCARD screen_context_t & operator* () &noexcept
 Provides access to stored handle via reference.
 
KZ_NO_DISCARD const screen_context_t && operator* () const &&noexcept
 Provides access to stored handle via const rvalue reference.
 
KZ_NO_DISCARD const screen_context_t & operator* () const &noexcept
 Provides access to stored handle via const reference.
 
OptionalHandleoperator= (const OptionalHandle &other)=delete
 Copy assignment operator.
 
OptionalHandleoperator= (const screen_context_t &value)
 Copy assignment operator.
 
OptionalHandleoperator= (OptionalHandle &&other) noexcept
 Move assignment operator.
 
OptionalHandleoperator= (screen_context_t &&value) noexcept
 Move assignment operator.
 
 OptionalHandle () noexcept
 Constructor.
 
 OptionalHandle (const OptionalHandle &other)=delete
 Copy constructor.
 
 OptionalHandle (const screen_context_t &nativeHandle) noexcept
 Constructor.
 
 OptionalHandle (OptionalHandle &&other) noexcept
 Move constructor.
 
screen_context_t release () noexcept
 Releases ownership of a native handle without destroying the resource.
 
void reset () noexcept
 Replaces stored handle with sentinel value.
 
void reset (U &&newHandle) noexcept
 Stores a new handle inside.
 
void swap (OptionalHandle &other)
 Swap function.
 
KZ_NO_DISCARD optional< screen_context_t > toOptional () &&noexcept
 Converts OptionalHandle to kanzi::optional.
 
 ~OptionalHandle ()
 Destructor.
 
- Protected Member Functions inherited from kanzi::qnx::QnxPropertyHost< QnxContextMethods, KANZI_GENERATE_QNX_PROPERTY_HOST_SIGNATURE(context)>
KZ_NO_DISCARD optional< string > getPropertyCv (size_t stringBufferSize, int propertyName) const noexcept
 Gets QNX property consisting of a string.
 
KZ_NO_DISCARD optional< vector< int > > getPropertyIv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of ints.
 
KZ_NO_DISCARD optional< int > getPropertyIvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single int.
 
KZ_NO_DISCARD optional< vector< long long > > getPropertyLlv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of long longs.
 
KZ_NO_DISCARD optional< long long > getPropertyLlvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single long long.
 
KZ_NO_DISCARD optional< vector< T > > getPropertyPv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of pointers.
 
KZ_NO_DISCARD optional< T > getPropertyPvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single pointer.
 
bool setPropertyCv (int propertyName, string_view propertyValue) const noexcept
 Sets QNX property consisting of a string.
 
bool setPropertyIv (int propertyName, int propertyValue) const noexcept
 Sets QNX property consisting of a single int.
 
bool setPropertyIv (int propertyName, span< int > propertyValue) const noexcept
 Sets QNX property consisting of ints.
 
bool setPropertyLlv (int propertyName, long long propertyValue) const noexcept
 Sets QNX property consisting of a single long long.
 
bool setPropertyLlv (int propertyName, span< long long > propertyValue) const noexcept
 Sets QNX property consisting of long longs.
 
bool setPropertyPv (int propertyName, span< void * > propertyValue) const noexcept
 Sets QNX property consisting of pointers.
 
bool setPropertyPv (int propertyName, void *propertyValue) const noexcept
 Sets QNX property consisting of a single pointer.
 

Static Protected Member Functions

static KZ_NO_DISCARD QnxContextMethods create (int contextFlags) noexcept
 Tries to create a QNX context.
 
- Static Protected Member Functions inherited from kanzi::OptionalHandle< screen_context_t, nullptr, screen_destroy_context >
static constexpr auto getDeleter () noexcept
 Gets deleter function.
 
static constexpr screen_context_t getSentinel () noexcept
 Gets sentinel value that can be used to represent invalid handle.
 

Additional Inherited Members

- Protected Types inherited from kanzi::OptionalHandle< screen_context_t, nullptr, screen_destroy_context >
using HandleType
 Alias for this handle type.
 
using NativeHandleType
 Alias for the underlying native handle type.
 
- Protected Attributes inherited from kanzi::OptionalHandle< screen_context_t, nullptr, screen_destroy_context >
FlatOptional< screen_context_t, sentinel > m_handle
 Native handle that is managed by this class.
 

Detailed Description

Class representing QNX context methods.

Note
Do not use this class directly. Use QnxContext instead.
See also
QnxContext
Since
Kanzi 4.0.0 changed to use QnxPropertyHost interface.
Kanzi 4.0.0 inherits from OptionalHandle.
Kanzi 4.0.0 QnxContext is now a safe wrapper around QnxContextMethods.

Constructor & Destructor Documentation

◆ QnxContextMethods() [1/2]

kanzi::qnx::QnxContextMethods::QnxContextMethods ( )
explicitprotecteddefaultnoexcept

Constructor.

◆ QnxContextMethods() [2/2]

kanzi::qnx::QnxContextMethods::QnxContextMethods ( const NativeHandleType & handle)
explicitprotectednoexcept

Constructor.

Parameters
handleNative handle.

Member Function Documentation

◆ getNextEvent()

KZ_NO_DISCARD QnxEvent kanzi::qnx::QnxContextMethods::getNextEvent ( int timeOut) const
noexcept

Gets a next event from the context.

Parameters
timeOutMaximum time (in nanoseconds) to wait for an event to occur. -1 indicates that the call will block until an event is ready.
Returns
QNX event.
Since
Kanzi 4.0.0 returns a QnxEvent.
Kanzi 4.0.0 renamed from tryGetNextEvent.

◆ getDisplayCount()

KZ_NO_DISCARD optional< size_t > kanzi::qnx::QnxContextMethods::getDisplayCount ( ) const
noexcept

Tries to get the number of displays associated with the context.

Return values
nulloptTrying to get the number of displays has failed.
Returns
Display count.
Since
Kanzi 4.0.0 renamed from tryGetDisplayCount.

◆ getQnxDisplayHandles()

KZ_NO_DISCARD optional< vector< QnxDisplay::NativeHandleType > > kanzi::qnx::QnxContextMethods::getQnxDisplayHandles ( ) const
noexcept

Tries to get the native display handles associated with the context.

Return values
nulloptTrying to get the displays has failed.
Returns
Displays.
Since
Kanzi 4.0.0 renamed from tryGetQnxDisplayHandles.

◆ getDeviceCount()

KZ_NO_DISCARD optional< size_t > kanzi::qnx::QnxContextMethods::getDeviceCount ( ) const
noexcept

Tries to get the number of input devices associated with the context.

Return values
nulloptTrying to get the number of devices has failed.
Returns
Device count.
Since
Kanzi 4.0.0

◆ flush()

bool kanzi::qnx::QnxContextMethods::flush ( ) const
noexcept

Flushes any pending requests.

Returns
True on success, false on failure.
Since
Kanzi 4.0.0 marked as const.

◆ create()

static KZ_NO_DISCARD QnxContextMethods kanzi::qnx::QnxContextMethods::create ( int contextFlags)
staticprotectednoexcept

Tries to create a QNX context.

Parameters
contextFlagsQNX Screen context bit flags.
Returns
The created object. If error occurred, empty.
Since
Kanzi 4.0.0

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