24BEGIN_MOOTOOLS_NAMESPACE
27 template <
class Etype>
28 class CQueue :
public AbsQueue<Etype>
32 ~CQueue( ) { xDeleteArray(Array, MaxSize); }
36 void Enqueue(
const Etype & X );
38 const Etype & GetFront( )
const;
39 int IsEmpty( )
const {
return CurrentSize == 0; }
40 int GetSize( )
const {
return CurrentSize; }
41 int IsFull( )
const {
return 0; }
53 void Increment(
int & X )
const;
59 template <
class Etype>
67 template <
class Etype>
69 CurrentSize( 0 ), Front( 0 ), Back( -1 )
71 Array = xNewArray(
Etype , MaxSize);
74 template <
class Etype>
81 xDeleteArray(Array, MaxSize);
82 Array = xNewArray(
Etype,
Rhs.MaxSize);
84 CurrentSize =
Rhs.CurrentSize;
85 MaxSize =
Rhs.MaxSize;
87 Back = CurrentSize - 1;
89 for(
int i = 0,
j =
Rhs.Front;
i < CurrentSize;
i++, Increment(
j ) )
90 Array[
i ] =
Rhs.Array[
j ];
95 template <
class Etype>
105 for(
int i = 0,
j = Front;
i < CurrentSize;
i++, Increment(
j ) )
106 Array[
i ] =
Old[
j ];
109 Back = CurrentSize - 1;
115 template <
class Etype>
119 if( CurrentSize == MaxSize )
127 template <
class Etype>
135 template <
class Etype>
139 return Array[ Front ];
142 template <
class Etype>
151END_MOOTOOLS_NAMESPACE
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27