52 lines
954 B
C++
52 lines
954 B
C++
#ifndef _VECTOR_HPP_
|
|
#define _VECTOR_HPP_
|
|
#include <dos.h>
|
|
#include <assert.h>
|
|
#include <memory.h>
|
|
#include <mdiwin/windows.hpp>
|
|
#include <mdiwin/types.hpp>
|
|
#include <mdiwin/block.hpp>
|
|
|
|
#ifndef HUGE
|
|
#ifdef __FLAT__
|
|
#define HUGE FAR
|
|
#else
|
|
#define HUGE huge
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef _EXPAND_VECTOR_TEMPLATES_
|
|
//#pragma option -Jgd
|
|
#endif
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma warning(disable:4291)
|
|
#endif
|
|
|
|
void FAR *operator new(size_t size,int n,void FAR*lpData);
|
|
|
|
template <class T>
|
|
class Vector
|
|
{
|
|
public:
|
|
Vector(void);
|
|
virtual ~Vector();
|
|
LONG size(LONG newSize);
|
|
LONG size(void)const;
|
|
T &operator[](LONG itemIndex);
|
|
WORD operator=(Block<T> &someBlock);
|
|
WORD operator==(const Vector<T> &someVector)const;
|
|
WORD operator=(const Vector<T> &someVector);
|
|
// operator T*();
|
|
private:
|
|
typedef LONG Index;
|
|
void vectorNew(void);
|
|
void vectorDelete(void);
|
|
|
|
LONG mEntries;
|
|
T HUGE * HUGE *mlpVectorTable;
|
|
T HUGE *mlpMemPool;
|
|
};
|
|
#include <mdiwin/vector.tpp>
|
|
#endif
|