#define BACK_STACK_H
#include <stack>
-using std::stack;
#include "LString.h"
-// Created by Alejandro Aguilar Sierra, 970806
-
/** Utility to get back from a reference or from a child document.
+ @author Alejandro Aguilar Sierra
+ @version 970806
*/
class BackStack {
private:
///
struct BackStackItem {
///
+ BackStackItem()
+ : x(0), y(0) {}
+ ///
BackStackItem(string const & f, int xx, int yy)
: fname(f), x(xx), y(yy) {}
/// Filename
stakk.push(bit);
}
///
- string pop(int * x, int * y) {
+ string const pop(int * x, int * y) {
BackStackItem bit = stakk.top();
*x = bit.x;
*y = bit.y;
stakk.pop();
return bit.fname;
}
- ///
+ /**
+ @return returns #true# if the stack is empty, #false# otherwise.
+ */
bool empty() const {
return stakk.empty();
}
private:
///
- stack<BackStackItem> stakk;
+ std::stack<BackStackItem> stakk;
};
#endif