MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
mh5tokenmanager.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
34 #ifndef _MH5TOKENMANAGER_H
35 #define _MH5TOKENMANAGER_H
36 
37 /*---includes for this file--------------------------------------------------*/
38 
39 #include "mh5base.h"
40 #include "mh5root.h"
41 
42 /*---Constant and macro definitions for public use---------------------------*/
43 
44 /*---Enumerations for public use---------------------------------------------*/
45 
46 /*---Global type defs for public use-----------------------------------------*/
47 
48 typedef struct sMHEG5IntList
49 {
50  MHEG5Int number;
51  struct sMHEG5IntList *next;
52 } MHEG5IntList;
53 
54 typedef struct sMHEG5MovementTable
55 {
56  MHEG5IntList *row;
57  struct sMHEG5MovementTable *next;
59 
60 typedef struct
61 {
62  /* No base class for this class (mix-in) */
63 
64  /* Exchanged attributes */
65  MHEG5MovementTable *movementTable;
66 
67  /* Internal attributes */
68  MHEG5Int tokenPosition;
70 
71 /*---Global variable declarations for public use-----------------------------*/
72 
73 /*---Global Function prototypes for public use-------------------------------*/
74 
80 /*
81  Debug
82  */
83 #ifdef MH5PRINTOUT
84 
90 void MHEG5tokenManagerPrint(MHEG5TokenManager *tokenManager, char *out);
91 
98 void MHEG5intListPrint(MHEG5IntList *intList, char *out);
99 
106 void MHEG5movementTablePrint(MHEG5MovementTable *movementTable, char *out);
107 
108 
109 #endif /* MH5PRINTOUT */
110 
111 
112 /*
113  Constructor
114  */
120 void MHEG5tokenManagerInit(MHEG5TokenManager *tokenManager);
121 
122 
129 void MHEG5tokenManagerPrepare(MHEG5TokenManager *tokenManager);
130 
131 
139 void MHEG5tokenManagerFree(MHEG5TokenManager *tokenManager);
140 
141 
142 void MHEG5tokenManagerAddRow(MHEG5TokenManager *tokenManager);
143 void MHEG5tokenManagerAddNumber(MHEG5TokenManager *tokenManager, MHEG5Int number);
144 
145 /*
146  Copy Constructor
147  */
148 void MHEG5tokenManagerCopy(MHEG5TokenManager *destination, MHEG5TokenManager *source);
149 
150 /*
151  Internal behaviours
152  */
153 void MHEG5tokenManagerPrepare(MHEG5TokenManager *tokenManager);
154 void MHEG5tokenManagerDestruct(MHEG5TokenManager *tokenManager);
155 
156 /*
157  Actions
158  */
159 MHEG5ErrorCode MHEG5move(MHEG5Root *target, MHEG5GList *params);
160 MHEG5ErrorCode MHEG5moveTo(MHEG5Root *target, MHEG5GList *params);
161 MHEG5ErrorCode MHEG5getTokenPosition(MHEG5Root *target, MHEG5GList *params);
162 
163 #endif /*_MH5TOKENMANAGER_H*/
void MHEG5tokenManagerDestruct(MHEG5TokenManager *tokenManager)
Destruct a TokenManager object.
Definition: mh5tokenmanager.c:310
Basis MHEG5 data types.
void MHEG5tokenManagerFree(MHEG5TokenManager *tokenManager)
Free off all memory associated with the specified object, including any exchanged attributes and inte...
Definition: mh5tokenmanager.c:154
MHEG5ErrorCode MHEG5move(MHEG5Root *target, MHEG5GList *params)
Move the token between elements of the group. The movement to apply from any particular element locat...
Definition: mh5tokenmanager.c:383
void MHEG5tokenManagerAddRow(MHEG5TokenManager *tokenManager)
Add a new row to a TokenManager.
Definition: mh5tokenmanager.c:183
Definition: mh5tokenmanager.h:60
void MHEG5tokenManagerInit(MHEG5TokenManager *tokenManager)
<Function description>="">
Definition: mh5tokenmanager.c:127
Definition: mh5tokenmanager.h:54
void MHEG5tokenManagerAddNumber(MHEG5TokenManager *tokenManager, MHEG5Int number)
Insert a number into the last element of the movement table.
Definition: mh5tokenmanager.c:214
void MHEG5tokenManagerPrepare(MHEG5TokenManager *tokenManager)
Sets all internal attributes for the specified object to their default values.
Definition: mh5tokenmanager.c:140
Implementation of Root class Description Root class of all MHEG-5 classes. Base class None Subclasses...
Definition: mh5base.h:169
MHEG5ErrorCode MHEG5moveTo(MHEG5Root *target, MHEG5GList *params)
Move the token to a specific element of the group. Implementation of the MoveTo (Target, Index) action of the TokenManager class.
Definition: mh5tokenmanager.c:451
void MHEG5tokenManagerCopy(MHEG5TokenManager *destination, MHEG5TokenManager *source)
Copy a TokenManager object. The movement table of the TokenManager object is copied as well...
Definition: mh5tokenmanager.c:293
Definition: mh5tokenmanager.h:48
Definition: mh5root.h:43
MHEG5ErrorCode MHEG5getTokenPosition(MHEG5Root *target, MHEG5GList *params)
Set the Variable referenced by TokenPositionVar to the value of the TokenPosition attribute...
Definition: mh5tokenmanager.c:487