Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
#include <const_ptr_array.h>
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. |
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.
operations_research::ConstPtrArray< T >::ConstPtrArray | ( | const std::vector< T * > & | ptrs | ) | [inline, explicit] |
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.
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.
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.
bool operations_research::ConstPtrArray< T >::Equals | ( | const ConstPtrArray< T > & | other | ) | const [inline] |
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.
Definition at line 83 of file const_ptr_array.h.
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.
Definition at line 90 of file const_ptr_array.h.
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.
string operations_research::ConstPtrArray< T >::DebugString | ( | ) | const [inline] |
const T* const* operations_research::ConstPtrArray< T >::RawData | ( | ) | const [inline] |