home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_03
/
8n03114b
< prev
next >
Wrap
Text File
|
1990-03-20
|
1KB
|
32 lines
*****Listing 5*****
// INTLIST.HPP - list of integers - derived from LIST
#ifndef _INTLIST_HPP
#define _INTLIST_HPP
#include "list.hpp"
class INTLIST : LIST // a LIST of integers...
{
unsigned int curr_size;
public:
INTLIST(void) {curr_size = 0;}
int get_head(void) {return *((int*)LIST::get_head(curr_size));}
int get_curr(void) {return *((int*)LIST::get_curr(curr_size));}
int get_tail(void) {return *((int*)LIST::get_tail(curr_size));}
int get_prev(void) {return *((int*)LIST::get_prev(curr_size));}
int get_next(void) {return *((int*)LIST::get_next(curr_size));}
void add_before(int i) {LIST::add_before(&i, sizeof(int));}
void add_after(int i) {LIST::add_after(&i, sizeof(int));}
void add_head(int i) {LIST::add_head(&i, sizeof(int));}
void add_tail(int i) {LIST::add_tail(&i, sizeof(int));}
void delete_curr(void) {LIST::delete_curr();}
unsigned int get_curr_size(void)
{return curr_size;}
void copy_data(struct listelem *lptr, void *from)
{*((int*)lptr->data) = *((int*)from);}
};
#endif // _INTLIST_HPP