Dip
0.92.4
|
Pointer with length in bytes. More...
#include <CoinIndexedVector.hpp>
Public Member Functions | |
Get methods. | |
CoinBigIndex | getSize () const |
Get the size. More... | |
CoinBigIndex | rawSize () const |
Get the size. More... | |
bool | switchedOn () const |
See if persistence already on. More... | |
CoinBigIndex | capacity () const |
Get the capacity (just read it) More... | |
void | setCapacity () |
Set the capacity to >=0 if <=-2. More... | |
const char * | array () const |
Get Array. More... | |
Set methods | |
void | setSize (int value) |
Set the size. More... | |
void | switchOff () |
Set the size to -1. More... | |
void | switchOn (int alignment=3) |
Set the size to -2 and alignment. More... | |
void | setPersistence (int flag, int currentLength) |
Does what is needed to set persistence. More... | |
void | clear () |
Zero out array. More... | |
void | swap (CoinArrayWithLength &other) |
Swaps memory between two members. More... | |
void | extend (int newSize) |
Extend a persistent array keeping data (size in bytes) More... | |
Condition methods | |
char * | conditionalNew (CoinBigIndex sizeWanted) |
Conditionally gets new array. More... | |
void | conditionalDelete () |
Conditionally deletes. More... | |
Constructors and destructors | |
CoinArrayWithLength () | |
Default constructor - NULL. More... | |
CoinArrayWithLength (CoinBigIndex size) | |
Alternate Constructor - length in bytes - size_ -1. More... | |
CoinArrayWithLength (CoinBigIndex size, int mode) | |
Alternate Constructor - length in bytes mode - 0 size_ set to size mode>0 size_ set to size and zeroed if size<=0 just does alignment If abs(mode) >2 then align on that as power of 2. More... | |
CoinArrayWithLength (const CoinArrayWithLength &rhs) | |
Copy constructor. More... | |
CoinArrayWithLength (const CoinArrayWithLength *rhs) | |
Copy constructor.2. More... | |
CoinArrayWithLength & | operator= (const CoinArrayWithLength &rhs) |
Assignment operator. More... | |
void | copy (const CoinArrayWithLength &rhs, int numberBytes=-1) |
Assignment with length (if -1 use internal length) More... | |
void | allocate (const CoinArrayWithLength &rhs, CoinBigIndex numberBytes) |
Assignment with length - does not copy. More... | |
~CoinArrayWithLength () | |
Destructor. More... | |
void | getArray (CoinBigIndex size) |
Get array with alignment. More... | |
void | reallyFreeArray () |
Really get rid of array with alignment. More... | |
void | getCapacity (CoinBigIndex numberBytes, CoinBigIndex numberIfNeeded=-1) |
Get enough space (if more needed then do at least needed) More... | |
Protected Attributes | |
Private member data | |
char * | array_ |
Array. More... | |
CoinBigIndex | size_ |
Size of array in bytes. More... | |
int | offset_ |
Offset of array. More... | |
int | alignment_ |
Alignment wanted (power of 2) More... | |
Pointer with length in bytes.
This has a pointer to an array and the number of bytes in array. If number of bytes==-1 then CoinConditionalNew deletes existing pointer and returns new pointer of correct size (and number bytes still -1). CoinConditionalDelete deletes existing pointer and NULLs it. So behavior is as normal (apart from New deleting pointer which will have no effect with good coding practices. If number of bytes >=0 then CoinConditionalNew just returns existing pointer if array big enough otherwise deletes existing pointer, allocates array with spare 1%+64 bytes and updates number of bytes CoinConditionalDelete sets number of bytes = -size-2 and then array returns NULL
Definition at line 533 of file CoinIndexedVector.hpp.
|
inline |
Default constructor - NULL.
Definition at line 621 of file CoinIndexedVector.hpp.
|
inline |
Alternate Constructor - length in bytes - size_ -1.
Definition at line 629 of file CoinIndexedVector.hpp.
References array_.
CoinArrayWithLength::CoinArrayWithLength | ( | CoinBigIndex | size, |
int | mode | ||
) |
Alternate Constructor - length in bytes mode - 0 size_ set to size mode>0 size_ set to size and zeroed if size<=0 just does alignment If abs(mode) >2 then align on that as power of 2.
CoinArrayWithLength::CoinArrayWithLength | ( | const CoinArrayWithLength & | rhs | ) |
Copy constructor.
CoinArrayWithLength::CoinArrayWithLength | ( | const CoinArrayWithLength * | rhs | ) |
Copy constructor.2.
CoinArrayWithLength::~CoinArrayWithLength | ( | ) |
Destructor.
|
inline |
Get the size.
Definition at line 539 of file CoinIndexedVector.hpp.
|
inline |
|
inline |
See if persistence already on.
Definition at line 549 of file CoinIndexedVector.hpp.
References size_.
|
inline |
Get the capacity (just read it)
Definition at line 554 of file CoinIndexedVector.hpp.
References size_.
|
inline |
Set the capacity to >=0 if <=-2.
Definition at line 559 of file CoinIndexedVector.hpp.
References size_.
|
inline |
|
inline |
Set the size.
Definition at line 574 of file CoinIndexedVector.hpp.
|
inline |
Set the size to -1.
Definition at line 586 of file CoinIndexedVector.hpp.
|
inline |
Set the size to -2 and alignment.
Definition at line 591 of file CoinIndexedVector.hpp.
References alignment_, and size_.
void CoinArrayWithLength::setPersistence | ( | int | flag, |
int | currentLength | ||
) |
Does what is needed to set persistence.
void CoinArrayWithLength::clear | ( | ) |
Zero out array.
void CoinArrayWithLength::swap | ( | CoinArrayWithLength & | other | ) |
Swaps memory between two members.
void CoinArrayWithLength::extend | ( | int | newSize | ) |
Extend a persistent array keeping data (size in bytes)
char* CoinArrayWithLength::conditionalNew | ( | CoinBigIndex | sizeWanted | ) |
Conditionally gets new array.
void CoinArrayWithLength::conditionalDelete | ( | ) |
Conditionally deletes.
CoinArrayWithLength& CoinArrayWithLength::operator= | ( | const CoinArrayWithLength & | rhs | ) |
Assignment operator.
Referenced by CoinDoubleArrayWithLength::operator=(), CoinFactorizationDoubleArrayWithLength::operator=(), CoinFactorizationLongDoubleArrayWithLength::operator=(), CoinIntArrayWithLength::operator=(), CoinBigIndexArrayWithLength::operator=(), CoinUnsignedIntArrayWithLength::operator=(), CoinVoidStarArrayWithLength::operator=(), and CoinArbitraryArrayWithLength::operator=().
void CoinArrayWithLength::copy | ( | const CoinArrayWithLength & | rhs, |
int | numberBytes = -1 |
||
) |
Assignment with length (if -1 use internal length)
void CoinArrayWithLength::allocate | ( | const CoinArrayWithLength & | rhs, |
CoinBigIndex | numberBytes | ||
) |
Assignment with length - does not copy.
void CoinArrayWithLength::getArray | ( | CoinBigIndex | size | ) |
Get array with alignment.
void CoinArrayWithLength::reallyFreeArray | ( | ) |
Really get rid of array with alignment.
void CoinArrayWithLength::getCapacity | ( | CoinBigIndex | numberBytes, |
CoinBigIndex | numberIfNeeded = -1 |
||
) |
Get enough space (if more needed then do at least needed)
|
protected |
Array.
Definition at line 667 of file CoinIndexedVector.hpp.
Referenced by array(), CoinDoubleArrayWithLength::array(), CoinFactorizationDoubleArrayWithLength::array(), CoinFactorizationLongDoubleArrayWithLength::array(), CoinIntArrayWithLength::array(), CoinBigIndexArrayWithLength::array(), CoinUnsignedIntArrayWithLength::array(), CoinVoidStarArrayWithLength::array(), CoinArbitraryArrayWithLength::array(), CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength(), CoinArrayWithLength(), CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength(), CoinDoubleArrayWithLength::CoinDoubleArrayWithLength(), CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength(), CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength(), CoinIntArrayWithLength::CoinIntArrayWithLength(), CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength(), and CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength().
|
protected |
Size of array in bytes.
Definition at line 669 of file CoinIndexedVector.hpp.
Referenced by array(), CoinDoubleArrayWithLength::array(), CoinFactorizationDoubleArrayWithLength::array(), CoinFactorizationLongDoubleArrayWithLength::array(), CoinIntArrayWithLength::array(), CoinBigIndexArrayWithLength::array(), CoinUnsignedIntArrayWithLength::array(), CoinVoidStarArrayWithLength::array(), CoinArbitraryArrayWithLength::array(), capacity(), CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength(), CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength(), CoinDoubleArrayWithLength::CoinDoubleArrayWithLength(), CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength(), CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength(), CoinIntArrayWithLength::CoinIntArrayWithLength(), CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength(), CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength(), rawSize(), setCapacity(), switchedOn(), and switchOn().
|
protected |
Offset of array.
Definition at line 671 of file CoinIndexedVector.hpp.
|
protected |
Alignment wanted (power of 2)
Definition at line 673 of file CoinIndexedVector.hpp.
Referenced by switchOn().