MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Macros | Typedefs | Functions
mh5group.c File Reference

Implementation of the Group class Description Defines the structure and behaviour of objects used as composition of Ingredients. Base class Root Subclasses Scene, Application Status Abstract class. More...

#include <string.h>
#include "mh5profile.h"
#include "mh5group.h"
#include "mh5object.h"
#include "mh5classes.h"
#include "mh5queue.h"
#include "mh5memory.h"
#include "mh5display.h"
#include "mh5debug.h"
#include "stb_os.h"
#include "glue_queue.h"
#include "glue_timers.h"
#include "glue_main.h"

Macros

#define MAX_TIMERS   24
 
#define GROUP_CP_DEFAULT   127
 
#define ZERO_TIMER_HDL   ((void*)0x2EA02EA0)
 

Typedefs

typedef struct _GroupTimer GroupTimer
 

Functions

void MH5_GroupInit (void)
 This function initialises Group Timers. More...
 
void MHEG5groupAddItem (MHEG5Group *group, MHEG5Ingredient *item)
 Add an Item to the List. More...
 
void MHEG5groupDelItem (MHEG5Group *group, MHEG5Ingredient *item)
 Delete Item from the List. More...
 
void MHEG5groupInit (MHEG5Group *group)
 Initialise an Group object with default Values. More...
 
void MHEG5groupFree (MHEG5Group *group)
 Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed. More...
 
void MHEG5groupPrepare (MHEG5Group *group)
 Implementation of the Preparation behaviour Preparation. More...
 
void MHEG5groupDestruct (MHEG5Group *group)
 Implementation of the Destruction behaviour Destruction. More...
 
void MHEG5groupActivate (MHEG5Group *group)
 Implementation of the Activation behaviour Activation. More...
 
void MHEG5groupDeactivate (MHEG5Group *group)
 Implementation of the Deactivation behaviour Deactivation If group is not active, ignore behaviour. If group is active, do the following three steps: More...
 
MHEG5ErrorCode MHEG5setCachePriority (MHEG5Root *target, MHEG5GList *params)
 Implementation of the SetCachePriority action SetCachePriority (NewCachePriority) Set the GroupCachePriority attribute to NewCachePriority. Provisions of use: The Target object shall be available. NewCachePriority shall be set within the range [0, 255]. SetCachePriority –> Target, NewCachePriority Target –> GenericObjectReference NewCachePriority –> GenericInteger. More...
 
MHEG5ErrorCode MHEG5setTimer (MHEG5Root *target, MHEG5GList *params)
 This actions sets a new Timer which results in a TimerFired event when the given time is reached. Implementation of the SetTimer (TimerId, TimerValue, AbsoluteTime) action of the group class SetTimer (TimerId, TimerValue, AbsoluteTime) Update the list of timers of the group. Execute the following sequence of actions: More...
 

Detailed Description

Implementation of the Group class Description Defines the structure and behaviour of objects used as composition of Ingredients. Base class Root Subclasses Scene, Application Status Abstract class.

Date
01/02/2002
Author
R.Freeman

Function Documentation

void MH5_GroupInit ( void  )

This function initialises Group Timers.

Returns
None
void MHEG5groupActivate ( MHEG5Group group)

Implementation of the Activation behaviour Activation.

  1. Apply the Activation behaviour as inherited from the base class.
  2. Run the action contained in the OnStartUp attribute.
  3. Apply the Activation behaviour to all Ingredients of the Group that have the InitiallyActive attribute set to True, in the order they are listed in the Items attribute.
  4. Set the RunningStatus attribute of the Group object to True.
  5. Generate an IsRunning event.
    Parameters
    groupGroup to activate
    Returns
    void

MHEG5PROFILE_UK1_06

void MHEG5groupAddItem ( MHEG5Group group,
MHEG5Ingredient item 
)

Add an Item to the List.

Parameters
groupGroup to add item to
itemItem to add
Returns
void
void MHEG5groupDeactivate ( MHEG5Group group)

