FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
OMEarray Class Referencefinal

Implements sparse array of OMEtype elements. More...

#include <OMEarray.h>

+ Inheritance diagram for OMEarray:

Public Types

typedef OMEarrayStorage::ARRAY_SUBSCRIPT_t ARRAY_SUBSCRIPT_t
 

Public Member Functions

 OMEarray ()
 
 OMEarray (const OMEarray &org)
 
OMEarrayoperator= (const OMEarray &arg)
 
 ~OMEarray ()
 
bool operator== (const OMEarray &arg) const
 
bool operator!= (const OMEarray &arg) const
 
OMEtypeoperator[] (const uint32_t i) OME_ALWAYS_INLINE
 
OMEtypeoperator[] (const int32_t i) OME_ALWAYS_INLINE
 
OMEtypeoperator[] (const uint64_t i) OME_ALWAYS_INLINE
 Subscript reference ! More...
 
OMEtypeoperator[] (const uint16_t i) OME_ALWAYS_INLINE
 
const OMEtypeoperator[] (const uint32_t i) const OME_ALWAYS_INLINE
 
const OMEtypeoperator[] (const int32_t i) const OME_ALWAYS_INLINE
 
const OMEtypeoperator[] (const uint64_t i) const OME_ALWAYS_INLINE
 
const OMEtypeoperator[] (const uint16_t i) const OME_ALWAYS_INLINE
 
bool deleteIndex (const uint32_t i)
 
bool deleteIndex (const uint64_t i)
 Deletes the element identified by internal subscript i. More...
 
bool forceDeleteIndex (const ARRAY_SUBSCRIPT_t i)
 Similar to deleteIndex(), but does not ensure a single reference to the array is held. More...
 
bool indexExists (const uint32_t i) const
 
bool indexExists (const int32_t i) const
 
bool indexExists (const uint64_t i) const
 Indicate if an array element exists. More...
 
ARRAY_SUBSCRIPT_t nextIndex (const uint32_t currentSubscript) const
 
ARRAY_SUBSCRIPT_t nextIndex (const int32_t currentSubscript) const
 
ARRAY_SUBSCRIPT_t nextIndex (const uint64_t currentSubscript) const
 Return next valid subscript in an array. More...
 
ARRAY_SUBSCRIPT_t priorIndex (const uint32_t currentSubscript) const
 
ARRAY_SUBSCRIPT_t priorIndex (const int32_t currentSubscript) const
 
ARRAY_SUBSCRIPT_t priorIndex (const uint64_t currentSubscript) const
 
uint_fast32_t elementCount () const OME_ALWAYS_INLINE
 
bool isEmpty () const OME_ALWAYS_INLINE
 
OMEarraydeepCopy () const
 
template<typename STREAMTYPE >
STREAMTYPE & outputOnStream (STREAMTYPE &outputStream, int_fast16_t indent=0, uint8_t includeTypePrefix=OME_DEFAULT_COMPLEX_OUTPUT_MODE) const
 Output an OMEarray to an output stream. More...
 
- Public Member Functions inherited from OMEreferenceToData< OMEarrayStorage >
void getUniqueReference ()
 Force unique reference to the data, which will trigger duplication if necessary (copy-on-write). More...
 
int_fast32_t totalReferences () const OME_ALWAYS_INLINE
 Get current reference total. More...
 

Private Member Functions

 OMEarray (OMEarrayStorage *s)
 

Additional Inherited Members

- Protected Member Functions inherited from OMEreferenceToData< OMEarrayStorage >
void addReadOnlyReference () OME_ALWAYS_INLINE
 
void dropReference (OMEarrayStorage *newData=nullptr) OME_ALWAYS_INLINE
 
 OMEreferenceToData ()
 
 OMEreferenceToData (OMEarrayStorage *existingData) NONNULL_CLASS_PARAMETERS(2)
 
 OMEreferenceToData (const OMEreferenceToData< OMEarrayStorage > &org)
 
virtual ~OMEreferenceToData ()
 
- Protected Attributes inherited from OMEreferenceToData< OMEarrayStorage >
OMEarrayStoragedata
 

Detailed Description

Implements sparse array of OMEtype elements.

Note
Copy-on-write implementation. !

Member Typedef Documentation

◆ ARRAY_SUBSCRIPT_t

Constructor & Destructor Documentation

◆ OMEarray() [1/3]

OMEarray::OMEarray ( OMEarrayStorage s)
inlineexplicitprivate

References s.

◆ OMEarray() [2/3]

OMEarray::OMEarray ( )
inline

◆ OMEarray() [3/3]

OMEarray::OMEarray ( const OMEarray org)
inlineexplicit

