![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Auxiliary class optimizing creation of array buffer (using stack allocation for small arrays). More...
#include <NCollection_LocalArray.hxx>
Data Structures | |
| struct | InlineStorageNonTrivial |
| Inline storage for non-trivial types: raw aligned bytes for placement new. More... | |
| struct | InlineStorageTrivial |
| Inline storage for trivial types: typed array with direct element access. More... | |
Public Member Functions | |
| NCollection_LocalArray (const size_t theSize) | |
| NCollection_LocalArray () noexcept | |
| ~NCollection_LocalArray () | |
| void | Allocate (const size_t theSize) |
| void | Reallocate (const size_t theNewSize, bool theToCopy=true) |
| Reallocate the array to a new size. | |
| size_t | Size () const noexcept |
| operator theItem * () const noexcept | |
| NCollection_LocalArray (NCollection_LocalArray &&theOther) noexcept | |
| NCollection_LocalArray & | operator= (NCollection_LocalArray &&theOther) noexcept |
| NCollection_LocalArray (const NCollection_LocalArray &)=delete | |
| NCollection_LocalArray & | operator= (const NCollection_LocalArray &)=delete |
Protected Types | |
| using | InlineStorage |
Protected Member Functions | |
| void | Deallocate () |
| theItem * | inlinePtr () noexcept |
| Pointer to inline buffer storage. | |
| const theItem * | inlinePtr () const noexcept |
| bool | isInline () const noexcept |
| True if currently using inline (stack) storage. | |
Protected Attributes | |
| InlineStorage | myStorage |
| Inline buffer. | |
| theItem * | myPtr |
| Points to inline or heap buffer. | |
| size_t | mySize |
| Logical element count. | |
Auxiliary class optimizing creation of array buffer (using stack allocation for small arrays).
For trivially copyable types the fast memcpy / Standard::Reallocate path is used. For non-trivially-copyable types (Handle, TopLoc_Location, etc.) the class uses placement new, move semantics, and explicit destructors while keeping Standard::Allocate / Standard::Free for heap management.
Non-trivially-copyable types must be default-constructible and nothrow-move-constructible.
|
protected |
|
inlineexplicit |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
delete |
|
inline |
|
inlineprotected |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
Pointer to inline buffer storage.
|
inlineprotectednoexcept |
True if currently using inline (stack) storage.
|
inlinenoexcept |
|
delete |
|
inlinenoexcept |
|
inline |
Reallocate the array to a new size.
| [in] | theNewSize | new number of elements |
| [in] | theToCopy | if true, existing elements are copied/moved to the new buffer |
|
inlinenoexcept |
|
protected |
Points to inline or heap buffer.
|
protected |
Logical element count.
|
protected |
Inline buffer.