Go to the documentation of this file.00001
00012
00013 #include <stdio.h>
00014
00015
00016 #include <vmath/Base.h>
00017 #include <vmath/Error.h>
00018 #include <vmath/errorlog.h>
00019 #include <vmath/memory.h>
00020
00021
00022
00023
00024 namespace GE {
00025
00026
00027 class Entity;
00028
00029
00037 template <class T>
00038 class EntityList {
00039
00040 public:
00041 inline EntityList ();
00042 inline ~EntityList ();
00043
00044 inline ERR_type Append_Entity (const T *entity);
00045
00046 public:
00047 T **entityList;
00048 Int32 numEntities;
00049 };
00050
00051
00059 template <class T>
00060 inline EntityList<T>::EntityList (): entityList (NULL), numEntities (0) {}
00061
00062
00063 template <class T>
00064 inline EntityList<T>::~EntityList ()
00079 {
00080 if (entityList)
00081 MEM_ArrayFree ((void**)&entityList);
00082 }
00083
00084
00085 template <class T>
00086 ERR_type EntityList<T>::Append_Entity (const T *entity)
00098 {
00099 if (!MEM_ArrayEntryAppend ((void**)&entityList, numEntities++,
00100 sizeof (Entity*), &entity))
00101 return (ERR_insufficient_memory);
00102
00103 return (ERR_no_errors);
00104 }
00105
00106
00107 }