[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/cablegui/Prototype_pattern_exercise/master/Array.cpp [Back]  [Original]

// Array.cpp
//
// Array class. It uses an ArrayStructure for the actual storage.
// This class acts like a kind of adapter since it defines a common interface
// for different array structures like normal arrays and sparse arrays.
// The array structure to use is given as template argument.
//
// 29 januari 1999	RD	Started
// 2002-1-21 DD indexing starts at 1
// 2002-3-30 DD operator [] incorrectly implemented; corrected
// 2005-12-17 DD size_t --> I
//
// (C) Datasim Component Technology 1999-2006

#ifndef DSArray_cpp
#define DSArray_cpp

#include "Array.hpp"
#include 

// Constructors & destructor
template 
Array::Array()
{ // Default constructor

	m_structure=S();
	m_start=1;
}

template 
Array::Array(I size)
{ // Constructor with size. Start index=1.

	m_structure=S(size_t(size));
	m_start=1;
}

template 
Array::Array(I size, I start)
{ // Constructor with size & start index

	m_structure=S(size_t(size));
	m_start=start;
}

template 
Array::Array(I size, I start, const V& value)
{ // Constructor with size & start index

	m_structure=S(size_t(size));
	m_start=start;

	// Initialise array elements
	for (I i = MinIndex(); i 

Web Proxy Viewer  |  New URL  |  Original Page