CXMessageTarget

From cxwiki

Revision as of 21:23, 15 April 2018 by Windwalkr (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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);