◆ ~OMEarray()

OMEarray::~OMEarray ( )
inline

Member Function Documentation

◆ deepCopy()

OMEarray* OMEarray::deepCopy ( ) const
inline

◆ deleteIndex() [1/2]

bool OMEarray::deleteIndex ( const uint32_t  i)
inline

◆ deleteIndex() [2/2]

OMEarray::deleteIndex ( const uint64_t  i)
inline

Deletes the element identified by internal subscript i.

Return values
0the element did not exist.
1the element was successfully deleted.

References OMEreferenceToData< C >::getUniqueReference().

◆ elementCount()

OMEarray::elementCount ( ) const
inline

◆ forceDeleteIndex()

OMEarray::forceDeleteIndex ( const ARRAY_SUBSCRIPT_t  i)
inline

Similar to deleteIndex(), but does not ensure a single reference to the array is held.

Warning
If multiple references exist, the foreign references will have had the contents of the array changed underneath them, which is rarely acceptable.

◆ indexExists() [1/3]

bool OMEarray::indexExists ( const int32_t  i) const
inline

◆ indexExists() [2/3]

◆ indexExists() [3/3]

OMEarray::indexExists ( const uint64_t  i) const
inline

Indicate if an array element exists.

Return values
0the element identified by the internal subscript i does not exist.
1the element identified by the internal subscript i does exist. !

◆ isEmpty()

bool OMEarray::isEmpty ( ) const
inline

◆ nextIndex() [1/3]

ARRAY_SUBSCRIPT_t OMEarray::nextIndex ( const int32_t  currentSubscript) const
inline

◆ nextIndex() [2/3]

ARRAY_SUBSCRIPT_t OMEarray::nextIndex ( const uint32_t  currentSubscript) const
inline

◆ nextIndex() [3/3]

OMEarray::nextIndex ( const uint64_t  currentSubscript) const
inline

Return next valid subscript in an array.

Returns
The subscript of the element in the array after currentSuscript.
Return values
0indicates the end of the array has been reached. !

◆ operator!=()

bool OMEarray::operator!= ( const OMEarray arg) const
inline

◆ operator=()

◆ operator==()

bool OMEarray::operator== ( const OMEarray arg) const
inline

◆ operator[]() [1/8]

const OMEtype& OMEarray::operator[] ( const int32_t  i) const
inline

◆ operator[]() [2/8]

OMEtype& OMEarray::operator[] ( const int32_t  i)
inline

◆ operator[]() [3/8]

const OMEtype& OMEarray::operator[] ( const uint16_t  i) const
inline

◆ operator[]() [4/8]

OMEtype& OMEarray::operator[] ( const uint16_t  i)
inline

◆ operator[]() [5/8]

const OMEtype& OMEarray::operator[] ( const uint32_t  i) const
inline

◆ operator[]() [6/8]

OMEtype& OMEarray::operator[] ( const uint32_t  i)
inline

◆ operator[]() [7/8]

const OMEtype& OMEarray::operator[] ( const uint64_t  i) const
inline

◆ operator[]() [8/8]

OMEarray::operator[] ( const uint64_t  i)
inline

Subscript reference !

read-only subscript reference

References OMEreferenceToData< C >::getUniqueReference().

◆ outputOnStream()

template<typename STREAMTYPE >
STREAMTYPE& OMEarray::outputOnStream ( STREAMTYPE &  outputStream,
int_fast16_t  indent = 0,
uint8_t  includeTypePrefix = OME_DEFAULT_COMPLEX_OUTPUT_MODE 
) const
inline

Output an OMEarray to an output stream.

Parameters
outputStreamis a reference to an output stream.
indentspecifies the number of spaces to indent before beginning output. If negative, no indent is performed for the first line, but subsequent lines are indented based on the absolute value of indent.
includeTypePrefixis a mask of flags indicating if type names should prefix data elements, if strings should be enclosed in quotes, etc.

Referenced by arrayBaseTest(), OMEthread::invokeMethod(), OMEobjectInstance::invokeMethod(), and operator<<().

◆ priorIndex() [1/3]

ARRAY_SUBSCRIPT_t OMEarray::priorIndex ( const int32_t  currentSubscript) const
inline

◆ priorIndex() [2/3]

ARRAY_SUBSCRIPT_t OMEarray::priorIndex ( const uint32_t  currentSubscript) const
inline

Referenced by priorIndex().

◆ priorIndex() [3/3]

OMEarray::priorIndex ( const uint64_t  currentSubscript) const
inline
Parameters
currentSubscript!

The documentation for this class was generated from the following files:
Generated: Tue Jul 28 2020 16:03:27
Support Information