Add infos into target window
[ryzomcore.git] / ryzom / server / src / frontend_service / prio_sub.h
bloba984913a70d0b62d73611abdff5f8d4fdb64276b
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef NL_PRIO_SUB_H
20 #define NL_PRIO_SUB_H
22 #include <nel/misc/types_nl.h>
23 #include "vision_array.h"
24 #include "vision_provider.h"
25 #include "distance_prioritizer.h"
27 #include <nel/misc/hierarchical_timer.h>
29 /**
30 * Priority Subsystem.
31 * You can call update for a whole cycle or call each task independantly
32 * (for example, to allow multithreading).
33 * One cycle consists of the following tasks:
34 * #1. processVision()
35 * #2. preparePairSelection()
36 * #3. calculatePriorities()
37 * #4. initDispatcherCycle()
39 * \author Olivier Cado
40 * \author Nevrax France
41 * \date 2002
43 class CPrioSub
45 public:
47 /// Constructor
48 CPrioSub();
50 /// Main initialization
51 void init( CHistory *h, CClientIdLookup *cl )
53 VisionProvider.init( &VisionArray, h, cl );
54 Prioritizer.init( &VisionArray, &VisionProvider, h );
57 /// Perform one cycle (PropDispatcher becomes ready for getNextParcel())
58 void update()
60 H_TIME(ProcessVision, processVision(););
61 H_TIME(calculatePriorities, calculatePriorities(););
64 /// Process Vision Differences
65 void processVision()
66 { VisionProvider.processVision(); }
68 /// Calculate the priorities corresponding to the selected pairs
69 void calculatePriorities()
70 { Prioritizer.calculatePriorities(); }
72 /// Unit testing (TEMP)
73 void testVisionProvider();
75 public:
77 /// Entities seen by the clients and the priorities of their properties
78 CVisionArray VisionArray;
80 /// Manager of the vision (who sees who)
81 CVisionProvider VisionProvider;
83 /// Priority calculation
84 CDistancePrioritizer Prioritizer;
86 private:
88 /// Counter for adjustHPThreshold
89 //uint32 _AHPTCounter;
94 #endif // NL_PRIO_SUB_H
96 /* End of prio_sub.h */