0024911: Avoid using virtual functions in NCollection classes
[occt.git] / src / NCollection / NCollection_DefineHArray2.hxx
CommitLineData
b311480e 1// Created on: 2002-04-29
2// Created by: Alexander KARTOMIN (akm)
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_HArray2.hxx by GAWK
7fd59977 17
18#ifndef NCollection_DefineHArray2_HeaderFile
19#define NCollection_DefineHArray2_HeaderFile
20
21#include <Standard_DefineHandle.hxx>
22#include <NCollection_DefineArray2.hxx>
23#include <MMgt_TShared.hxx>
24
25// Declaration of Array2 class managed by Handle
26
27#define DEFINE_HARRAY2(HClassName, _Array2Type_) \
b311480e 28\
7fd59977 29class HClassName : public _Array2Type_, \
30 public MMgt_TShared { \
31 public: \
ddf2fe8e 32 DEFINE_STANDARD_ALLOC \
33 DEFINE_NCOLLECTION_ALLOC \
7fd59977 34 inline HClassName (const Standard_Integer theRowLower, \
35 const Standard_Integer theRowUpper, \
36 const Standard_Integer theColLower, \
37 const Standard_Integer theColUpper);\
38 inline HClassName (const _Array2Type_&); \
39 inline const _Array2Type_& Array2 () const; \
40 inline _Array2Type_& ChangeArray2(); \
41 DEFINE_STANDARD_RTTI (HClassName) \
42}; \
43 \
44DEFINE_STANDARD_HANDLE (HClassName, MMgt_TShared) \
45 \
46inline HClassName::HClassName (const Standard_Integer theRowLow, \
47 const Standard_Integer theRowUpp, \
48 const Standard_Integer theColLow, \
49 const Standard_Integer theColUpp) : \
50 _Array2Type_ (theRowLow, theRowUpp, theColLow, theColUpp), \
51 MMgt_TShared() {} \
52 \
53inline HClassName::HClassName (const _Array2Type_& theOther) : \
54 _Array2Type_(theOther), \
55 MMgt_TShared() {} \
56 \
57inline const _Array2Type_& HClassName::Array2 () const \
58{ return * (const _Array2Type_ *) this; } \
59 \
60inline _Array2Type_& HClassName::ChangeArray2 () \
61{ return * (_Array2Type_ *) this; } \
62
63#define IMPLEMENT_HARRAY2(HClassName) \
64IMPLEMENT_STANDARD_HANDLE (HClassName, MMgt_TShared) \
65IMPLEMENT_STANDARD_RTTIEXT (HClassName, MMgt_TShared)
66
67#endif