Loading...
Searching...
No Matches
itkVectorDataContainer.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile$
Date: $Date: 2008-04-15 19:54:41 +0200 (Tue, 15 Apr 2008) $
Version: $Revision: 1573 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 notices for more information.
=========================================================================*/
#ifndef itkVectorDataContainer_h
#define itkVectorDataContainer_h
#include "itkDataObject.h"
#include "itkObjectFactory.h"
#include "itkVectorContainer.h"
#include <utility>
#include <vector>
namespace itk
{
template <typename TElementIdentifier, typename TElement>
class ITK_TEMPLATE_EXPORT VectorDataContainer
: public DataObject
, private std::vector<TElement>
{
public:
using Self = VectorDataContainer;
using Superclass = DataObject;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
using ElementIdentifier = TElementIdentifier;
using Element = TElement;
private:
using VectorType = std::vector<Element>;
using size_type = typename VectorType::size_type;
using VectorIterator = typename VectorType::iterator;
using VectorConstIterator = typename VectorType::const_iterator;
protected:
VectorDataContainer()
: DataObject()
, VectorType()
{}
explicit VectorDataContainer(size_type n)
: DataObject()
, VectorType(n)
{}
VectorDataContainer(size_type n, const Element & x)
: DataObject()
, VectorType(n, x)
{}
VectorDataContainer(const Self & r)
: DataObject()
, VectorType(r)
{}
template <typename InputIterator>
VectorDataContainer(InputIterator first, InputIterator last)
: DataObject()
, VectorType(first, last)
{}
public:
using STLContainerType = VectorType;
itkNewMacro(Self);
itkTypeMacro(VectorDataContainer, DataObject);
STLContainerType &
CastToSTLContainer()
{
return *this;
}
const STLContainerType &
CastToSTLConstContainer() const
{
return *this;
}
using STLContainerType::begin;
using STLContainerType::end;
using STLContainerType::rbegin;
using STLContainerType::rend;
using STLContainerType::cbegin;
using STLContainerType::cend;
using STLContainerType::crbegin;
using STLContainerType::crend;
using STLContainerType::size;
using STLContainerType::max_size;
using STLContainerType::resize;
using STLContainerType::capacity;
using STLContainerType::empty;
using STLContainerType::reserve;
using STLContainerType::shrink_to_fit;
using STLContainerType::operator[];
using STLContainerType::at;
using STLContainerType::front;
using STLContainerType::back;
using STLContainerType::assign;
using STLContainerType::push_back;
using STLContainerType::pop_back;
using STLContainerType::insert;
using STLContainerType::erase;
using STLContainerType::swap;
using STLContainerType::clear;
using STLContainerType::get_allocator;
using typename STLContainerType::reference;
using typename STLContainerType::const_reference;
using typename STLContainerType::iterator;
using typename STLContainerType::const_iterator;
// already declared before
// using STLContainerType::size_type;
using typename STLContainerType::difference_type;
using typename STLContainerType::value_type;
using typename STLContainerType::allocator_type;
using typename STLContainerType::pointer;
using typename STLContainerType::const_pointer;
using typename STLContainerType::reverse_iterator;
using typename STLContainerType::const_reverse_iterator;
using Iterator = typename VectorContainer<TElementIdentifier, TElement>::Iterator;
using ConstIterator = typename VectorContainer<TElementIdentifier, TElement>::ConstIterator;
/* Declare the public interface routines. */
Element & ElementAt(ElementIdentifier);
const Element & ElementAt(ElementIdentifier) const;
Element & CreateElementAt(ElementIdentifier);
Element GetElement(ElementIdentifier) const;
void SetElement(ElementIdentifier, Element);
void InsertElement(ElementIdentifier, Element);
bool IndexExists(ElementIdentifier) const;
bool
GetElementIfIndexExists(ElementIdentifier, Element *) const;
void CreateIndex(ElementIdentifier);
void DeleteIndex(ElementIdentifier);
ConstIterator
Begin() const;
ConstIterator
End() const;
Iterator
Begin();
Iterator
End();
unsigned long
Size() const;
void Reserve(ElementIdentifier);
void
Squeeze();
void
Initialize() override;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkVectorDataContainer.hxx"
#endif
#endif // end itkVectorDataContainer_h
itk::VectorDataContainer::Initialize
void Initialize() override
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::STLContainerType
VectorType STLContainerType
Definition itkVectorDataContainer.h:123
itk::VectorDataContainer::InsertElement
void InsertElement(ElementIdentifier, Element)
itk::VectorDataContainer::CreateIndex
void CreateIndex(ElementIdentifier)
itk::VectorDataContainer::Size
unsigned long Size() const
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::Self
VectorDataContainer Self
Definition itkVectorDataContainer.h:79
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::size_type
typename VectorType::size_type size_type
Definition itkVectorDataContainer.h:91
itk::VectorDataContainer::DeleteIndex
void DeleteIndex(ElementIdentifier)
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::VectorIterator
typename VectorType::iterator VectorIterator
Definition itkVectorDataContainer.h:92
itk::VectorDataContainer::End
Iterator End()
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::ElementIdentifier
std::vcl_size_t ElementIdentifier
Definition itkVectorDataContainer.h:85
itk::VectorDataContainer::End
ConstIterator End() const
itk::VectorDataContainer::GetElement
Element GetElement(ElementIdentifier) const
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::ConstIterator
typename VectorContainer< std::vcl_size_t, ImageSampleType >::ConstIterator ConstIterator
Definition itkVectorDataContainer.h:193
itk::VectorDataContainer::VectorDataContainer
VectorDataContainer(size_type n, const Element &x)
Definition itkVectorDataContainer.h:107
itk::VectorDataContainer::VectorDataContainer
VectorDataContainer(InputIterator first, InputIterator last)
Definition itkVectorDataContainer.h:116
itk::VectorDataContainer::ElementAt
const Element & ElementAt(ElementIdentifier) const
itk::VectorDataContainer::Begin
ConstIterator Begin() const
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkVectorDataContainer.h:82
itk::VectorDataContainer::CreateElementAt
Element & CreateElementAt(ElementIdentifier)
itk::VectorDataContainer::VectorDataContainer
VectorDataContainer(size_type n)
Definition itkVectorDataContainer.h:103
itk::VectorDataContainer::Reserve
void Reserve(ElementIdentifier)
itk::VectorDataContainer::CastToSTLContainer
STLContainerType & CastToSTLContainer()
Definition itkVectorDataContainer.h:133
itk::VectorDataContainer::GetElementIfIndexExists
bool GetElementIfIndexExists(ElementIdentifier, Element *) const
itk::VectorDataContainer::IndexExists
bool IndexExists(ElementIdentifier) const
itk::VectorDataContainer::VectorDataContainer
VectorDataContainer(const Self &r)
Definition itkVectorDataContainer.h:111
itk::VectorDataContainer::Begin
Iterator Begin()
itk::VectorDataContainer::Squeeze
void Squeeze()
itk::VectorDataContainer::VectorDataContainer
VectorDataContainer()
Definition itkVectorDataContainer.h:99
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::Element
ImageSampleType Element
Definition itkVectorDataContainer.h:86
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::VectorConstIterator
typename VectorType::const_iterator VectorConstIterator
Definition itkVectorDataContainer.h:93
itk::VectorDataContainer::ElementAt
Element & ElementAt(ElementIdentifier)
itk::VectorDataContainer::SetElement
void SetElement(ElementIdentifier, Element)
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::Iterator
typename VectorContainer< std::vcl_size_t, ImageSampleType >::Iterator Iterator
Definition itkVectorDataContainer.h:192
itk::VectorDataContainer::CastToSTLConstContainer
const STLContainerType & CastToSTLConstContainer() const
Definition itkVectorDataContainer.h:141
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::VectorType
std::vector< Element > VectorType
Definition itkVectorDataContainer.h:90
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::Pointer
SmartPointer< Self > Pointer
Definition itkVectorDataContainer.h:81
itk::VectorDataContainer< std::vcl_size_t, ImageSampleType >::Superclass
DataObject Superclass
Definition itkVectorDataContainer.h:80
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |