Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
AbsStack.h
Go to the documentation of this file.
1//! @file AbsStack.h
2//! @brief Pure virtual base class for stacking data
3//!
4/////////////////////////////////////////////////////////////////
5#ifndef __ABSSTACK_H
6#define __ABSSTACK_H
7
8BEGIN_MOOTOOLS_NAMESPACE
9
10// Stack abstract class interface
11//
12// Etype: must have zero-parameter constructor;
13// implementation will require either
14// operator= or copy constructor, perhaps both
15// CONSTRUCTION: with (a) no initializer;
16// copy construction of Stack objects is DISALLOWED
17//
18// ******************PUBLIC OPERATIONS*********************
19// All of the following are pure virtual functions
20// void Push( Etype X ) --> Insert X
21// void Pop( ) --> Remove most recently inserted item
22// Etype Top( ) --> Return most recently inserted item
23// int IsEmpty( ) --> Return 1 if empty; else return 0
24// int IsFull( ) --> Return 1 if full; else return 0
25// void MakeEmpty( ) --> Remove all items
26// ******************ERRORS********************************
27// Top or Pop on empty stack
28
29template <class Etype>
30class AbsStack
31{
32 public:
33 AbsStack( ) { } // Default constructor
34 virtual ~AbsStack( ) { } // Destructor
35
36 virtual void Push( const Etype & X ) = 0; // Insert
37 virtual void Pop( ) = 0; // Remove
38 virtual void Pop( Etype & X ) = 0; // Remove
39 virtual Etype & Top( ) const = 0; // Find
40 virtual int IsEmpty( ) const = 0;
41 virtual int IsFull( ) const = 0;
42 virtual void MakeEmpty( ) = 0;
43 private:
44 AbsStack( const AbsStack & ) { }
45};
46
47END_MOOTOOLS_NAMESPACE
48
49#endif // __ABSSTACK_H
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27