Guiliani  Version 2.5 revision 7293 (documentation build 13)
GUICommandHandler.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUICOMMANDHANDLER__H_
11#define GUICOMMANDHANDLER__H_
12
13#include "eC_Types.h"
14#include "eC_TList_doubleLinked.h"
15#include "eC_Semaphore.h"
16#include "GUICommand.h"
17
18#include "GUIComponentManager.h"
19
97#define GETCMDHDL CGUIComponentManager::GetInstance().GetCommandHandler()
98
100
109{
110 friend class CGUI;
111 friend class CGUICommand;
112 friend class CGUIComponentManager;
113
114public:
117 static void CreateInstance();
118
121 static void DeleteInstance();
122
127 eC_UInt GetIdleTime();
128
145 eC_Bool Execute(CGUICommandPtr pkCommand);
146
162 inline void SetMaxWorkingCmds(const eC_UInt &uiMaxNoOfWorkingCmds)
163 {
164 m_uiMaxNoOfWorkingCommands = uiMaxNoOfWorkingCmds;
165 }
166
171 void DumpQueues() const;
172
177
182
188
189private:
197 void InsertCommand(CGUICommandPtr pkCommand);
198
204 void SetTimeUntilNextExecution(CGUICommand* pkCommand, eC_UInt uiTime);
205
210 void SetPriority(CGUICommand* pkCommand, eC_UInt uiPriority);
211
219 void SortQueuesAndMoveCommands();
220
226 void Process();
227
231
234
238
241 CGUICommandHandler& operator=(const CGUICommandHandler& kSource);
242
244 void Init();
245
247 void DeInit();
248
249private:
251 eC_UInt m_uiMaxNoOfWorkingCommands;
253 CommandPtrList m_WaitingQueue;
255 CommandPtrList m_WorkingQueue;
257 eC_UInt m_uiTime;
260 eC_Semaphore m_kQueueSemaphore;
262 eC_Bool m_bQueueIsDirty;
263};
264#endif
Manages and executes instances of CGUICommand.
Definition: GUICommandHandler.h:109
void DumpQueues() const
eC_Bool Execute(CGUICommandPtr pkCommand)
eC_UInt GetIdleTime()
void SetMaxWorkingCmds(const eC_UInt &uiMaxNoOfWorkingCmds)
Definition: GUICommandHandler.h:162
static void CreateInstance()
static void DeleteInstance()
void RemoveCommand(CGUICommandPtr pkCommand)
eC_Bool IsCommandInQueue(CGUICommandPtr pkCommand)
Command object base class.
Definition: GUICommand.h:127
central component-manager
Definition: GUIComponentManager.h:62
GUI base class for any Guiliani application.
Definition: GUI.h:47