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
set1.hh
Package: SwordOnline.rar [view]
Upload User: dzyhzl
Upload Date: 2019-04-29
Package Size: 56270k
Code Size: 2k
Category:
Game Server Simulator
Development Platform:
C/C++
- #ifndef __set1_hh__
- #define __set1_hh__
- #include <set>
- #include <vector>
- #include <iostream>
- using namespace std ;
- #include "define_short.h"
- #include "coldata1.hh"
- template <class T, class value_type = /*typename*/ T::value_type>
- class MysqlListInsert {
- private:
- T *object;
- public:
- MysqlListInsert(T *o) {object = o;}
- void operator () (const value_type &data) {object->push_back(data);}
- };
- template <class T, class key_type = /*typename*/ T::key_type>
- class MysqlSetInsert {
- private:
- T *object;
- public:
- MysqlSetInsert(T *o) {object = o;}
- void operator () (const key_type &data) {object->insert(data);}
- };
- template <class T>
- inline MysqlSetInsert<set<T> > set_insert(set<T> *o) {
- return MysqlSetInsert<set<T> >(o);
- }
- template <class T>
- inline MysqlListInsert<vector<T> > set_insert(vector<T> *o) {
- return MysqlListInsert<vector<T> >(o);
- }
- template <class Insert>
- void set2container (const char *str, Insert insert);
- //: A Special Set for holding mysql sets.
- template <class Container = set<string> >
- class Set : public Container {
- public:
- Set(const char* str) {set2container(str,set_insert(this));} //:
- Set(const string &str) {set2container(str.c_str(),set_insert(this));} //:
- Set(const ColData &str)
- {set2container(str.c_str(),set_insert(this));} //:
- ostream& out_stream(ostream &s) const;
- operator string ();
- };
- //! with_class = Set
- //:
- template <class Container>
- inline ostream& operator << (ostream &s, const Set<Container> &d)
- {
- return d.out_stream(s);
- }
- #endif