Isle
Loading...
Searching...
No Matches
MxCompositePresenter Class Reference

[AI] Composite presenter that manages a collection of child presenters, orchestrating their actions and notifications as a group. More...

#include <mxcompositepresenter.h>

Inheritance diagram for MxCompositePresenter:
Collaboration diagram for MxCompositePresenter:

Public Member Functions

 MxCompositePresenter ()
 [AI] Default constructor; registers the composite presenter with the notification manager. More...
 
 ~MxCompositePresenter () override
 [AI] Destructor, unregisters the presenter from the notification manager and properly cleans up contained presenters. More...
 
MxLong Notify (MxParam &p_param) override
 [AI] Notifies the composite presenter of a particular event (such as end of sub-action or notification from a child presenter). More...
 
const char * ClassName () const override
 [AI] Returns the dynamic class name; used for runtime type identification. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Runtime type checking for presenter class hierarchy, supporting parent/child class checks. More...
 
MxResult StartAction (MxStreamController *p_controller, MxDSAction *p_action) override
 [AI] Starts a composite action by creating child presenters for each action in a MxDSMultiAction list and starting them. More...
 
void EndAction () override
 [AI] Ends the composite action, terminating all child presenters and clearing action lists. Sends end notifications if needed. More...
 
void SetTickleState (TickleState p_tickleState) override
 [AI] Change the tickle state of this composite presenter and propagate to each child. More...
 
MxBool HasTickleStatePassed (TickleState p_tickleState) override
 [AI] Checks if all child presenters have advanced past the given tickle state. More...
 
void Enable (MxBool p_enable) override
 [AI] Enables or disables this presenter and all child presenters. More...
 
virtual void VTable0x58 (MxEndActionNotificationParam &p_param)
 [AI] Handler for "end action" notification, invoked when one of the child presenters finishes its assigned sub-action. More...
 
virtual void VTable0x5c (MxNotificationParam &p_param)
 [AI] Handler for generic presenter notification, such as state change. More...
 
virtual void VTable0x60 (MxPresenter *p_presenter)
 [AI] Advance sequencing for serial multi-actions: promotes the next presenter in sequence to e_ready state after predecessor finishes. More...
 
virtual MxBool VTable0x64 (undefined4 p_undefined)
 [AI] Delegated state/mode checking. More...
 
MxCompositePresenterListGetList ()
 [AI] Returns reference to the internal list of child presenters managed by this composite. More...
 
- Public Member Functions inherited from MxPresenter
 MxPresenter ()
 [AI] Constructor. Initializes internal tickle state and other members. More...
 
MxResult Tickle () override
 [AI] Main tickle handler, called periodically to progress presenter's internal state. More...
 
virtual void VTable0x14 ()
 [AI] Reserved for future or specialized use in derived classes. More...
 
virtual void ReadyTickle ()
 [AI] Handles the transition and setup for the Ready state. Parses extra action data and advances state. More...
 
virtual void StartingTickle ()
 [AI] Handles actions required when first starting presentation. Advances to streaming state. More...
 
virtual void StreamingTickle ()
 [AI] Handles periodic updates during the streaming/presentation stage. Advances to repeating state. More...
 
virtual void RepeatingTickle ()
 [AI] Handles updates when in a repeating (looping) stage. Advances to freezing state. More...
 
virtual void FreezingTickle ()
 [AI] Handles updates during the freezing/suspended state. Advances to done state. More...
 
 ~MxPresenter () override
 [AI] Destructor, cleans up resources (base class: does nothing beyond Init). More...
 
virtual MxResult AddToManager ()
 [AI] Optional registration with a manager (such as TickleManager); by default does nothing. More...
 
virtual void Destroy ()
 [AI] Resets presenter state or cleans up resources after completion/removal. More...
 
virtual MxResult StartAction (MxStreamController *, MxDSAction *)
 [AI] Initiates presenter for a new action, setting up context and state. More...
 
virtual void EndAction ()
 [AI] Terminates the current action, notifies listeners and resets state. More...
 
virtual void SetTickleState (TickleState p_tickleState)
 [AI] Forces the tickle state, advancing to the requested lifecycle stage. More...
 
virtual MxBool HasTickleStatePassed (TickleState p_tickleState)
 [AI] Checks if the specified tickle state has ever been passed since last reset. More...
 
virtual MxResult PutData ()
 [AI] Allows the presenter to submit pending results or output to the engine. More...
 
