Pointer with length in bytes. More...
#include <CoinIndexedVector.hpp>

Public Member Functions | |
Get methods. | |
| int | getSize () const |
| Get the size. | |
| int | rawSize () const |
| Get the size. | |
| bool | switchedOn () const |
| See if persistence already on. | |
| int | capacity () const |
| Get the capacity (just read it). | |
| void | setCapacity () |
| Set the capacity to >=0 if <=-2. | |
| const char * | array () const |
| Get Array. | |
Set methods | |
| void | setSize (int value) |
| Set the size. | |
| void | switchOff () |
| Set the size to -1. | |
| void | switchOn (int alignment=3) |
| Set the size to -2 and alignment. | |
| void | setPersistence (int flag, int currentLength) |
| Does what is needed to set persistence. | |
| void | clear () |
| Zero out array. | |
| void | swap (CoinArrayWithLength &other) |
| Swaps memory between two members. | |
| void | extend (int newSize) |
| Extend a persistent array keeping data (size in bytes). | |
Condition methods | |
| char * | conditionalNew (long sizeWanted) |
| Conditionally gets new array. | |
| void | conditionalDelete () |
| Conditionally deletes. | |
Constructors and destructors | |
| CoinArrayWithLength () | |
| Default constructor - NULL. | |
| CoinArrayWithLength (int size) | |
| Alternate Constructor - length in bytes - size_ -1. | |
| CoinArrayWithLength (int 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 (const CoinArrayWithLength &rhs) | |
| Copy constructor. | |
| CoinArrayWithLength (const CoinArrayWithLength *rhs) | |
| Copy constructor.2. | |
| CoinArrayWithLength & | operator= (const CoinArrayWithLength &rhs) |
| Assignment operator. | |
| void | copy (const CoinArrayWithLength &rhs, int numberBytes=-1) |
| Assignment with length (if -1 use internal length). | |
| void | allocate (const CoinArrayWithLength &rhs, int numberBytes) |
| Assignment with length - does not copy. | |
| ~CoinArrayWithLength () | |
| Destructor. | |
| void | getArray (int size) |
| Get array with alignment. | |
| void | reallyFreeArray () |
| Really get rid of array with alignment. | |
| void | getCapacity (int numberBytes, int numberIfNeeded=-1) |
| Get enough space (if more needed then do at least needed). | |
Protected Attributes | |
Private member data | |
| char * | array_ |
| Array. | |
| CoinBigIndex | size_ |
| Size of array in bytes. | |
| int | offset_ |
| Offset of array. | |
| int | alignment_ |
| Alignment wanted (power of 2). | |
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 511 of file CoinIndexedVector.hpp.
| CoinArrayWithLength::CoinArrayWithLength | ( | ) | [inline] |
Default constructor - NULL.
Definition at line 568 of file CoinIndexedVector.hpp.
| CoinArrayWithLength::CoinArrayWithLength | ( | int | size | ) | [inline] |
Alternate Constructor - length in bytes - size_ -1.
Definition at line 572 of file CoinIndexedVector.hpp.
References array_.
| CoinArrayWithLength::CoinArrayWithLength | ( | int | 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.
| int CoinArrayWithLength::getSize | ( | ) | const [inline] |
Get the size.
Reimplemented in CoinDoubleArrayWithLength, CoinFactorizationDoubleArrayWithLength, CoinFactorizationLongDoubleArrayWithLength, CoinIntArrayWithLength, CoinBigIndexArrayWithLength, CoinUnsignedIntArrayWithLength, CoinVoidStarArrayWithLength, and CoinArbitraryArrayWithLength.
Definition at line 517 of file CoinIndexedVector.hpp.
References size_.
| int CoinArrayWithLength::rawSize | ( | ) | const [inline] |
| bool CoinArrayWithLength::switchedOn | ( | ) | const [inline] |
See if persistence already on.
Definition at line 523 of file CoinIndexedVector.hpp.
References size_.
| int CoinArrayWithLength::capacity | ( | ) | const [inline] |
Get the capacity (just read it).
Definition at line 526 of file CoinIndexedVector.hpp.
References size_.
| void CoinArrayWithLength::setCapacity | ( | ) | [inline] |
Set the capacity to >=0 if <=-2.
Definition at line 529 of file CoinIndexedVector.hpp.
References size_.
| const char* CoinArrayWithLength::array | ( | ) | const [inline] |
Get Array.
Reimplemented in CoinDoubleArrayWithLength, CoinFactorizationDoubleArrayWithLength, CoinFactorizationLongDoubleArrayWithLength, CoinIntArrayWithLength, CoinBigIndexArrayWithLength, CoinUnsignedIntArrayWithLength, CoinVoidStarArrayWithLength, and CoinArbitraryArrayWithLength.
Definition at line 532 of file CoinIndexedVector.hpp.
| void CoinArrayWithLength::setSize | ( | int | value | ) | [inline] |
Set the size.
Reimplemented in CoinDoubleArrayWithLength, CoinFactorizationDoubleArrayWithLength, CoinFactorizationLongDoubleArrayWithLength, CoinIntArrayWithLength, CoinBigIndexArrayWithLength, CoinUnsignedIntArrayWithLength, CoinVoidStarArrayWithLength, and CoinArbitraryArrayWithLength.
Definition at line 539 of file CoinIndexedVector.hpp.
References size_.
| void CoinArrayWithLength::switchOff | ( | ) | [inline] |
| void CoinArrayWithLength::switchOn | ( | int | alignment = 3 |
) | [inline] |
Set the size to -2 and alignment.
Definition at line 545 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 | ( | long | sizeWanted | ) |
Conditionally gets new array.
| void CoinArrayWithLength::conditionalDelete | ( | ) |
Conditionally deletes.
| CoinArrayWithLength& CoinArrayWithLength::operator= | ( | const CoinArrayWithLength & | rhs | ) |
| void CoinArrayWithLength::copy | ( | const CoinArrayWithLength & | rhs, | |
| int | numberBytes = -1 | |||
| ) |
Assignment with length (if -1 use internal length).
| void CoinArrayWithLength::allocate | ( | const CoinArrayWithLength & | rhs, | |
| int | numberBytes | |||
| ) |
Assignment with length - does not copy.
| void CoinArrayWithLength::getArray | ( | int | size | ) |
Get array with alignment.
| void CoinArrayWithLength::reallyFreeArray | ( | ) |
Really get rid of array with alignment.
| void CoinArrayWithLength::getCapacity | ( | int | numberBytes, | |
| int | numberIfNeeded = -1 | |||
| ) |
Get enough space (if more needed then do at least needed).
char* CoinArrayWithLength::array_ [protected] |
Array.
Definition at line 606 of file CoinIndexedVector.hpp.
Referenced by CoinArbitraryArrayWithLength::array(), CoinVoidStarArrayWithLength::array(), CoinUnsignedIntArrayWithLength::array(), CoinBigIndexArrayWithLength::array(), CoinIntArrayWithLength::array(), CoinFactorizationLongDoubleArrayWithLength::array(), CoinFactorizationDoubleArrayWithLength::array(), CoinDoubleArrayWithLength::array(), array(), CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength(), CoinArrayWithLength(), CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength(), CoinDoubleArrayWithLength::CoinDoubleArrayWithLength(), CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength(), CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength(), CoinIntArrayWithLength::CoinIntArrayWithLength(), CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength(), and CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength().
CoinBigIndex CoinArrayWithLength::size_ [protected] |
Size of array in bytes.
Definition at line 608 of file CoinIndexedVector.hpp.
Referenced by CoinArbitraryArrayWithLength::array(), CoinVoidStarArrayWithLength::array(), CoinUnsignedIntArrayWithLength::array(), CoinBigIndexArrayWithLength::array(), CoinIntArrayWithLength::array(), CoinFactorizationLongDoubleArrayWithLength::array(), CoinFactorizationDoubleArrayWithLength::array(), CoinDoubleArrayWithLength::array(), array(), capacity(), CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength(), CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength(), CoinDoubleArrayWithLength::CoinDoubleArrayWithLength(), CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength(), CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength(), CoinIntArrayWithLength::CoinIntArrayWithLength(), CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength(), CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength(), CoinArbitraryArrayWithLength::getSize(), CoinVoidStarArrayWithLength::getSize(), CoinUnsignedIntArrayWithLength::getSize(), CoinBigIndexArrayWithLength::getSize(), CoinIntArrayWithLength::getSize(), CoinFactorizationLongDoubleArrayWithLength::getSize(), CoinFactorizationDoubleArrayWithLength::getSize(), CoinDoubleArrayWithLength::getSize(), getSize(), rawSize(), setCapacity(), CoinArbitraryArrayWithLength::setSize(), CoinVoidStarArrayWithLength::setSize(), CoinUnsignedIntArrayWithLength::setSize(), CoinBigIndexArrayWithLength::setSize(), CoinIntArrayWithLength::setSize(), CoinFactorizationLongDoubleArrayWithLength::setSize(), CoinFactorizationDoubleArrayWithLength::setSize(), CoinDoubleArrayWithLength::setSize(), setSize(), switchedOn(), switchOff(), and switchOn().
int CoinArrayWithLength::offset_ [protected] |
Offset of array.
Definition at line 610 of file CoinIndexedVector.hpp.
int CoinArrayWithLength::alignment_ [protected] |
Alignment wanted (power of 2).
Definition at line 612 of file CoinIndexedVector.hpp.
Referenced by switchOn().
1.6.1