Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ICommand.h
Package: SwordOnline.rar [view]
Upload User: dzyhzl
Upload Date: 2019-04-29
Package Size: 56270k
Code Size: 1k
Category:
Game Server Simulator
Development Platform:
C/C++
- /********************************************************************
- created: 2003/04/08
- file base: ICommand
- file ext: h
- author: liupeng
- purpose:
- *********************************************************************/
- #ifndef __INCLUDE_ICOMMAND_H__
- #define __INCLUDE_ICOMMAND_H__
- #include "Macro.h"
- /*
- * Interface class for execute command
- */
- class ICommand
- {
- public:
- virtual UINT Execute() = 0;
- virtual ~ICommand(){};
- };
- /*
- * template classs
- */
- template <class Receive>
- class CTaskCommand : public ICommand
- {
- public:
- typedef UINT ( Receive::* Action )();
- explicit CTaskCommand( Receive *pReceiver, Action pfunAction );
- virtual ~CTaskCommand();
- virtual UINT Execute();
- protected:
- CTaskCommand();
- /*
- * This function pointer is used to execute command
- */
- Action m_pfunAction;
- /*
- * The receiver class
- */
- Receive *m_pReceiver;
- /*
- * Store a faild value for return it to user when this class was found error
- */
- };
- template <class Receive>
- CTaskCommand<Receive>::CTaskCommand( Receive *pReceiver, Action pfunAction )
- : m_pReceiver( pReceiver ),
- m_pfunAction( pfunAction )
- {
- }
- template <class Receive>
- CTaskCommand<Receive>::CTaskCommand()
- {
- ASSERT( FALSE );
- }
- template <class Receive>
- CTaskCommand<Receive>::~CTaskCommand()
- {
- }
- template <class Receive>
- UINT CTaskCommand<Receive>::Execute()
- {
- return ( m_pReceiver->*m_pfunAction )();
- }
- #endif // __INCLUDE_ICOMMAND_H__