<commit_before>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkVectorContainer.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) 2000 National Library of Medicine
  All rights reserved.

  See COPYRIGHT.txt for copyright details.

=========================================================================*/
#ifndef __itkVectorContainer_h
#define __itkVectorContainer_h

#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"

#include <utility>
#include <vector>

namespace itk
{

/** \class VectorContainer
 * Define a front-end to the STL "vector" container that conforms to the
 * IndexedContainerInterface.  This is a full-fleged Object, so
 * there is modification time, debug, and reference count information.
 *
 * Template parameters for VectorContainer:
 *
 * TElementIdentifier =
 *     An INTEGRAL type for use in indexing the vector.
 *
 * TElement =
 *    The element type stored in the container.
 */
  
template <
  typename TElementIdentifier,
  typename TElement
  >
class VectorContainer: 
  public Object,
  private std::vector<TElement>
{
public:
  /**
   * Standard "Self" typedef.
   */
  typedef VectorContainer     Self;
  
  /**
   * Standard "Superclass" typedef.
   */
  typedef Object  Superclass;

  /**
   * Smart pointer typedef support.
   */
  typedef SmartPointer<Self>  Pointer;
  typedef SmartPointer<const Self>  ConstPointer;
  
  /**
   * Save the template parameters.
   */
  typedef TElementIdentifier  ElementIdentifier;
  typedef TElement            Element;
  

private:
  /**
   * Quick access to the STL vector type that was inherited.
   */
  typedef std::vector<Element>                VectorType;
  typedef typename VectorType::size_type          size_type;  
  typedef typename VectorType::iterator           VectorIterator;
  typedef typename VectorType::const_iterator     VectorConstIterator;
  
  
protected:
  /**
   * Provide pass-through constructors corresponding to all the STL
   * vector constructors.  These are for internal use only since this is also
   * an Object which must be constructed through the "New()" routine.
   */
  
  /**
   *
   */
  VectorContainer():
    VectorType() {}
  
  /**
   *
   */
  VectorContainer(size_type n):
    VectorType(n) {}
  
  /**
   *
   */
  VectorContainer(size_type n, const Element& x):
    VectorType(n, x) {}
  
  /**
   *
   */
  VectorContainer(const Self& r):
    VectorType(r) {}
  
  /**
   *
   */
  template <typename InputIterator>
  VectorContainer(InputIterator first, InputIterator last):
    VectorType(first, last) {}

public:
  /**
   * Method for creation through the object factory.
   */
  itkNewMacro(Self);
  
  class Iterator;
  class ConstIterator;
  friend class Iterator;
  friend class ConstIterator;
  

  /**
   * Simulate STL-map style iteration where dereferencing the iterator
   * gives access to both the index and the value.
   */
  class Iterator
  {
  public:
    Iterator() {}
    Iterator(size_type d, const VectorIterator& i): m_Pos(d), m_Iter(i) {}
    
    Iterator& operator* ()    { return *this; }
    Iterator* operator-> ()   { return this; }
    Iterator& operator++ ()   { ++m_Pos; ++m_Iter; return *this; }<commit_msg>ERR:Removed contructor warnings<commit_after>/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    itkVectorContainer.h
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) 2000 National Library of Medicine
  All rights reserved.

  See COPYRIGHT.txt for copyright details.

=========================================================================*/
#ifndef __itkVectorContainer_h
#define __itkVectorContainer_h

#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"

#include <utility>
#include <vector>

namespace itk
{

/** \class VectorContainer
 * Define a front-end to the STL "vector" container that conforms to the
 * IndexedContainerInterface.  This is a full-fleged Object, so
 * there is modification time, debug, and reference count information.
 *
 * Template parameters for VectorContainer:
 *
 * TElementIdentifier =
 *     An INTEGRAL type for use in indexing the vector.
 *
 * TElement =
 *    The element type stored in the container.
 */
  
template <
  typename TElementIdentifier,
  typename TElement
  >
class VectorContainer: 
  public Object,
  private std::vector<TElement>
{
public:
  /**
   * Standard "Self" typedef.
   */
  typedef VectorContainer     Self;
  
  /**
   * Standard "Superclass" typedef.
   */
  typedef Object  Superclass;

  /**
   * Smart pointer typedef support.
   */
  typedef SmartPointer<Self>  Pointer;
  typedef SmartPointer<const Self>  ConstPointer;
  
  /**
   * Save the template parameters.
   */
  typedef TElementIdentifier  ElementIdentifier;
  typedef TElement            Element;
  

private:
  /**
   * Quick access to the STL vector type that was inherited.
   */
  typedef std::vector<Element>                VectorType;
  typedef typename VectorType::size_type          size_type;  
  typedef typename VectorType::iterator           VectorIterator;
  typedef typename VectorType::const_iterator     VectorConstIterator;
  
  
protected:
  /**
   * Provide pass-through constructors corresponding to all the STL
   * vector constructors.  These are for internal use only since this is also
   * an Object which must be constructed through the "New()" routine.
   */
  
  /**
   *
   */
  VectorContainer():
    Object(), VectorType() {}
  
  /**
   *
   */
  VectorContainer(size_type n):
    Object(), VectorType(n) {}
  
  /**
   *
   */
  VectorContainer(size_type n, const Element& x):
    Object(), VectorType(n, x) {}
  
  /**
   *
   */
  VectorContainer(const Self& r):
    Object(), VectorType(r) {}
  
  /**
   *
   */
  template <typename InputIterator>
  VectorContainer(InputIterator first, InputIterator last):
    Object(), VectorType(first, last) {}

public:
  /**
   * Method for creation through the object factory.
   */
  itkNewMacro(Self);
  
  class Iterator;
  class ConstIterator;
  friend class Iterator;
  friend class ConstIterator;
  

  /**
   * Simulate STL-map style iteration where dereferencing the iterator
   * gives access to both the index and the value.
   */
  class Iterator
  {
  public:
    Iterator() {}
    Iterator(size_type d, const VectorIterator& i): m_Pos(d), m_Iter(i) {}
    
    Iterator& operator* ()    { return *this; }
    Iterator* operator-> ()   { return this; }
    Iterator& operator++ ()   { ++m_Pos; ++m_Iter; return *this; }
{'fraction_non_alphanumeric': 0.13891362422083706, 'fraction_numerical': 0.0011872959335114278, 'mean_word_length': 3.165018541409147, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5877595', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1901, 'n_words': 577}