Files
OCCT/src/PCollection/PCollection_HArray1.gxx
abv 2cb4424136 0024805: Eliminate unused static functions and methods: ShallowDump(), ShallowCopy(), STANDARD_TYPE(...)
Implementation of global functions STANDARD_TYPE() for types not inheriting Standard_Transient or Standard_Persistent are eliminated.

Global functions and class methods ShallowCopy() are removed; also removed unused classes Visual3d_PickPath and Visual3d_PickDescriptor.

Global functions and class methods ShallowDump() are removed, except for classes Standard_GUID, TopLoc_Datum, and TopLoc_Location as the latter are still used in some Debug printouts.
2014-04-17 15:59:15 +04:00

113 lines
3.7 KiB
Plaintext

// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_OutOfRange.hxx>
#include <Standard_RangeError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ProgramError.hxx>
// ----------------------------------------------------------------------
// HArray1 implementation:
// Last Revision : Feb,10 1992 J.P Tirault
// Implementation of ShallowCopy, ShallowDump
// methods.
// ----------------------------------------------------------------------
// Constructor
// ----------------------------------------------------------------------
PCollection_HArray1::PCollection_HArray1
(const Standard_Integer First,
const Standard_Integer Last) : Data (Last-First+1)
{
Standard_Integer Size = Last-First+1;
if( Size <= 0 ) Standard_RangeError::Raise();
LowerBound = First ;
UpperBound = Last ;
}
// ----------------------------------------------------------------------
// datas
// ----------------------------------------------------------------------
Standard_Address PCollection_HArray1::Datas() const
{
return ((Standard_Address)Data.Lock());
}
// ----------------------------------------------------------------------
// Constructor
// ----------------------------------------------------------------------
PCollection_HArray1::PCollection_HArray1
(const Standard_Integer First,
const Standard_Integer Last,
const Item& V) :Data (Last-First+1) {
Standard_Integer Size = Last-First+1;
if( Size <= 0 ) Standard_RangeError::Raise();
LowerBound = First ;
UpperBound = Last ;
for(Standard_Integer I = 0 ; I < Size ; I++) Data.SetValue(I, V);
}
// ----------------------------------------------------------------------
// Destructor
// ----------------------------------------------------------------------
/*
void PCollection_HArray1::~PCollection_HArray1 ()
{
delete Data ;
}
*/
/* Anciens INLINE */
// ----------------------------------------------------------------------
// SetValue
// ----------------------------------------------------------------------
void PCollection_HArray1::SetValue
( const Standard_Integer Index, const Item& Value)
{
Standard_OutOfRange_Raise_if((Index < LowerBound || Index > UpperBound),
"Index out of range in HArray1::SetValue");
Data.SetValue(Index-LowerBound, Value) ;
}
// ----------------------------------------------------------------------
// Value
// ----------------------------------------------------------------------
Item PCollection_HArray1::Value
( const Standard_Integer Index) const
{
Standard_OutOfRange_Raise_if((Index < LowerBound || Index > UpperBound),
"Index out of range in HArray1::operator()");
return Data(Index-LowerBound);
}
// ------------------------------------------------------------------
//
// ------------------------------------------------------------------
PCollection_FieldOfHArray1 PCollection_HArray1::Field () const
{
return Data ;
}