Difference between revisions of "CXMessageTarget"

From cxwiki

(Created page with "<div class="mw-parser-output">The CXMessageTarget baseclass allows a message-passing hierarchy to be built for the purpose of dispatching CXMessage event messages. The U...")
(No difference)

Revision as of 21:23, 15 April 2018

The CXMessageTarget baseclass allows a message-passing hierarchy to be built for the purpose of dispatching CXMessage event messages. The UIElement hierarchy derives from this class, however it is possible to use message-passing in other classes and scenarios.
 

Message Handling

//
virtual CXResultCode Message(const CXMessage &msg);

 

 

Observation

 

// Thread-safe.

void BroadcastToObservers(const CXMessage &msg);


// Thread-safe, race conditions.
bool HasObservers(void) const;

// Thread-safe, race conditions.
uint CountObservers(void) const;

 

 
 

Override Points

 
//
virtual CXMessageTarget* __nullable GetMessageParent(void);

//
virtual CXString GetMessageTargetID(void) const;

//
virtual CXString AsDebugString(void) const;
  
// Called when adding an observer to a non-observed target.
// Called on the thread which added the observer.
virtual void NotifyObserversAttached(void);
    
// Called when removing the last observer from a target.
// Called on the thread which removed the observer.
virtual void NotifyObserversDetached(void);