#ifndef MXBLOCK_INCLUDED // -*- C++ -*- #define MXBLOCK_INCLUDED #if !defined(__GNUC__) # pragma once #endif /************************************************************************ MxBlock provides typed access a contiguous block of elements. Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details. $Id: MxBlock.h,v 1.1 2002/09/24 16:53:54 wimmer Exp $ ************************************************************************/ #include "stdmix.h" template class MxBlock : public MxEQ { private: uint N; T *block; protected: MxBlock() { } void init_block(uint n) { // Allocate memory for block N=n; block = (T *)malloc(sizeof(T)*n); // Initialize each entry for(uint i=0; i~T(); } free(block); #else // Call the relevant destructors for each element before // freeing the block. Has now effect for types like 'int'. // for(uint i=0; i& b) { bitcopy(b, b.length()); } void copy(const MxBlock& b) { copy(b, b.length()); } }; // MXBLOCK_INCLUDED #endif