Access an auxiliary variable atomically.
More...
#include <AtomicConstAccessor.h>
|
| | AtomicConstAccessor (const std::string &name) |
| | Constructor.
|
| | AtomicConstAccessor (const std::string &name, const std::string &clsname) |
| | Constructor.
|
| | AtomicConstAccessor (const SG::auxid_t auxid) |
| | Constructor taking an auxid directly.
|
| template<IsConstAuxElement ELT> |
| T | operator() (const ELT &e) const |
| | Fetch the variable for one element, as a const reference.
|
| T | operator() (const AuxVectorData &container, size_t index) const |
| | Fetch the variable for one element, as a const reference.
|
| const_container_pointer_type | getDataArray (const AuxVectorData &container) const |
| | Get a pointer to the start of the auxiliary data array.
|
| template<IsConstAuxElement ELT> |
| const_reference_type | withDefault (const ELT &e, const T &deflt) const |
| | Fetch the variable for one element, as a const reference, with a default.
|
| const_reference_type | withDefault (const AuxVectorData &container, size_t index, const T &deflt) const |
| | Fetch the variable for one element, as a const reference.
|
| const_span | getDataSpan (const AuxVectorData &container) const |
| | Get a span over the auxilary data array.
|
| template<IsConstAuxElement ELT> |
| bool | isAvailable (const ELT &e) const |
| | Test to see if this variable exists in the store.
|
| bool | isAvailable (const AuxVectorData &c) const |
| | Test to see if this variable exists in the store.
|
| SG::auxid_t | auxid () const |
| | Return the aux id for this variable.
|
template<class T, class ALLOC = AuxAllocator_t<T>>
class SG::AtomicConstAccessor< T, ALLOC >
Access an auxiliary variable atomically.
Definition at line 43 of file AtomicConstAccessor.h.
◆ Base
template<class T, class ALLOC = AuxAllocator_t<T>>
◆ const_container_pointer_type
template<class T, class ALLOC = AuxAllocator_t<T>>
◆ const_reference_type
template<class T, class ALLOC = AuxAllocator_t<T>>
◆ const_span
template<class T, class ALLOC = AuxAllocator_t<T>>
◆ element_type
template<class T, class ALLOC = AuxAllocator_t<T>>
◆ AtomicConstAccessor() [1/3]
template<class T, class ALLOC = AuxAllocator_t<T>>
Constructor.
- Parameters
-
| name | Name of this aux variable. |
The name -> auxid lookup is done here.
◆ AtomicConstAccessor() [2/3]
template<class T, class ALLOC = AuxAllocator_t<T>>
Constructor.
- Parameters
-
| name | Name of this aux variable. |
| clsname | The name of its associated class. May be blank. |
The name -> auxid lookup is done here.
◆ AtomicConstAccessor() [3/3]
template<class T, class ALLOC = AuxAllocator_t<T>>
Constructor taking an auxid directly.
- Parameters
-
| auxid | ID for this auxiliary variable. |
Will throw SG::ExcAuxTypeMismatch if the types don't match.
◆ auxid()
template<class T, class ALLOC = AuxAllocator_t<T>>
Return the aux id for this variable.
◆ getDataArray()
template<class T, class ALLOC = AuxAllocator_t<T>>
Get a pointer to the start of the auxiliary data array.
- Parameters
-
| container | The container from which to fetch the variable. |
◆ getDataSpan()
template<class T, class ALLOC = AuxAllocator_t<T>>
Get a span over the auxilary data array.
- Parameters
-
| container | The container from which to fetch the variable. |
◆ isAvailable() [1/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
Test to see if this variable exists in the store.
- Parameters
-
| c | The container in which to test the variable. |
◆ isAvailable() [2/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
template<IsConstAuxElement ELT>
Test to see if this variable exists in the store.
- Parameters
-
| e | An element of the container in which to test the variable. |
◆ operator()() [1/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
Fetch the variable for one element, as a const reference.
- Parameters
-
| container | The container from which to fetch the variable. |
| index | The index of the desired element. |
This allows retrieving aux data by container / index. Looping over the index via this method will be faster then looping over the elements of the container.
As this class can be used only read-only for basic types, return the result by value. That makes it easier to call from python.
◆ operator()() [2/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
template<IsConstAuxElement ELT>
Fetch the variable for one element, as a const reference.
- Parameters
-
| e | The element for which to fetch the variable. |
As this class can be used only read-only for basic types, return the result by value. That makes it easier to call from python.
◆ withDefault() [1/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
Fetch the variable for one element, as a const reference.
- Parameters
-
| container | The container from which to fetch the variable. |
| index | The index of the desired element. |
| deflt | Default value. |
This allows retrieving aux data by container / index. Looping over the index via this method will be faster then looping over the elements of the container. If this variable is not available, then return deflt instead.
◆ withDefault() [2/2]
template<class T, class ALLOC = AuxAllocator_t<T>>
template<IsConstAuxElement ELT>
Fetch the variable for one element, as a const reference, with a default.
- Parameters
-
| e | The element for which to fetch the variable. |
| deflt | Default value. |
If this variable is not available, then return deflt instead.
◆ m_auxid
template<class T, class ALLOC = AuxAllocator_t<T>>
The documentation for this class was generated from the following file: