00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef _ZFXMATH_INCLUDE_MULTIPLYSTACK_H_
00012
#define _ZFXMATH_INCLUDE_MULTIPLYSTACK_H_
00013
00014
#include <stack>
00015
00016
namespace ZFXMath
00017 {
00031
template<
class T>
00032 class TMultiplyStack :
public std::stack<T>
00033 {
00034
public:
00040 inline void PushTop()
00041 {
00042
if(!empty()) push(top());
00043 }
00044
00050 inline void PushMultiply(
const T& val)
00051 {
00052
if(!empty()) push(top()*val);
00053
else push(val);
00054 }
00055
00061 inline void Multiply(
const T& val)
00062 {
00063
if(!empty()) top() *= val;
00064
else push(val);
00065 }
00066 };
00067 }
00068
00069
#endif //_ZFXMATH_INCLUDE_MULTIPLYSTACK_H__