virtual MxBool IsHit (MxS32 p_x, MxS32 p_y)
 [AI] Returns TRUE if the given (x, y) falls within hit-test bounds for the presenter (e.g. More...
 
virtual void Enable (MxBool p_enable)
 [AI] Enables or disables this presenter (controls action flags accordingly). More...
 
const char * ClassName () const override
 [AI] Returns the run-time class name for this presenter. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Determines if this object is of (or inherits) the specified named class. More...
 
MxEntityCreateEntity (const char *p_defaultName)
 [AI] Creates an entity based on action 'extra' data, or uses the provided default name. More...
 
void SendToCompositePresenter (MxOmni *p_omni)
 [AI] Notifies a composite presenter (if one exists) that this presenter wishes to join a group. More...
 
MxBool IsEnabled ()
 [AI] Returns whether this presenter is logically enabled (based on the associated action's flags). More...
 
MxS32 GetCurrentTickleState () const
 [AI] Returns the current tickle state. More...
 
MxPoint32 GetLocation () const
 [AI] Returns the presenter's screen location (in pixels). More...
 
MxS32 GetX () const
 [AI] Returns the X coordinate of screen location. More...
 
MxS32 GetY () const
 [AI] Returns the Y coordinate of screen location. More...
 
MxS32 GetDisplayZ () const
 [AI] Returns the display Z (depth) order. More...
 
MxDSActionGetAction () const
 [AI] Returns the current action being presented. More...
 
void SetAction (MxDSAction *p_action)
 [AI] Sets the action associated with this presenter. More...
 
void SetCompositePresenter (MxCompositePresenter *p_compositePresenter)
 [AI] Sets the composite presenter to notify/join on completion. More...
 
void SetDisplayZ (MxS32 p_displayZ)
 [AI] Sets the display Z (depth) order for the presenter. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Static Public Member Functions

static const char * HandlerClassName ()
 [AI] Returns the handler class name ("MxCompositePresenter"). More...
 
- Static Public Member Functions inherited from MxPresenter
static const char * HandlerClassName ()
 [AI] Returns the handler class name for identification and reflection purposes. More...
 

Protected Attributes

MxCompositePresenterList m_list
 [AI] List of owned child presenters that are managed by this MxCompositePresenter. Actions are created/shutdown with this list. More...
 
- Protected Attributes inherited from MxPresenter
TickleState m_currentTickleState
 [AI] Current state in the tickle lifecycle. More...
 
MxU32 m_previousTickleStates
 [AI] Bitfield representing all tickle states that have already occurred during this lifetime. More...
 
MxPoint32 m_location
 [AI] 2D display location for the presenter. More...
 
MxS32 m_displayZ
 [AI] Z-order value for display stacking. More...
 
MxDSActionm_action
 [AI] The associated action currently being presented by this presenter. More...
 
MxCriticalSection m_criticalSection
 [AI] Thread synchronization for presenter state and data. More...
 
MxCompositePresenterm_compositePresenter
 [AI] Owner composite presenter, if any. More...
 

Additional Inherited Members

- Public Types inherited from MxPresenter
enum  TickleState {
  e_idle = 0 , e_ready , e_starting , e_streaming ,
  e_repeating , e_freezing , e_done
}
 [AI] Represents the state of the presenter's tickle (update) lifecycle. More...
 
- Protected Member Functions inherited from MxPresenter
virtual void DoneTickle ()
 [AI] Handles any post-completion logic, resetting to idle state. More...
 
virtual void ParseExtra ()
 [AI] Parses additional data from the associated action for configuration or world interaction. More...
 
void ProgressTickleState (TickleState p_tickleState)
 [AI] Helper for advancing the presenter's tickle state and updating transition history. More...
 
void Init ()
 [AI] Initializes object state to post-construction defaults. More...
 

Detailed Description

[AI] Composite presenter that manages a collection of child presenters, orchestrating their actions and notifications as a group.

[AI] MxCompositePresenter orchestrates a collection of presenters (typically corresponding to sub-actions in an SI file). It handles dispatching StartAction to each, managing their lifecycles, and relaying notifications such as action-completion, grouping parallel or serial media actions. Used for MxDSMultiAction and derived SI actions. Child presenters are pushed into m_list, and removed as they complete; when all are finished, composite cleanups and forwards notifications.

Definition at line 18 of file mxcompositepresenter.h.

Constructor & Destructor Documentation

◆ MxCompositePresenter()

MxCompositePresenter::MxCompositePresenter ( )

[AI] Default constructor; registers the composite presenter with the notification manager.

Definition at line 16 of file mxcompositepresenter.cpp.

◆ ~MxCompositePresenter()

MxCompositePresenter::~MxCompositePresenter ( )
override

[AI] Destructor, unregisters the presenter from the notification manager and properly cleans up contained presenters.

Definition at line 22 of file mxcompositepresenter.cpp.

Member Function Documentation

◆ ClassName()

const char * MxCompositePresenter::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the dynamic class name; used for runtime type identification.

Returns
[AI] Class name string for this type.

Reimplemented from MxCore.

Definition at line 41 of file mxcompositepresenter.h.

◆ Enable()

void MxCompositePresenter::Enable ( MxBool  p_enable)
overridevirtual

[AI] Enables or disables this presenter and all child presenters.

Parameters
p_enable[AI] TRUE to enable, FALSE to disable (pause).

Reimplemented from MxPresenter.

Definition at line 257 of file mxcompositepresenter.cpp.

◆ EndAction()

void MxCompositePresenter::EndAction ( )
overridevirtual

[AI] Ends the composite action, terminating all child presenters and clearing action lists. Sends end notifications if needed.

Reimplemented from MxPresenter.

Definition at line 83 of file mxcompositepresenter.cpp.

◆ GetList()

MxCompositePresenterList * MxCompositePresenter::GetList ( )
inline

[AI] Returns reference to the internal list of child presenters managed by this composite.

Returns
[AI] Pointer to the composite's presenter list (owned by this).

Definition at line 102 of file mxcompositepresenter.h.

◆ HandlerClassName()

static const char * MxCompositePresenter::HandlerClassName ( )
inlinestatic

[AI] Returns the handler class name ("MxCompositePresenter").

Returns
[AI] Static string identifier for this presenter. Used during SI media dispatch and factory creation.

Definition at line 33 of file mxcompositepresenter.h.

◆ HasTickleStatePassed()

MxBool MxCompositePresenter::HasTickleStatePassed ( TickleState  p_tickleState)
overridevirtual

[AI] Checks if all child presenters have advanced past the given tickle state.

Parameters
p_tickleState[AI] State to check against for all children.
Returns
[AI] TRUE if every child has passed this state, FALSE otherwise.

Reimplemented from MxPresenter.

Definition at line 268 of file mxcompositepresenter.cpp.

◆ IsA()

MxBool MxCompositePresenter::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Runtime type checking for presenter class hierarchy, supporting parent/child class checks.

Parameters
p_name[AI] The name to compare this class against.
Returns
[AI] True if p_name matches this class or any super class in presenter hierarchy.

Reimplemented from MxCore.

Definition at line 49 of file mxcompositepresenter.h.

◆ Notify()

MxLong MxCompositePresenter::Notify ( MxParam p_param)
overridevirtual

[AI] Notifies the composite presenter of a particular event (such as end of sub-action or notification from a child presenter).

Parameters
p_param[AI] Reference to a notification parameter, typically specifies sender, notification type, and any action involved.
Returns
[AI] Always returns 0. Dispatches to relevant virtual handlers based on the notification.

Reimplemented from MxCore.

Definition at line 113 of file mxcompositepresenter.cpp.

◆ SetTickleState()

void MxCompositePresenter::SetTickleState ( TickleState  p_tickleState)
overridevirtual

[AI] Change the tickle state of this composite presenter and propagate to each child.

Used for sequencing execution (e.g., idle, ready).

Parameters
p_tickleState[AI] New tickle state to set for all managed presenters.

Reimplemented from MxPresenter.

Definition at line 242 of file mxcompositepresenter.cpp.

◆ StartAction()

MxResult MxCompositePresenter::StartAction ( MxStreamController p_controller,
MxDSAction p_action 
)
overridevirtual

[AI] Starts a composite action by creating child presenters for each action in a MxDSMultiAction list and starting them.

Parameters
p_controller[AI] The controlling stream controller.
p_action[AI] The composite multi-action (should be or derive from MxDSMultiAction).
Returns
[AI] SUCCESS if all child presenters are created and started, FAILURE on error.

Reimplemented from MxPresenter.

Definition at line 29 of file mxcompositepresenter.cpp.

◆ VTable0x58()

void MxCompositePresenter::VTable0x58 ( MxEndActionNotificationParam p_param)
virtual

[AI] Handler for "end action" notification, invoked when one of the child presenters finishes its assigned sub-action.

[AI] Removes the corresponding presenter and action, cleans up, and may trigger continuation logic or end itself if all sub-actions done.

Parameters
p_param[AI] EndActionNotification containing sender and finished action information.

Definition at line 134 of file mxcompositepresenter.cpp.

◆ VTable0x5c()

void MxCompositePresenter::VTable0x5c ( MxNotificationParam p_param)
virtual

[AI] Handler for generic presenter notification, such as state change.

Also used for signaling further sequencing in serial actions.

Parameters
p_param[AI] Notification parameter with sender and type.

Definition at line 180 of file mxcompositepresenter.cpp.

◆ VTable0x60()

void MxCompositePresenter::VTable0x60 ( MxPresenter p_presenter)
virtual

[AI] Advance sequencing for serial multi-actions: promotes the next presenter in sequence to e_ready state after predecessor finishes.

Parameters
p_presenter[AI] The presenter that triggered the next-in-serial logic.

Reimplemented in LegoAnimMMPresenter, and LegoWorldPresenter.

Definition at line 221 of file mxcompositepresenter.cpp.

◆ VTable0x64()

virtual MxBool MxCompositePresenter::VTable0x64 ( undefined4  p_undefined)
inlinevirtual

[AI] Delegated state/mode checking.

If this presenter is part of another composite, defers the check to parent.

Parameters
p_undefined[AI] Value is opaque; passed along a potential hierarchy. [AI_SUGGESTED_NAME: stateCheckReason]
Returns
[AI] TRUE if allowable for tickle/check to proceed, otherwise composite-specific result.

Reimplemented in MxControlPresenter.

Definition at line 92 of file mxcompositepresenter.h.

Member Data Documentation

◆ m_list

MxCompositePresenterList MxCompositePresenter::m_list
protected

[AI] List of owned child presenters that are managed by this MxCompositePresenter. Actions are created/shutdown with this list.

Definition at line 106 of file mxcompositepresenter.h.


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