//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. // // Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS). // Copyright 2014 UT-Battelle, LLC. // Copyright 2014 Los Alamos National Security. // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National // Laboratory (LANL), the U.S. Government retains certain rights in // this software. //============================================================================ #include #include namespace vtkm { namespace cont { namespace internal { template Storage::Storage() : StorageBasicBase() { } template Storage::Storage(const T* array, vtkm::Id numberOfValues) : StorageBasicBase(const_cast(array), numberOfValues, sizeof(T)) { } template void Storage::Allocate(vtkm::Id numberOfValues) { this->AllocateValues(numberOfValues, sizeof(T)); } template typename Storage::PortalType Storage::GetPortal() { auto v = static_cast(this->Array); return PortalType(v, v + this->NumberOfValues); } template typename Storage::PortalConstType Storage::GetPortalConst() const { auto v = static_cast(this->Array); return PortalConstType(v, v + this->NumberOfValues); } template T* Storage::GetArray() { return static_cast(this->Array); } template const T* Storage::GetArray() const { return static_cast(this->Array); } template T* Storage::StealArray() { this->DeallocateOnRelease = false; return static_cast(this->Array); } } // namespace internal } } // namespace vtkm::cont