CArray_cadaptor Class Template Reference
[Collections Library]

#include <mfcstl/collections/carray_adaptors.hpp>

Inheritance diagram for CArray_cadaptor:

CArray_adaptor_base stl_collection_tag collection_tag

List of all members.


Detailed Description

template<typename A, typename T = CArray_traits<A>>
class mfcstl::CArray_cadaptor< A, T >

Adaptor class, representing a Class Adaptor over the CArray family of MFC containers.

The adaptor, being a facade, is

It is used as follows:

  mfcstl::CArray_cadaptor<CStringArray>   ar;

  // As an MFC CStringArray:
  ar.Add("String 1");
  ar.InsertAt(0, "String 0");

  // As an STL container
  ar.push_back("String 2");
  std::list<CString>  l;
  l.push_back("String 3");
  l.push_back("String 4");
  ar.insert(ar.begin() + 2, l.begin(), l.end());
  std::sort(ar.begin(), ar.end());

Parameters:
A The array class, e.g. CObArray, CArray<long>, etc.
Note:
The elements in an adapted array are moved, during insertion / erasure, rather than copied. This means that if the elements in the container maintain pointers to their elements, or their peers, then they are not suitable for use.

Member Types

typedef
parent_class_type::array_type 
array_type
 The type of the underlying MFC array.
typedef
parent_class_type::value_type 
value_type
 The value type.
typedef
parent_class_type::allocator_type 
allocator_type
 The allocator type.
typedef
parent_class_type::reference 
reference
 The mutating (non-const) reference type.
typedef
parent_class_type::const_reference 
const_reference
 The non-mutating (const) reference type.
typedef parent_class_type::pointer pointer
 The mutating (non-const) pointer type.
typedef
parent_class_type::const_pointer 
const_pointer
 The non-mutating (const) pointer type.
typedef parent_class_type::iterator iterator
 The mutating (non-const) iterator type.
typedef
parent_class_type::const_iterator 
const_iterator
 The non-mutating (const) iterator type.
typedef
parent_class_type::size_type 
size_type
 The size type.
typedef
parent_class_type::difference_type 
difference_type
 The difference type.
typedef CArray_cadaptor< A, T > class_type
 The instantiation of the current type.

Public Member Functions

Construction
 CArray_cadaptor (allocator_type const &=allocator_type())
 Default constructs an instance.
 CArray_cadaptor (size_type n)
 Constructs an instance with the given number of elements.
 CArray_cadaptor (size_type n, value_type const &value)
 Constructs an instance with the given number of elements.
 CArray_cadaptor (class_type const &rhs)
 Copy constructor.
 CArray_cadaptor (array_type const &rhs)
 Copy constructs an instance from the given underlying array.
template<typename I2>
 CArray_cadaptor (I2 first, I2 last)
 Constructs an instance from the given range.
 ~CArray_cadaptor () throw ()
Assignment
class_typeoperator= (class_type const &rhs)

Member Typedef Documentation

The type of the underlying MFC array.

Reimplemented from CArray_adaptor_base.

The value type.

Reimplemented from CArray_adaptor_base.

The allocator type.

Reimplemented from CArray_adaptor_base.

The mutating (non-const) reference type.

Reimplemented from CArray_adaptor_base.

The non-mutating (const) reference type.

Reimplemented from CArray_adaptor_base.

The mutating (non-const) pointer type.

Reimplemented from CArray_adaptor_base.

The non-mutating (const) pointer type.

Reimplemented from CArray_adaptor_base.

The mutating (non-const) iterator type.

Reimplemented from CArray_adaptor_base.

The non-mutating (const) iterator type.

Reimplemented from CArray_adaptor_base.

The size type.

Reimplemented from CArray_adaptor_base.

The difference type.

Reimplemented from CArray_adaptor_base.

typedef CArray_cadaptor<A, T> class_type

The instantiation of the current type.

Reimplemented from CArray_adaptor_base.


Constructor & Destructor Documentation

CArray_cadaptor ( allocator_type const &  = allocator_type()  )  [inline, explicit]

Default constructs an instance.

Note:
It takes a parameter of type allocator_type, but ignores it. This facilitates adaptation by the standard adaptor std::stack.

CArray_cadaptor ( size_type  n  )  [inline, explicit]

Constructs an instance with the given number of elements.

Parameters:
n The number of elements

CArray_cadaptor ( size_type  n,
value_type const &  value 
) [inline]

Constructs an instance with the given number of elements.

Parameters:
n The number of elements
value The value of each element

CArray_cadaptor ( class_type const &  rhs  )  [inline]

Copy constructor.

References CArray_adaptor_base::begin(), and CArray_adaptor_base::end().

CArray_cadaptor ( array_type const &  rhs  )  [inline]

Copy constructs an instance from the given underlying array.

CArray_cadaptor ( I2  first,
I2  last 
) [inline]

Constructs an instance from the given range.

References MFCSTL_ASSERT.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:30 2010 for STLSoft by  doxygen 1.5.6