From 66bbf336c6af7353ef0aeed58002c46543b30635 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 2 Jan 2007 19:19:48 +0000 Subject: (svn r7759) -Merge: makefile rewrite. This merge features: - A proper ./configure, so everything needs to be configured only once, not for every make. - Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies. - A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC. - Proper support for OSX universal binaries. - Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files. - Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files. Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy. --- yapf/array.hpp | 71 ---------------------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 yapf/array.hpp (limited to 'yapf/array.hpp') diff --git a/yapf/array.hpp b/yapf/array.hpp deleted file mode 100644 index e8eff1c8c..000000000 --- a/yapf/array.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* $Id$ */ - -#ifndef ARRAY_HPP -#define ARRAY_HPP - -#include "fixedsizearray.hpp" - -/** Flexible array with size limit. Implemented as fixed size - * array of fixed size arrays */ -template -class CArrayT { -public: - typedef Titem_ Titem; ///< Titem is now visible from outside - typedef CFixedSizeArrayT CSubArray; ///< inner array - typedef CFixedSizeArrayT CSuperArray; ///< outer array - -protected: - CSuperArray m_a; ///< array of arrays of items - -public: - static const int Tblock_size = Tblock_size_; ///< block size is now visible from outside - static const int Tnum_blocks = Tnum_blocks_; ///< number of blocks is now visible from outside - static const int Tcapacity = Tblock_size * Tnum_blocks; ///< total max number of items - - /** implicit constructor */ - FORCEINLINE CArrayT() { } - /** Clear (destroy) all items */ - FORCEINLINE void Clear() {m_a.Clear();} - /** Return actual number of items */ - FORCEINLINE int Size() const - { - int super_size = m_a.Size(); - if (super_size == 0) return 0; - int sub_size = m_a[super_size - 1].Size(); - return (super_size - 1) * Tblock_size + sub_size; - } - /** return true if array is empty */ - FORCEINLINE bool IsEmpty() { return m_a.IsEmpty(); } - /** return true if array is full */ - FORCEINLINE bool IsFull() { return m_a.IsFull() && m_a[Tnum_blocks - 1].IsFull(); } - /** return first sub-array with free space for new item */ - FORCEINLINE CSubArray& FirstFreeSubArray() - { - int super_size = m_a.Size(); - if (super_size > 0) { - CSubArray& sa = m_a[super_size - 1]; - if (!sa.IsFull()) return sa; - } - return m_a.Add(); - } - /** allocate but not construct new item */ - FORCEINLINE Titem_& AddNC() { return FirstFreeSubArray().AddNC(); } - /** allocate and construct new item */ - FORCEINLINE Titem_& Add() { return FirstFreeSubArray().Add(); } - /** indexed access (non-const) */ - FORCEINLINE Titem& operator [] (int idx) - { - CSubArray& sa = m_a[idx / Tblock_size]; - Titem& item = sa [idx % Tblock_size]; - return item; - } - /** indexed access (const) */ - FORCEINLINE const Titem& operator [] (int idx) const - { - CSubArray& sa = m_a[idx / Tblock_size]; - Titem& item = sa [idx % Tblock_size]; - return item; - } -}; - -#endif /* ARRAY_HPP */ -- cgit v1.2.3-54-g00ecf