git-svn-id: svn://10.65.10.50/branches/R_10_00@23289 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			45 lines
		
	
	
		
			1021 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1021 B
		
	
	
	
		
			C++
		
	
	
	
	
	
///////////////////////////////////////////////////////////////////////////////
 | 
						|
// Name:        wx/stack.h
 | 
						|
// Purpose:     STL stack clone
 | 
						|
// Author:      Lindsay Mathieson
 | 
						|
// Modified by:
 | 
						|
// Created:     30.07.2001
 | 
						|
// Copyright:   (c) 2001 Lindsay Mathieson <lindsay@mathieson.org>
 | 
						|
// Licence:     wxWindows licence
 | 
						|
///////////////////////////////////////////////////////////////////////////////
 | 
						|
 | 
						|
#ifndef _WX_STACK_H_
 | 
						|
#define _WX_STACK_H_
 | 
						|
 | 
						|
#include "wx/vector.h"
 | 
						|
 | 
						|
#define WX_DECLARE_STACK(obj, cls)\
 | 
						|
class cls : public wxVectorBase\
 | 
						|
{\
 | 
						|
    WX_DECLARE_VECTORBASE(obj, cls);\
 | 
						|
public:\
 | 
						|
    void push(const obj& o)\
 | 
						|
    {\
 | 
						|
        bool rc = Alloc(size() + 1);\
 | 
						|
        wxASSERT(rc);\
 | 
						|
        Append(new obj(o));\
 | 
						|
    };\
 | 
						|
\
 | 
						|
    void pop()\
 | 
						|
    {\
 | 
						|
        RemoveAt(size() - 1);\
 | 
						|
    };\
 | 
						|
\
 | 
						|
    obj& top()\
 | 
						|
    {\
 | 
						|
        return *(obj *) GetItem(size() - 1);\
 | 
						|
    };\
 | 
						|
    const obj& top() const\
 | 
						|
    {\
 | 
						|
        return *(obj *) GetItem(size() - 1);\
 | 
						|
    };\
 | 
						|
}
 | 
						|
 | 
						|
#endif // _WX_STACK_H_
 | 
						|
 |