AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
drama::thread::TUface Class Reference

Detailed Description

A class which allows threads running in a User Interface or similar environments to send DRAMA messages.

Author
Tony Farrell, AAO $Revision$ $Date$
Examples
monitor1.cpp, monitor2.cpp, and tocker.cpp.

#include "threaduface.hh"

Inheritance diagram for drama::thread::TUface:
drama::thread::TMessHandler drama::RunDramaExitNotifier

Public Member Functions

 TUface (std::weak_ptr< Task > dramaTask, const std::string &logThreadName="TUface::TUface")
 Create a DRAMA action/message handler object which runs a thread when the Obey message is received.
 
virtual ~TUface ()
 TUface destructor.
 
void ___SetLoggerOnlyUFACEItem ()
 Indicate that this UFACE item is for a thread which invoked Logger::RegisterThreadNoDramaCtx() without a DRAMA context.
 
virtual const EntryInfoGetEntry () const
 Return the entry details.
 
Dits___CurActType GetMessageContext () const override
 Get the DRAMA Context associated with the UFACE event.
 
std::shared_ptr< TaskGetTask () const override
 Get a reference to the DRAMA task we are part of.
 
virtual bool JoinThreads (std::chrono::steady_clock::time_point until) override
 Invoked when the drama::task::RunDrama() loop exits.
 
Task::mutexTypeLock () const override
 Reference the DRAMA Task lock.
 
template<typename... Types>
void MessageUser (const char *format, Types... args)
 Use DRAMA to send a message to the user - safe format.
 
void MessageUser (const std::string &text) const override
 Use DRAMA to send a message to the user.
 
virtual int RunDramaHasExited () override
 Invoked when the drama::task::RunDrama() loop exits.
 
virtual const sds::PrintObjectCRSdsListToUser () const
 Get a reference to an SDS printer object which can be used to list an SDS object using MessageUser.
 
void SetupWaitEvent (DitsTransIdType tid, drama::Path *pathObj) override
 Sets up a wait event for this thread.
 
virtual void WaitForTransaction (std::weak_ptr< Task > theTask, TransEvtInfo *const eventInfo, TransEvtProcessor *const eventProcessor, sds::IdPtr *const arg=nullptr)
 Block the current thread until a message for the transaction specified to SetupWaitEvent() occurs.
 
virtual bool WaitForTransactionUntil (std::weak_ptr< Task > theTask, TransEvtInfo *const eventInfo, TransEvtProcessor *const eventProcessor, const std::chrono::steady_clock::time_point &until, sds::IdPtr *const arg=nullptr)
 Block the current thread until a message for the transaction specified to SetupWaitEvent() occurs or until a certain time has passed.
 

Static Public Member Functions

static bool ___LoggerOnlyUFACEItem (TUface *pnt)
 Indicate if logger only UFACE item created when Logger::RegisterThreadNoDramaCtx() was invoked (Actually just if SetLoggerOnlyUFACEItem() was invoked on this item)
 

Protected Member Functions

void ClearWait (bool complete) override
 Clear the thread' waiting flag in _waitEventMap.
 
void GrabEntryInfo ()
 Fetch the DRAMA Entry information.
 
void WaitForTransactionFinish (const WaitEventData &details, TransEvtInfo *const eventInfo, sds::IdPtr *const arg)
 The wait for transaction operation has finished - tidy up.
 
WaitEventDetails * WaitForTransactionStart ()
 Initiate waiting for a transaction and return a pointer to the item the wait event details.
 

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