Implementation of the Deactivation behaviour Deactivation If group is not active, ignore behaviour. If group is active, do the following three steps:

  1. Run the action contained in the OnCloseDown attribute.
  2. Apply the Deactivation behaviour to all active Ingredients of the Group, in the reverse order they are listed in the Items attribute.
  3. Apply the Deactivation behaviour as inherited from the base class.
    Parameters
    groupGroup to deactivate
    Returns
    void

MHEG5PROFILE_UK1_06

void MHEG5groupDelItem ( MHEG5Group group,
MHEG5Ingredient item 
)

Delete Item from the List.

Parameters
groupGroup to delete item from
itemItem to delete
Returns
void
void MHEG5groupDestruct ( MHEG5Group group)

Implementation of the Destruction behaviour Destruction.

  1. Apply the Destruction behaviour to all Ingredients of the Group in the reverse order that they are listed in the Items attribute.
  2. Apply the Destruction behaviour as inherited from the base class.
    Parameters
    groupGroup to destruct
    Returns
    void

MHEG5PROFILE_UK1_06

void MHEG5groupFree ( MHEG5Group group)

Free off all memory associated with the specified object, including any exchanged attributes and internal data. The data holding the object itself is not freed.

Parameters
groupPointer to object to free.
Returns
Void
void MHEG5groupInit ( MHEG5Group group)

Initialise an Group object with default Values.

Parameters
groupPointer to a group object to initialise
Returns
void
void MHEG5groupPrepare ( MHEG5Group group)

Implementation of the Preparation behaviour Preparation.

  1. Apply the Preparation behaviour to all Ingredients of the Group that have the InitiallyActive attribute set to True and to all Programs of the Group that have the InitiallyAvailable attribute set to True in the order that they are listed in the Items attribute.
  2. Apply the Preparation behaviour as inherited from the base class.
    Parameters
    groupGroup to apply behaviour to
    Returns
    void

MHEG5PROFILE_UK1_06

MHEG5ErrorCode MHEG5setCachePriority ( MHEG5Root target,
MHEG5GList params 
)

Implementation of the SetCachePriority action SetCachePriority (NewCachePriority) Set the GroupCachePriority attribute to NewCachePriority. Provisions of use: The Target object shall be available. NewCachePriority shall be set within the range [0, 255]. SetCachePriority –> Target, NewCachePriority Target –> GenericObjectReference NewCachePriority –> GenericInteger.

Parameters
targettarget object for this action
paramsAction parameters
Returns
MHEG5ErrorCode - See mh5base.h
MHEG5ErrorCode MHEG5setTimer ( MHEG5Root target,
MHEG5GList params 
)

This actions sets a new Timer which results in a TimerFired event when the given time is reached. Implementation of the SetTimer (TimerId, TimerValue, AbsoluteTime) action of the group class SetTimer (TimerId, TimerValue, AbsoluteTime) Update the list of timers of the group. Execute the following sequence of actions:

  1. Update the Timers internal attribute of the group, according to the following rules: a) If TimerId is the identifier of an existing Timer in the Group, the new TimerValue, replaces the previous one. The parameter AbsoluteTime is ignored, in other words an absolute Timer cannot be replaced by a Timer relative to the Group. b) If there is no Timer with identifier TimerId in the Group, insert a new Timer with identifier TimerId and values TimerValue and AbsoluteTime in the Group. If AbsoluteTime is not encoded, it is set to False by default. c) If TimerValue is not encoded and there is a Timer with identifier TimerId in the Group, remove this Timer from the Timers list. d) If TimerValue is not encoded and there is no Timer with identifier TimerId in the Timers list, discard this action.
  2. The active Group shall receive TimerFired events according to the new value of the Timers list. If AbsoluteTime is set to True, the TimerValue parameter of this action shall be interpreted as a time offset from the time when the Group is active. Otherwise, the TimerValue parameter of this action shall be interpreted as a time offset from the time when the action is invoked. In both cases, it is measured in milliseconds. If the TimerValue parameter is zero and AbsoluteTime is False, the Timer shall be fired immediately. Removing or changing a Timer does not suppress pending events from the former Timer. COR.1: If the time indicated in TimerValue has already passed and the AbsoluteTime is set to True, the TimerFired event shall not be raised.
    Parameters
    targettarget object for this action
    paramsFunction parameter
    Returns
    MHEG5ErrorCode