0024911: Avoid using virtual functions in NCollection classes
[occt.git] / src / NCollection / NCollection_DefineVector.hxx
b311480e 1// Created on: 2002-04-23
2// Created by: Alexander GRIGORIEV
973c2be1 3// Copyright (c) 2002-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// Automatically created from NCollection_Vector.hxx by GAWK
7fd59977 17
19#ifndef NCollection_DefineVector_HeaderFile
20#define NCollection_DefineVector_HeaderFile
7fd59977 22#include <NCollection_Vector.hxx>
7fd59977 24// Class NCollection_Vector (dynamic array of objects)
7fd59977 25// This class is similar to NCollection_Array1 though the indices always start
26// at 0 (in Array1 the first index must be specified)
7fd59977 27// The Vector is always created with 0 length. It can be enlarged by two means:
28// 1. Calling the method Append (val) - then "val" is added to the end of the
29// vector (the vector length is incremented)
30// 2. Calling the method SetValue (i, val) - if "i" is greater than or equal
31// to the current length of the vector, the vector is enlarged to accomo-
7fd59977 32// The methods Append and SetValue return a non-const reference to the copied
33// object inside the vector. This reference is guaranteed to be valid until
34// the vector is destroyed. It can be used to access the vector member directly
35// or to pass its address to other data structures.
7fd59977 36// The vector iterator remembers the length of the vector at the moment of the
37// creation or initialisation of the iterator. Therefore the iteration begins
38// at index 0 and stops at the index equal to (remembered_length-1). It is OK
39// to enlarge the vector during the iteration.
41#define DEFINE_VECTOR(_ClassName_, _BaseCollection_, TheItemType) \
b311480e 42typedef NCollection_Vector<TheItemType > _ClassName_;
7fd59977 43