OSVR-Core
Public Member Functions | List of all members
osvr::connection::RequestToSend Class Reference

RAII object for use by an async thread to manage a request to send. More...

#include <AsyncAccessControl.h>

Inheritance diagram for osvr::connection::RequestToSend:

Public Member Functions

 RequestToSend (AsyncAccessControl &aac)
 Creates an RAII object to manage the request to send - note that it does not immediately request to send. More...
 
 ~RequestToSend ()
 Destructor.
 
bool request ()
 Issues a blocking request to send. More...
 
bool isNested () const
 Method to find out if this is a nested RTS - primarily for testing. More...
 

Detailed Description

RAII object for use by an async thread to manage a request to send.

Todo:
allow timeout on RTS enum RequestResults { RR_CTS_GRANTED, RR_DENIED, RR_TIMED_OUT };

Constructor & Destructor Documentation

§ RequestToSend()

osvr::connection::RequestToSend::RequestToSend ( AsyncAccessControl aac)

Creates an RAII object to manage the request to send - note that it does not immediately request to send.

Member Function Documentation

§ isNested()

bool osvr::connection::RequestToSend::isNested ( ) const
inline

Method to find out if this is a nested RTS - primarily for testing.

Only valid to call following a true return from request()

§ request()

bool osvr::connection::RequestToSend::request ( )

Issues a blocking request to send.

Can only be called once in the lifetime of a RequestToSend object!

Returns
true if request granted, false if denied.

OK, so we're recursive here. Make a note and don't add another locking layer

Take the main thread "free to go" status lock.


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