Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:05

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 
0028   //! Constructor. Initializes tool by the given parameters.
0029   IMeshData_ParametersListArrayAdaptor(
0030     const ParametersListPtrType& theParameters)
0031     : myParameters (theParameters)
0032   {
0033   }
0034 
0035   //! Destructor.
0036   virtual ~IMeshData_ParametersListArrayAdaptor()
0037   {
0038   }
0039 
0040   //! Returns lower index in parameters array.
0041   Standard_Integer Lower() const
0042   {
0043     return 0;
0044   }
0045 
0046   //! Returns upper index in parameters array.
0047   Standard_Integer Upper() const
0048   {
0049     return myParameters->ParametersNb() - 1;
0050   }
0051 
0052   //! Returns value of the given index.
0053   Standard_Real Value(const Standard_Integer theIndex) const
0054   {
0055     return myParameters->GetParameter(theIndex);
0056   }
0057 
0058 private:
0059 
0060   IMeshData_ParametersListArrayAdaptor (
0061     const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther);
0062 
0063   void operator=(const IMeshData_ParametersListArrayAdaptor<ParametersListPtrType>& theOther);
0064 
0065   const ParametersListPtrType myParameters;
0066 };
0067 
0068 #endif