Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:18:00

0001 // Created on: 2016-04-07
0002 // Copyright (c) 2016 OPEN CASCADE SAS
0003 // Created by: Oleg AGASHIN
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _IMeshData_ParametersListArrayAdaptor_HeaderFile
0017 #define _IMeshData_ParametersListArrayAdaptor_HeaderFile
0018 
0019 #include <Standard_Transient.hxx>
0020 
0021 //! Auxiliary tool representing adaptor interface for child classes of
0022 //! IMeshData_ParametersList to be used in tools working on NCollection_Array structure.
0023 template <class ParametersListPtrType>
0024 class IMeshData_ParametersListArrayAdaptor : public Standard_Transient
0025 {
0026 public:
0027   //! Constructor. Initializes tool by the given parameters.
0028   IMeshData_ParametersListArrayAdaptor(const ParametersListPtrType& theParameters)
0029       : myParameters(theParameters)
0030   {
0031   }
0032 
0033   //! Destructor.
0034   ~IMeshData_ParametersListArrayAdaptor() override = default;
0035 
0036   //! Returns lower index in parameters array.
0037   int Lower() const { return 0; }
0038 
0039   //! Returns upper index in parameters array.
0040   int Upper() const { return myParameters->ParametersNb() - 1; }
0041 
0042   //! Returns value of the given index.
0043   double Value(const int theIndex) const { return myParameters->GetParameter(theIndex); }
0044 
0045 private:
0046   IMeshData_ParametersListArrayAdaptor(
0047     const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther) = delete;
0048 
0049   void operator=(const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther) =
0050     delete;
0051 
0052   const ParametersListPtrType myParameters;
0053 };
0054 
0055 #endif