Namespaces
Enumerations
enum class NodeOptions : uint64_t
| Name | Value | Comments |
|---|---|---|
| None | 0 | -- |
| AllowCopy | (1 << 0) |
By default, nodes will not allow either copy construction or copy
Because of this, if code attempts to expand either the copy constructor or
It may be the case, however, that a user wishes to allow copying of their
MyStructure
++ A will remain in the container unmodified.
Finally, it is possible that a user actually _does_ wish to copy the |
| AllowCopyFromContainer | (1 << 1) |
By default, nodes will not allow either copy construction or copy
Because of this, if code attempts to expand either the copy constructor or
It may be the case, however, that a user wishes to allow copying of their
MyStructure
++ A will remain in the container unmodified.
Finally, it is possible that a user actually _does_ wish to copy the |
| AllowMove | (1 << 2) |
See the AllowCopy and AllowCopyFromConainer flags for details. AllowMove |
| AllowMoveFromContainer | (1 << 3) |
See the AllowCopy and AllowCopyFromConainer flags for details. AllowMove |
| AllowCopyMove | static_cast<uint64_t>(AllowCopy) | static_cast<uint64_t>(AllowMove) |
Convenience definitions |
| AllowCopyMoveFromContainer | static_cast<uint64_t>(AllowCopyFromContainer) | static_cast<uint64_t>(AllowMoveFromContainer) |
Convenience definitions |
| AllowMultiContainerUptr | (1 << 4) |
Allow an object to exist in multiple containers at once, even if one or
Generally, it would be a mistake to define an object which can exist in
Because of this, the ContainableBaseClasses helper (see below) will, by
There are special cases, however, where a user might want this behavior to
using MainList = operation::TaggedDoublyLinkedList
operation::Mutex all_objects_lock;
void do_interesting_things() TA_EXCL(all_objects_lock) {
for (auto
do_interesting_things_to_interesting_objects(std::move(interesting_objects));
Users who have carefully considered the lifecycle management of their |
| AllowRemoveFromContainer | (1 << 5) |
Nodes with this flag permitted to be directly removed from their container, |
| AllowClearUnsafe | (1 << 6) |
Enables the |clear_unsafe| operation on containers of unmanaged pointers. |
| ReservedBits | 0xF000000000000000 |
Reserved bits reserved for testing purposes and should always be ignored by |
A set of flag-style options which can be applied to container nodes in order
to control and sanity check their behavior and compatibility at compile time.
To control node options, users pass a set of options to either the
containable mix-in class (SinglyLinkedLisable, DoublyLinkedListable, or
WAVLTreeContainable), or directly to the node instance in the case that the
user is specifying custom container traits.
Defined at line 64 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h
enum class SizeOrder
| Name | Value |
|---|---|
| N | 0 |
| Constant | 1 |
An enumeration which can be used as a template argument on list types to
control the order of operation needed to compute the size of the list. When
set to SizeOrder::N, the list's size will not be maintained and there will be
no valid size() method to call. The only way to fetch the size of a list
would be via |size_slow()|. Alternatively, a user may specify
SizeOrder::Constant. In this case, the storage size of the list itself will
grow by a size_t, and the size of the list will be maintained as elements are
added and removed.
Defined at line 365 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h
Records
-
class AllocChecker -
class BaseList -
class BaseQueue -
class BorrowedOperation -
class BorrowedOperationQueue -
class ContainableBaseClasses -
class DefaultDoublyLinkedListTraits -
class DefaultKeyedObjectTraits -
class DefaultObjectTag -
class DoublyLinkedList -
class DoublyLinkedListNodeState -
class DoublyLinkedListable -
class Operation -
class OperationBase -
class OperationNode -
class OperationNode -
class OperationNode -
class OperationNode -
class OperationPool
Functions
-
template <typename T, typename = std::enable_if_t<std::is_unsigned_v<T>>>bool is_pow2 (T val)is_pow2
<T
>(T val)
Tests to see if val (which may be any unsigned integer type) is a power of 2
or not. 0 is not considered to be a power of 2.
Defined at line 22 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/algorithm.h
-
template <class T,class U,class L = std::conditional_t<sizeof(T) >= sizeof(U), T, U>,class = std::enable_if_t<std::is_unsigned_v<T>>,class = std::enable_if_t<std::is_unsigned_v<U>>>const L round_up (const T & val_, const U & multiple_)round_up rounds up val until it is divisible by multiple.
Zero is divisible by all multiples.
Defined at line 31 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/algorithm.h
-
operation::NodeOptions operator| (operation::NodeOptions A, operation::NodeOptions B)Helper functions which make it a bit easier to use the enum class NodeOptions
in a flag style fashion.
The | operator will take two options and or them together to produce their
composition without needing to do all sorts of nasty casting. In other
words:
operation::NodeOptions::AllowX | operation::NodeOptions::AllowY
is legal.
The
&
operator is overloaded to perform the bitwise and of the
underlying flags and test against zero returning a bool. This allows us to
say things like:
if constexpr (SomeOptions | operation::NodeOptions::AllowX) { ... }
Defined at line 196 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h
-
bool operator& (operation::NodeOptions A, operation::NodeOptions B)Defined at line 202 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h
-
template <typename TagType = DefaultObjectTag, typename Containable>bool InContainer (const Containable & c)These are free function because making it a member function presents
complicated lookup issues since the specific Containable classes exist as
members of the ContainableBaseClasses
<
...>, and you'd need to say
obj.template GetContainableByTag
<TagType
>().InContainer (or
RemoveFromContainer), which is super ugly.
Defined at line 340 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h
-
template <typename TagType = DefaultObjectTagtypename Containable>auto RemoveFromContainer (Containable & c)Defined at line 349 of file ../../src/devices/lib/dev-operation/include/lib/operation/helpers/intrusive_container_utils.h