home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ User's Journal & Wi…eveloper's Journal Tools
/
C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso
/
windbase
/
memslcpp.3
/
table1.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-11
|
4KB
|
98 lines
/***************************************************************************\
** **
** WW WW IIIIIIII NNN NN DDDDDDD BBBBBBB AA SSSSSS EEEEEEEE **
** WW W WW II NNNN NN DD DD BB BB AA AA SS EE **
** WW W WW II NN NN NN DD DD BBBBBBB AAAAAAAA SSSSSS EEEEEE **
** WW W WW II NN NNNN DD DD BB BB AA AA SS EE **
** WWWWW IIIIIIII NN NNN DDDDDDD BBBBBBB AA AA SSSSSS EEEEEEEE **
** **
** SSSSSS OOOOOO FFFFFFFF TTTTTTTT WW WW AA RRRRRRR EEEEEEEE **
** SS OO OO FF TT WW W WW AA AA RR RR EE **
** SSSSS OO OO FFFFF TT WW W WW AAAAAAAA RRRRRRR EEEEEE **
** SS OO OO FF TT WW W WW AA AA RR RR EE **
** SSSSSS OOOOOO FF TT WWWWW AA AA RR RR EEEEEEEE **
** **
********** NOTICE ***********************************************************
** This file contains valuable trade secrets and proprietary **
** assets of Windbase Software Inc. Embodying substantial **
** creative efforts and confidential information. Unauthorized **
** use, copying, decompiling, translating, disclosure or **
** transfer, of any kind, is strictly prohibited. **
** **
** COPYRIGHT (C) 1992, 1993, 1994, 1995. Windbase Software Inc. **
** ALL RIGHTS RESERVED. **
\***************************************************************************/
/*
** Table - Templates Version
*/
template <class USRDEF>
class MyTable : public WBTable<USRDEF>
{
int WBCompareFunct(void *nullitem, USRDEF item1, USRDEF item2)
{
nullitem = nullitem;
return(strcmp(item1, item2));
}
void WBExecuteFunct(void *nullitem, USRDEF item)
{
nullitem = nullitem;
cout << "Execute: " << item << "\n";
}
void WBDeleteFunct(void *nullitem, USRDEF item)
{
nullitem = nullitem;
cout << "Delete: " << item << "\n";
}
};
main()
{
MyTable<char *> table;
table += "Item0";
table += "Item1";
table += "Item2";
table += "Item3";
table += "Item4";
table += "Item5";
table += "Item6";
table += "Item7";
table += "Item8";
table += "Item9";
cout << "NumItems(): " << table.NumItems() << "\n";
table.Execute();
cout << "IsMember: " << table.IsMember("Item0") << "\n";
cout << "IsMember: " << table.IsMember("Item1") << "\n";
cout << "IsMember: " << table.IsMember("Item2") << "\n";
cout << "IsMember: " << table.IsMember("Item3") << "\n";
cout << "IsMember: " << table.IsMember("Item4") << "\n";
cout << "IsMember: " << table.IsMember("Item5") << "\n";
cout << "IsMember: " << table.IsMember("Item6") << "\n";
cout << "IsMember: " << table.IsMember("Item7") << "\n";
cout << "IsMember: " << table.IsMember("Item8") << "\n";
cout << "IsMember: " << table.IsMember("Item9") << "\n";
table -= "Item0";
table -= "Item1";
table -= "Item2";
table -= "Item3";
table -= "Item4";
cout << "NumItems(): " << table.NumItems() << "\n";
table.Execute();
table.Clear();
cout << "NumItems(): " << table.NumItems() << "\n";
table.Execute();
return(0);
}