/* ------------------------------------------------------------------------- // WINX: a C++ template GUI library - MOST SIMPLE BUT EFFECTIVE // // This file is a part of the WINX Library. // The use and distribution terms for this software are covered by the // Common Public License 1.0 (http://opensource.org/licenses/cpl.php) // which can be found in the file CPL.txt at this distribution. By using // this software in any fashion, you are agreeing to be bound by the terms // of this license. You must not remove this notice, or any other, from // this software. // // Module: tpl/ext/Calculator.h // Creator: xushiwei // Email: xushiweizh@gmail.com // Date: 2006-8-13 9:41:58 // // $Id$ // -----------------------------------------------------------------------*/ #ifndef TPL_EXT_CALCULATOR_H #define TPL_EXT_CALCULATOR_H #ifndef TPL_REGEXP_H #include "../RegExp.h" #endif #ifndef TPL_EMU_FUNCTION_H #include "../emu/Function.h" #endif #if !defined(_FUNCTIONAL_) && !defined(_FUNCTIONAL) #include #endif NS_TPL_BEGIN // ========================================================================= // class Function template class Function : public emu::Function { private: typedef emu::Function Base; StackT& m_stk; public: Function(StackT& stk) : m_stk(stk), Base() {} template Function(StackT& stk, const T1& arg) : m_stk(stk), Base(arg) {} public: void TPL_CALL operator()() const { Base::operator()(m_stk); } }; // ------------------------------------------------------------------------- // function calc/1-ary template