Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ util/

operations_research::ConstPtrArray< T > Class Template Reference

This class is used to store an const array of T*. More...

#include <const_ptr_array.h>

List of all members.

Public Member Functions

 ConstPtrArray (const std::vector< T * > &ptrs)
 Build from one vector. Copy the data internally.
 ConstPtrArray (std::vector< T * > *const data)
 Build from one data vector. Takes ownership of the vector.
std::vector< T * > * Release ()
 This code releases the ownership of the data into the returned vector.
int size () const
 Size of the array. This is not valid after Release() has been called.
bool Equals (const ConstPtrArray< T > &other) const
 Checks for deep equality with other array.
T * operator[] (int64 index) const
 Returns the instance of T* at position index.
T * get (int64 index) const
 Returns the instance of T* at position index.
std::vector< T * > * Copy () const
 Returns a copy of the data. Usually used to create a new ConstPtrArray.
string DebugString () const
 Pretty print.
const T *const * RawData () const
 Access to const raw data.


Detailed Description

template<class T>
class operations_research::ConstPtrArray< T >

This class is used to store an const array of T*.

This is useful inside constraints and expressions. The constructors, except the one with the pointer to a vector of cells will copy the data internally and will not take ownership of the data passed in argument. Its goals are:

Definition at line 44 of file const_ptr_array.h.


Constructor & Destructor Documentation

template<class T>
operations_research::ConstPtrArray< T >::ConstPtrArray ( const std::vector< T * > &  ptrs  )  [inline, explicit]

Build from one vector. Copy the data internally.

Definition at line 47 of file const_ptr_array.h.

template<class T>
operations_research::ConstPtrArray< T >::ConstPtrArray ( std::vector< T * > *const   data  )  [inline, explicit]

Build from one data vector. Takes ownership of the vector.

Definition at line 51 of file const_ptr_array.h.


Member Function Documentation

template<class T>
std::vector<T*>* operations_research::ConstPtrArray< T >::Release (  )  [inline]

This code releases the ownership of the data into the returned vector.

After this method is called, data_ points to a null vector.

Definition at line 55 of file const_ptr_array.h.

template<class T>
int operations_research::ConstPtrArray< T >::size (  )  const [inline]

Size of the array. This is not valid after Release() has been called.

Definition at line 60 of file const_ptr_array.h.

template<class T>
bool operations_research::ConstPtrArray< T >::Equals ( const ConstPtrArray< T > &  other  )  const [inline]

Checks for deep equality with other array.

Definition at line 68 of file const_ptr_array.h.

template<class T>
T* operations_research::ConstPtrArray< T >::operator[] ( int64  index  )  const [inline]

Returns the instance of T* at position index.

This is not valid after Release() has been called.

See also:
operator[]().

Definition at line 83 of file const_ptr_array.h.

template<class T>
T* operations_research::ConstPtrArray< T >::get ( int64  index  )  const [inline]

Returns the instance of T* at position index.

This is not valid after Release() has been called.

See also:
operator[]().

Definition at line 90 of file const_ptr_array.h.

template<class T>
std::vector<T*>* operations_research::ConstPtrArray< T >::Copy (  )  const [inline]

Returns a copy of the data. Usually used to create a new ConstPtrArray.

Definition at line 96 of file const_ptr_array.h.

template<class T>
string operations_research::ConstPtrArray< T >::DebugString (  )  const [inline]

Pretty print.

Definition at line 102 of file const_ptr_array.h.

template<class T>
const T* const* operations_research::ConstPtrArray< T >::RawData (  )  const [inline]

Access to const raw data.

Todo:
TODO(user) : deprecate API.

Definition at line 112 of file const_ptr_array.h.


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