Mercurial > hg > Members > e085722 > Cerium
comparison include/Cerium/SceneGraphArray.h @ 0:04e28d8d3c6f
first commit
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 01:23:25 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:04e28d8d3c6f |
---|---|
1 #ifndef INCUDED_SCENE_GRAPH_ARRAY | |
2 #define INCUDED_SCENE_GRAPH_ARRAY | |
3 | |
4 #include "SceneGraph.h" | |
5 | |
6 // 下ですぐ #undef してます | |
7 #define MAX_SIZE 32 | |
8 | |
9 class SceneGraphArray { | |
10 public: | |
11 SceneGraph buf[MAX_SIZE]; | |
12 int size; | |
13 int pad[3]; | |
14 | |
15 SceneGraphArray(void) : size(0) {} | |
16 | |
17 /** | |
18 * array の初期化 | |
19 */ | |
20 void init(void) { | |
21 size = 0; | |
22 } | |
23 | |
24 /** | |
25 * buf から SceneGraph buffer を返す | |
26 * | |
27 * @retval SceneGraph if size < MAX_SIZE | |
28 * @retval NULL if size >= MAX_SIZE | |
29 */ | |
30 SceneGraphPtr getNext(void) { | |
31 if (size >= MAX_SIZE) { | |
32 return NULL; | |
33 } else { | |
34 return &buf[size++]; | |
35 } | |
36 } | |
37 }; | |
38 | |
39 typedef SceneGraphArray *SceneGraphArrayPtr; | |
40 | |
41 #undef MAX_SIZE | |
42 | |
43 #endif |