diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..a3c17cc --- /dev/null +++ b/Doxyfile @@ -0,0 +1,52 @@ +# --------- Project Info --------- +PROJECT_NAME = "Flow" +PROJECT_BRIEF = "Documentation for the Flow C++ Library" +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = NO + +# --------- Build Control --------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_ANON_NSPACES = YES + +# --------- Input Settings --------- +INPUT = DataStructure/ +RECURSIVE = YES +FILE_PATTERNS = flow_*.cpp flow_*.h flow_*.hpp flow_*.cxx flow_*.cc +EXCLUDE = + +# --------- Source Browsing --------- +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +CALL_GRAPH = YES +CALLER_GRAPH = YES + +# --------- Output Formats --------- +GENERATE_HTML = YES +HTML_OUTPUT = . +HTML_FILE_EXTENSION = .html +HTML_COLORSTYLE_HUE = 220 +HTML_DYNAMIC_SECTIONS = YES +GENERATE_LATEX = NO +GENERATE_MAN = NO +GENERATE_RTF = NO +GENERATE_XML = NO +GENERATE_DOCBOOK = NO + +# --------- Markdown Support --------- +MARKDOWN_SUPPORT = +USE_MDFILE_AS_MAINPAGE = + +# --------- Warnings --------- +WARN_IF_UNDOCUMENTED = YES +WARN_NO_PARAMDOC = YES + +# --------- Misc --------- +QUIET = NO +WARNINGS = YES +GENERATE_TREEVIEW = YES +STRIP_FROM_PATH = DataStructure/ diff --git a/docs/annotated.html b/docs/annotated.html new file mode 100644 index 0000000..4a44d6d --- /dev/null +++ b/docs/annotated.html @@ -0,0 +1,131 @@ + + + + + + + +Flow: Class List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + +
 Nflow
 CArenaMemoryResourceA linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation
 CConcurrentFlexQueue
 CNode
 CConcurrentQueue
 CCountedValueViewIteratorIterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage
 CDebugClassDebug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on
 CDefaultMemoryResourceA default memory resource that wraps global ::operator new and ::operator delete
 CMemoryResourceA memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory
 CPolymorphicAllocatorA polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation
 CPoolMemoryResourceA pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory
 CHeader
 CStackMemoryResourceA stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation
 CHeader
 CTimerA simple timer to record timelapses. Uses chrono::steady_clock by default
 CTuple
 CTuple< T, Ts... >
 CVector
 CVectorGrowthStrategy
 CDoubleExpand
 CFibonacciExpand
 CGoldenExpand
+
+
+
+
+ + + + diff --git a/docs/annotated_dup.js b/docs/annotated_dup.js new file mode 100644 index 0000000..8dbbe7b --- /dev/null +++ b/docs/annotated_dup.js @@ -0,0 +1,20 @@ +var annotated_dup = +[ + [ "flow", "namespaceflow.html", [ + [ "ArenaMemoryResource", "classflow_1_1_arena_memory_resource.html", "classflow_1_1_arena_memory_resource" ], + [ "ConcurrentFlexQueue", "classflow_1_1_concurrent_flex_queue.html", "classflow_1_1_concurrent_flex_queue" ], + [ "ConcurrentQueue", "classflow_1_1_concurrent_queue.html", "classflow_1_1_concurrent_queue" ], + [ "CountedValueViewIterator", "classflow_1_1_counted_value_view_iterator.html", "classflow_1_1_counted_value_view_iterator" ], + [ "DebugClass", "classflow_1_1_debug_class.html", "classflow_1_1_debug_class" ], + [ "DefaultMemoryResource", "classflow_1_1_default_memory_resource.html", "classflow_1_1_default_memory_resource" ], + [ "MemoryResource", "classflow_1_1_memory_resource.html", "classflow_1_1_memory_resource" ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html", "classflow_1_1_polymorphic_allocator" ], + [ "PoolMemoryResource", "classflow_1_1_pool_memory_resource.html", "classflow_1_1_pool_memory_resource" ], + [ "StackMemoryResource", "classflow_1_1_stack_memory_resource.html", "classflow_1_1_stack_memory_resource" ], + [ "Timer", "classflow_1_1_timer.html", "classflow_1_1_timer" ], + [ "Tuple", "classflow_1_1_tuple.html", "classflow_1_1_tuple" ], + [ "Tuple< T, Ts... >", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4" ], + [ "Vector", "classflow_1_1_vector.html", "classflow_1_1_vector" ], + [ "VectorGrowthStrategy", "structflow_1_1_vector_growth_strategy.html", "structflow_1_1_vector_growth_strategy" ] + ] ] +]; \ No newline at end of file diff --git a/docs/classes.html b/docs/classes.html new file mode 100644 index 0000000..3b2d84f --- /dev/null +++ b/docs/classes.html @@ -0,0 +1,144 @@ + + + + + + + +Flow: Class Index + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Index
+
+ +
+
+ + + + diff --git a/docs/classflow_1_1_arena_memory_resource-members.html b/docs/classflow_1_1_arena_memory_resource-members.html new file mode 100644 index 0000000..262b5e0 --- /dev/null +++ b/docs/classflow_1_1_arena_memory_resource-members.html @@ -0,0 +1,116 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ArenaMemoryResource Member List
+
+
+ +

This is the complete list of members for flow::ArenaMemoryResource, including all inherited members.

+ + + + + + + + + +
allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
allocateImp(std::size_t bytes, std::size_t alignment) overrideflow::ArenaMemoryResourceinlineprotectedvirtual
ArenaMemoryResource(void *buffer, std::size_t capacity) noexceptflow::ArenaMemoryResourceinlineexplicit
buffer_flow::ArenaMemoryResourceprotected
capacity_flow::ArenaMemoryResourceprotected
deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
deallocateImp(void *address, std::size_t bytes, std::size_t alignment) overrideflow::ArenaMemoryResourceinlineprotectedvirtual
~MemoryResource()=defaultflow::MemoryResourcevirtual
+
+
+ + + + diff --git a/docs/classflow_1_1_arena_memory_resource.html b/docs/classflow_1_1_arena_memory_resource.html new file mode 100644 index 0000000..5bf49e8 --- /dev/null +++ b/docs/classflow_1_1_arena_memory_resource.html @@ -0,0 +1,335 @@ + + + + + + + +Flow: flow::ArenaMemoryResource Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ArenaMemoryResource Class Reference
+
+
+ +

A linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation. + More...

+ +

#include <flow_arena_memory_resource.h>

+
Inheritance diagram for flow::ArenaMemoryResource:
+
+
+ + + + + + + + +

+Public Member Functions

 ArenaMemoryResource (void *buffer, std::size_t capacity) noexcept
Public Member Functions inherited from flow::MemoryResource
virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+ + + +

+Protected Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment) override
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment) override
+ + + +

+Protected Attributes

void * buffer_
std::size_t capacity_
+

Detailed Description

+

A linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation.

+ +

Definition at line 14 of file flow_arena_memory_resource.h.

+

Constructor & Destructor Documentation

+ +

◆ ArenaMemoryResource()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
flow::ArenaMemoryResource::ArenaMemoryResource (void * buffer,
std::size_t capacity )
+
+inlineexplicitnoexcept
+
+ +

Definition at line 16 of file flow_arena_memory_resource.h.

+
17 : buffer_(buffer), capacity_(capacity) {
+
18#ifdef _DEBUG
+
19 beginBuffer_ = buffer;
+
20#endif
+
21 }
+ + +
+
+
+

Member Function Documentation

+ +

◆ allocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
virtual void * flow::ArenaMemoryResource::allocateImp (std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 30 of file flow_arena_memory_resource.h.

+
30 {
+
31 void* aligned = std::align(alignment, bytes, buffer_, capacity_);
+
32 if (!aligned || capacity_ < bytes) {
+
33 throw std::bad_alloc();
+
34 }
+
35
+
36 buffer_ = static_cast<std::byte*>(aligned) + bytes;
+
37 capacity_ -= bytes;
+
38 return aligned;
+
39 }
+
+

References buffer_, and capacity_.

+ +
+
+ +

◆ deallocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
virtual void flow::ArenaMemoryResource::deallocateImp (void * address,
std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 41 of file flow_arena_memory_resource.h.

+
44 {
+
45 assert(address == nullptr || (beginBuffer_ <= address && address <= buffer_));
+
46 }
+
+

References buffer_.

+ +
+
+

Member Data Documentation

+ +

◆ buffer_

+ +
+
+ + + + + +
+ + + + +
void* flow::ArenaMemoryResource::buffer_
+
+protected
+
+ +

Definition at line 27 of file flow_arena_memory_resource.h.

+ +

Referenced by allocateImp(), and deallocateImp().

+ +
+
+ +

◆ capacity_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::ArenaMemoryResource::capacity_
+
+protected
+
+ +

Definition at line 28 of file flow_arena_memory_resource.h.

+ +

Referenced by allocateImp().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_arena_memory_resource.js b/docs/classflow_1_1_arena_memory_resource.js new file mode 100644 index 0000000..2851d09 --- /dev/null +++ b/docs/classflow_1_1_arena_memory_resource.js @@ -0,0 +1,8 @@ +var classflow_1_1_arena_memory_resource = +[ + [ "ArenaMemoryResource", "classflow_1_1_arena_memory_resource.html#ad4978347aee081a4eea9ba60d5c64831", null ], + [ "allocateImp", "classflow_1_1_arena_memory_resource.html#a621223b622d7efd5503f65c9de3aab1b", null ], + [ "deallocateImp", "classflow_1_1_arena_memory_resource.html#a705ea8539ba4774256c621c482cd9493", null ], + [ "buffer_", "classflow_1_1_arena_memory_resource.html#a2d283fc7e546c911ffa7869a23671ad8", null ], + [ "capacity_", "classflow_1_1_arena_memory_resource.html#a7ce070e3a7a006cb5a48223788109ec8", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_arena_memory_resource.png b/docs/classflow_1_1_arena_memory_resource.png new file mode 100644 index 0000000..7a98f93 Binary files /dev/null and b/docs/classflow_1_1_arena_memory_resource.png differ diff --git a/docs/classflow_1_1_concurrent_flex_queue-members.html b/docs/classflow_1_1_concurrent_flex_queue-members.html new file mode 100644 index 0000000..c6c769a --- /dev/null +++ b/docs/classflow_1_1_concurrent_flex_queue-members.html @@ -0,0 +1,124 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ConcurrentFlexQueue< T > Member List
+
+ +
+
+ + + + diff --git a/docs/classflow_1_1_concurrent_flex_queue.html b/docs/classflow_1_1_concurrent_flex_queue.html new file mode 100644 index 0000000..2ecc123 --- /dev/null +++ b/docs/classflow_1_1_concurrent_flex_queue.html @@ -0,0 +1,738 @@ + + + + + + + +Flow: flow::ConcurrentFlexQueue< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ConcurrentFlexQueue< T > Class Template Reference
+
+
+ +

#include <flow_concurrent_flex_queue.h>

+ + + +

+Classes

struct  Node
+ + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ConcurrentFlexQueue ()
 ConcurrentFlexQueue (const ConcurrentFlexQueue &)=delete
 ConcurrentFlexQueue (ConcurrentFlexQueue &&)=delete
ConcurrentFlexQueueoperator= (const ConcurrentFlexQueue &)=delete
ConcurrentFlexQueueoperator= (ConcurrentFlexQueue &&)=delete
bool empty () const
template<typename U>
void push (U &&value)
 Push a new element to the concurrent flex queue.
template<typename ... Args>
void emplace (Args &&... args)
 Construct a new element in the concurrent flex queue inplace.
std::optional< T > tryFront () const
 Try return the first element in the concurrent flex queue. If the concurrent flex queue is empty, then return std::nullopt.
std::optional< T > tryPop ()
 Try pop and return the first element in the concurrent flex queue. If the concurrent flex queue is empty, then return std::nullopt.
waitPop ()
 Wait until the concurrent flex queue has at least one element, then pop and return the first element in the concurrent flex queue.
+ + + + + + +

+Private Attributes

std::unique_ptr< Nodehead_
Nodetail_
std::mutex headMux_ {}
std::mutex tailMux_ {}
std::condition_variable blocked_ {}
+

Detailed Description

+
template<typename T>
+class flow::ConcurrentFlexQueue< T >
+

Definition at line 9 of file flow_concurrent_flex_queue.h.

+

Constructor & Destructor Documentation

+ +

◆ ConcurrentFlexQueue() [1/3]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
flow::ConcurrentFlexQueue< T >::ConcurrentFlexQueue ()
+
+inline
+
+
+ +

◆ ConcurrentFlexQueue() [2/3]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
flow::ConcurrentFlexQueue< T >::ConcurrentFlexQueue (const ConcurrentFlexQueue< T > & )
+
+delete
+
+ +

References ConcurrentFlexQueue().

+ +
+
+ +

◆ ConcurrentFlexQueue() [3/3]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
flow::ConcurrentFlexQueue< T >::ConcurrentFlexQueue (ConcurrentFlexQueue< T > && )
+
+delete
+
+ +

References ConcurrentFlexQueue().

+ +
+
+

Member Function Documentation

+ +

◆ emplace()

+ +
+
+
+template<typename T>
+
+template<typename ... Args>
+ + + + + +
+ + + + + + + +
void flow::ConcurrentFlexQueue< T >::emplace (Args &&... args)
+
+inline
+
+ +

Construct a new element in the concurrent flex queue inplace.

+
Template Parameters
+ + +
...Args
+
+
+
Parameters
+ + +
...argsThe element constructor's arguments.
+
+
+ +

Definition at line 63 of file flow_concurrent_flex_queue.h.

+
63 {
+ +
65 {
+ +
67 tail_->value = T{ std::forward<Args>(args)... };
+
68 tail_->next = std::move(dummy);
+
69 tail_ = tail_->next.get();
+
70 }
+
71 blocked_.notify_one();
+
72 }
+ + +
+

References blocked_, tail_, and tailMux_.

+ +
+
+ +

◆ empty()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
bool flow::ConcurrentFlexQueue< T >::empty () const
+
+inline
+
+
Returns
True if the container size is 0.
+ +

Definition at line 35 of file flow_concurrent_flex_queue.h.

+
35 {
+ +
37 return head_.get() == tail_;
+
38 }
+ +
+

References head_, headMux_, tail_, and tailMux_.

+ +
+
+ +

◆ operator=() [1/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
ConcurrentFlexQueue & flow::ConcurrentFlexQueue< T >::operator= (ConcurrentFlexQueue< T > && )
+
+delete
+
+ +

References ConcurrentFlexQueue().

+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
ConcurrentFlexQueue & flow::ConcurrentFlexQueue< T >::operator= (const ConcurrentFlexQueue< T > & )
+
+delete
+
+ +

References ConcurrentFlexQueue().

+ +
+
+ +

◆ push()

+ +
+
+
+template<typename T>
+
+template<typename U>
+ + + + + +
+ + + + + + + +
void flow::ConcurrentFlexQueue< T >::push (U && value)
+
+inline
+
+ +

Push a new element to the concurrent flex queue.

+
Template Parameters
+ + +
T
+
+
+
Parameters
+ + +
valueThe element to add.
+
+
+ +

Definition at line 46 of file flow_concurrent_flex_queue.h.

+
46 {
+ +
48 {
+ +
50 tail_->value = std::forward<U>(value);
+
51 tail_->next = std::move(dummy);
+
52 tail_ = tail_->next.get();
+
53 }
+
54 blocked_.notify_one();
+
55 }
+
+

References blocked_, tail_, and tailMux_.

+ +
+
+ +

◆ tryFront()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
std::optional< T > flow::ConcurrentFlexQueue< T >::tryFront () const
+
+inline
+
+ +

Try return the first element in the concurrent flex queue. If the concurrent flex queue is empty, then return std::nullopt.

+
Returns
A copy of the first element if not empty, otherwise std::nullopt.
+ +

Definition at line 79 of file flow_concurrent_flex_queue.h.

+
79 {
+ +
81 if (head_.get() == tail_) {
+
82 return std::nullopt;
+
83 }
+
84 return head_->value;
+
85 }
+
+

References head_, headMux_, and tail_.

+ +
+
+ +

◆ tryPop()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
std::optional< T > flow::ConcurrentFlexQueue< T >::tryPop ()
+
+inline
+
+ +

Try pop and return the first element in the concurrent flex queue. If the concurrent flex queue is empty, then return std::nullopt.

+
Returns
The first moved element if not empty, otherwise std::nullopt.
+ +

Definition at line 92 of file flow_concurrent_flex_queue.h.

+
92 {
+ +
94 if (head_.get() == tail_) {
+
95 return std::nullopt;
+
96 }
+
97
+
98 auto oldHead = std::move(head_);
+
99 head_ = std::move(oldHead->next);
+
100 return std::move(oldHead->value);
+
101 }
+
+

References head_, headMux_, and tail_.

+ +
+
+ +

◆ waitPop()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
T flow::ConcurrentFlexQueue< T >::waitPop ()
+
+inline
+
+ +

Wait until the concurrent flex queue has at least one element, then pop and return the first element in the concurrent flex queue.

+
Returns
The first element.
+ +

Definition at line 108 of file flow_concurrent_flex_queue.h.

+
108 {
+ +
110 blocked_.wait(lock, [&]() {
+
111 return head_.get() != tail_;
+
112 });
+
113
+
114 auto oldHead = std::move(head_);
+
115 head_ = std::move(oldHead->next);
+
116 return oldHead->value.value();
+
117 }
+
+

References blocked_, head_, headMux_, and tail_.

+ +
+
+

Member Data Documentation

+ +

◆ blocked_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
std::condition_variable flow::ConcurrentFlexQueue< T >::blocked_ {}
+
+private
+
+ +

Definition at line 20 of file flow_concurrent_flex_queue.h.

+
20{};
+
+

Referenced by emplace(), push(), and waitPop().

+ +
+
+ +

◆ head_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
std::unique_ptr<Node> flow::ConcurrentFlexQueue< T >::head_
+
+private
+
+ +

Definition at line 16 of file flow_concurrent_flex_queue.h.

+ +

Referenced by ConcurrentFlexQueue(), empty(), tryFront(), tryPop(), and waitPop().

+ +
+
+ +

◆ headMux_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
std::mutex flow::ConcurrentFlexQueue< T >::headMux_ {}
+
+mutableprivate
+
+ +

Definition at line 18 of file flow_concurrent_flex_queue.h.

+
18{};
+
+

Referenced by empty(), tryFront(), tryPop(), and waitPop().

+ +
+
+ +

◆ tail_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
Node* flow::ConcurrentFlexQueue< T >::tail_
+
+private
+
+ +

Definition at line 17 of file flow_concurrent_flex_queue.h.

+ +

Referenced by ConcurrentFlexQueue(), emplace(), empty(), push(), tryFront(), tryPop(), and waitPop().

+ +
+
+ +

◆ tailMux_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
std::mutex flow::ConcurrentFlexQueue< T >::tailMux_ {}
+
+mutableprivate
+
+ +

Definition at line 19 of file flow_concurrent_flex_queue.h.

+
19{};
+
+

Referenced by emplace(), empty(), and push().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_concurrent_flex_queue.js b/docs/classflow_1_1_concurrent_flex_queue.js new file mode 100644 index 0000000..40d94a4 --- /dev/null +++ b/docs/classflow_1_1_concurrent_flex_queue.js @@ -0,0 +1,20 @@ +var classflow_1_1_concurrent_flex_queue = +[ + [ "Node", "structflow_1_1_concurrent_flex_queue_1_1_node.html", "structflow_1_1_concurrent_flex_queue_1_1_node" ], + [ "ConcurrentFlexQueue", "classflow_1_1_concurrent_flex_queue.html#aee78e86f8ff1501f4e87d194f506ed5a", null ], + [ "ConcurrentFlexQueue", "classflow_1_1_concurrent_flex_queue.html#a09f21966ef5ef2e1742f538b440e0cba", null ], + [ "ConcurrentFlexQueue", "classflow_1_1_concurrent_flex_queue.html#a4ff791cba6a6534d72c2cbbb4b2d7d0b", null ], + [ "emplace", "classflow_1_1_concurrent_flex_queue.html#a148a7764ab30b8e69d0b32cf9cc4d4f6", null ], + [ "empty", "classflow_1_1_concurrent_flex_queue.html#a1940497155a804e76e5770b0df37290a", null ], + [ "operator=", "classflow_1_1_concurrent_flex_queue.html#ad4c753d4ac97a9d9f108a85c1deae03a", null ], + [ "operator=", "classflow_1_1_concurrent_flex_queue.html#abeff8c5717fce2252e795c0eac78f218", null ], + [ "push", "classflow_1_1_concurrent_flex_queue.html#a7a81c9e4552bf82e2acd32c2e4b0f081", null ], + [ "tryFront", "classflow_1_1_concurrent_flex_queue.html#ac45ab0b7ea0f605549619a7acf41e4b7", null ], + [ "tryPop", "classflow_1_1_concurrent_flex_queue.html#a625000dfe4ec5396867921d8cf686f64", null ], + [ "waitPop", "classflow_1_1_concurrent_flex_queue.html#a9695c97533ad20970414839cbb147374", null ], + [ "blocked_", "classflow_1_1_concurrent_flex_queue.html#af0130ab4a2ff9034c8dd97fbee1fc968", null ], + [ "head_", "classflow_1_1_concurrent_flex_queue.html#a1165f772dc6966274d0cdc8f3fcb562c", null ], + [ "headMux_", "classflow_1_1_concurrent_flex_queue.html#ab888996320d668f06c398d2e886278bc", null ], + [ "tail_", "classflow_1_1_concurrent_flex_queue.html#a40652e3d0f4e7d94a31c1538599ddfe6", null ], + [ "tailMux_", "classflow_1_1_concurrent_flex_queue.html#a547f5e0441bc2eb9420b3880c239d22e", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_concurrent_queue-members.html b/docs/classflow_1_1_concurrent_queue-members.html new file mode 100644 index 0000000..ac7cc38 --- /dev/null +++ b/docs/classflow_1_1_concurrent_queue-members.html @@ -0,0 +1,124 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ConcurrentQueue< T, Container > Member List
+
+ +
+
+ + + + diff --git a/docs/classflow_1_1_concurrent_queue.html b/docs/classflow_1_1_concurrent_queue.html new file mode 100644 index 0000000..b769af6 --- /dev/null +++ b/docs/classflow_1_1_concurrent_queue.html @@ -0,0 +1,744 @@ + + + + + + + +Flow: flow::ConcurrentQueue< T, Container > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::ConcurrentQueue< T, Container > Class Template Reference
+
+
+ +

#include <flow_concurrent_queue.h>

+ + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ConcurrentQueue (const allocator_type &allocator=allocator_type())
 Construct a concurrent queue. The elements follow the FIFO order.
 ConcurrentQueue (const ConcurrentQueue &)=delete
 ConcurrentQueue (ConcurrentQueue &&)=delete
ConcurrentQueueoperator= (const ConcurrentQueue &)=delete
ConcurrentQueueoperator= (ConcurrentQueue &&)=delete
bool empty () const
std::size_t size () const
template<typename U>
void push (U &&value)
 Push a new element to the concurrent queue.
template<typename ... Args>
void emplace (Args &&... args)
 Construct a new element in the concurrent queue inplace.
std::optional< T > tryFront () const
 Try return the first element in the concurrent queue. If the concurrent queue is empty, then return std::nullopt.
std::optional< T > tryPop ()
 Try pop and return the first element in the concurrent queue. If the concurrent queue is empty, then return std::nullopt.
waitPop ()
 Wait until the concurrent queue has at least one element, then pop and return the first element in the concurrent queue.
+ + +

+Private Types

using allocator_type = Container::allocator_type
+ + + + +

+Private Attributes

std::queue< T, Container > queue_
std::mutex mux_ {}
std::condition_variable blocked_ {}
+

Detailed Description

+
template<typename T, typename Container = std::deque<T>>
+class flow::ConcurrentQueue< T, Container >
+

Definition at line 9 of file flow_concurrent_queue.h.

+

Member Typedef Documentation

+ +

◆ allocator_type

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + +
using flow::ConcurrentQueue< T, Container >::allocator_type = Container::allocator_type
+
+private
+
+ +

Definition at line 10 of file flow_concurrent_queue.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ ConcurrentQueue() [1/3]

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
flow::ConcurrentQueue< T, Container >::ConcurrentQueue (const allocator_type & allocator = allocator_type())
+
+inlineexplicit
+
+ +

Construct a concurrent queue. The elements follow the FIFO order.

+
Parameters
+ + +
allocatorallocates the elements in the concurrent queue.
+
+
+ +

Definition at line 21 of file flow_concurrent_queue.h.

+
22 : queue_(allocator) {
+
23 }
+ +
std::queue< T, Container > queue_
+
+

References queue_.

+ +

Referenced by ConcurrentQueue(), ConcurrentQueue(), operator=(), and operator=().

+ +
+
+ +

◆ ConcurrentQueue() [2/3]

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
flow::ConcurrentQueue< T, Container >::ConcurrentQueue (const ConcurrentQueue< T, Container > & )
+
+delete
+
+ +

References ConcurrentQueue().

+ +
+
+ +

◆ ConcurrentQueue() [3/3]

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
flow::ConcurrentQueue< T, Container >::ConcurrentQueue (ConcurrentQueue< T, Container > && )
+
+delete
+
+ +

References ConcurrentQueue().

+ +
+
+

Member Function Documentation

+ +

◆ emplace()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+
+template<typename ... Args>
+ + + + + +
+ + + + + + + +
void flow::ConcurrentQueue< T, Container >::emplace (Args &&... args)
+
+inline
+
+ +

Construct a new element in the concurrent queue inplace.

+
Template Parameters
+ + +
...Args
+
+
+
Parameters
+ + +
...argsThe element constructor's arguments.
+
+
+ +

Definition at line 66 of file flow_concurrent_queue.h.

+
66 {
+
67 {
+ +
69 queue_.emplace(std::forward<Args>(args)...);
+
70 }
+
71 blocked_.notify_one();
+
72 }
+ +
std::condition_variable blocked_
+
+

References blocked_, mux_, and queue_.

+ +
+
+ +

◆ empty()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
bool flow::ConcurrentQueue< T, Container >::empty () const
+
+inline
+
+
Returns
True if the container size is 0.
+ +

Definition at line 33 of file flow_concurrent_queue.h.

+
33 {
+ +
35 return queue_.empty();
+
36 }
+
+

References mux_, and queue_.

+ +
+
+ +

◆ operator=() [1/2]

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
ConcurrentQueue & flow::ConcurrentQueue< T, Container >::operator= (ConcurrentQueue< T, Container > && )
+
+delete
+
+ +

References ConcurrentQueue().

+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
ConcurrentQueue & flow::ConcurrentQueue< T, Container >::operator= (const ConcurrentQueue< T, Container > & )
+
+delete
+
+ +

References ConcurrentQueue().

+ +
+
+ +

◆ push()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+
+template<typename U>
+ + + + + +
+ + + + + + + +
void flow::ConcurrentQueue< T, Container >::push (U && value)
+
+inline
+
+ +

Push a new element to the concurrent queue.

+
Template Parameters
+ + +
T
+
+
+
Parameters
+ + +
valueThe element to add.
+
+
+ +

Definition at line 52 of file flow_concurrent_queue.h.

+
52 {
+
53 {
+ + +
56 }
+
57 blocked_.notify_one();
+
58 }
+
+

References blocked_, mux_, and queue_.

+ +
+
+ +

◆ size()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
std::size_t flow::ConcurrentQueue< T, Container >::size () const
+
+inline
+
+
Returns
The number of elements in the concurrent queue.
+ +

Definition at line 41 of file flow_concurrent_queue.h.

+
41 {
+ +
43 return queue_.size();
+
44 }
+
+

References mux_, and queue_.

+ +
+
+ +

◆ tryFront()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
std::optional< T > flow::ConcurrentQueue< T, Container >::tryFront () const
+
+inline
+
+ +

Try return the first element in the concurrent queue. If the concurrent queue is empty, then return std::nullopt.

+
Returns
A copy of the first element if not empty, otherwise std::nullopt.
+ +

Definition at line 79 of file flow_concurrent_queue.h.

+
79 {
+ +
81 if (queue_.empty()) {
+
82 return std::nullopt;
+
83 }
+
84 return queue_.front();
+
85 }
+
+

References mux_, and queue_.

+ +
+
+ +

◆ tryPop()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
std::optional< T > flow::ConcurrentQueue< T, Container >::tryPop ()
+
+inline
+
+ +

Try pop and return the first element in the concurrent queue. If the concurrent queue is empty, then return std::nullopt.

+
Returns
The first moved element if not empty, otherwise std::nullopt.
+ +

Definition at line 92 of file flow_concurrent_queue.h.

+
92 {
+ +
94 if (queue_.empty()) {
+
95 return std::nullopt;
+
96 }
+
97
+ +
99 queue_.pop();
+
100 return value;
+
101 }
+
+

References mux_, and queue_.

+ +
+
+ +

◆ waitPop()

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + + + + +
T flow::ConcurrentQueue< T, Container >::waitPop ()
+
+inline
+
+ +

Wait until the concurrent queue has at least one element, then pop and return the first element in the concurrent queue.

+
Returns
The first element.
+ +

Definition at line 108 of file flow_concurrent_queue.h.

+
108 {
+ +
110 blocked_.wait(lock, [&]() {
+
111 return !queue_.empty();
+
112 });
+
113
+
114 T value = std::move(queue_.front());
+
115 queue_.pop();
+
116 return value;
+
117 }
+
+

References blocked_, mux_, and queue_.

+ +
+
+

Member Data Documentation

+ +

◆ blocked_

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + +
std::condition_variable flow::ConcurrentQueue< T, Container >::blocked_ {}
+
+private
+
+ +

Definition at line 14 of file flow_concurrent_queue.h.

+
14{};
+
+

Referenced by emplace(), push(), and waitPop().

+ +
+
+ +

◆ mux_

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + +
std::mutex flow::ConcurrentQueue< T, Container >::mux_ {}
+
+mutableprivate
+
+ +

Definition at line 13 of file flow_concurrent_queue.h.

+
13{};
+
+

Referenced by emplace(), empty(), push(), size(), tryFront(), tryPop(), and waitPop().

+ +
+
+ +

◆ queue_

+ +
+
+
+template<typename T, typename Container = std::deque<T>>
+ + + + + +
+ + + + +
std::queue<T, Container> flow::ConcurrentQueue< T, Container >::queue_
+
+private
+
+ +

Definition at line 12 of file flow_concurrent_queue.h.

+ +

Referenced by ConcurrentQueue(), emplace(), empty(), push(), size(), tryFront(), tryPop(), and waitPop().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_concurrent_queue.js b/docs/classflow_1_1_concurrent_queue.js new file mode 100644 index 0000000..393ae54 --- /dev/null +++ b/docs/classflow_1_1_concurrent_queue.js @@ -0,0 +1,19 @@ +var classflow_1_1_concurrent_queue = +[ + [ "allocator_type", "classflow_1_1_concurrent_queue.html#af4048108b7a00a714017892338c92ac6", null ], + [ "ConcurrentQueue", "classflow_1_1_concurrent_queue.html#a33be3ac6f7a386943a9bf1b73b15af7d", null ], + [ "ConcurrentQueue", "classflow_1_1_concurrent_queue.html#abdcc25822ea84611d059f0164c29bf40", null ], + [ "ConcurrentQueue", "classflow_1_1_concurrent_queue.html#a9afa84e43f840bafec48b21caf7f3243", null ], + [ "emplace", "classflow_1_1_concurrent_queue.html#a921fb77ec80aefbf0954a21ebfe49d67", null ], + [ "empty", "classflow_1_1_concurrent_queue.html#af0e073c9657bbc9ac2a70e97df5a1d1d", null ], + [ "operator=", "classflow_1_1_concurrent_queue.html#ab09b66803142e1105763c5887ec1c546", null ], + [ "operator=", "classflow_1_1_concurrent_queue.html#a3f76748bdaf041ab31cf52b0faef44fe", null ], + [ "push", "classflow_1_1_concurrent_queue.html#a8afd8f92a60a59cf6c42da30a6eb2a0e", null ], + [ "size", "classflow_1_1_concurrent_queue.html#ad62cf85a47644dbbb06268bdc68988bc", null ], + [ "tryFront", "classflow_1_1_concurrent_queue.html#a28100c215fb8bd848e8311f5f8165bb2", null ], + [ "tryPop", "classflow_1_1_concurrent_queue.html#a5c0d191969f644b6146ffb547f07e19f", null ], + [ "waitPop", "classflow_1_1_concurrent_queue.html#a0bf4edf07e01dc7ac12f2277f71230ef", null ], + [ "blocked_", "classflow_1_1_concurrent_queue.html#ae41447f6c7b2caafcbfce2533219ad0c", null ], + [ "mux_", "classflow_1_1_concurrent_queue.html#a3f443bd583da922327024612530e33ea", null ], + [ "queue_", "classflow_1_1_concurrent_queue.html#ac343336ca09c2e09f85c0f17addc1010", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_counted_value_view_iterator-members.html b/docs/classflow_1_1_counted_value_view_iterator-members.html new file mode 100644 index 0000000..11b7249 --- /dev/null +++ b/docs/classflow_1_1_counted_value_view_iterator-members.html @@ -0,0 +1,123 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::CountedValueViewIterator< T > Member List
+
+ +
+
+ + + + diff --git a/docs/classflow_1_1_counted_value_view_iterator.html b/docs/classflow_1_1_counted_value_view_iterator.html new file mode 100644 index 0000000..aaa76b5 --- /dev/null +++ b/docs/classflow_1_1_counted_value_view_iterator.html @@ -0,0 +1,601 @@ + + + + + + + +Flow: flow::CountedValueViewIterator< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::CountedValueViewIterator< T > Class Template Reference
+
+
+ +

Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage. + More...

+ +

#include <flow_counted_value_view_iterator.h>

+ + + + + + + +

+Public Types

using value_type = T
using reference = const T&
using pointer = const T*
using difference_type = std::ptrdiff_t
using iterator_category = std::forward_iterator_tag
+ + + + + + + +

+Public Member Functions

 CountedValueViewIterator ()
 CountedValueViewIterator (const T &value, std::size_t count=0)
const T & operator* () const
const T * operator-> () const
CountedValueViewIteratoroperator++ ()
CountedValueViewIterator operator++ (int)
+ + + +

+Private Attributes

const T * value_
std::size_t count_
+ + + +

+Friends

bool operator== (const CountedValueViewIterator &lhs, const CountedValueViewIterator &rhs)
bool operator!= (const CountedValueViewIterator &lhs, const CountedValueViewIterator &rhs)
+

Detailed Description

+
template<typename T>
+class flow::CountedValueViewIterator< T >

Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage.

+ +

Definition at line 13 of file flow_counted_value_view_iterator.h.

+

Member Typedef Documentation

+ +

◆ difference_type

+ +
+
+
+template<typename T>
+ + + + +
using flow::CountedValueViewIterator< T >::difference_type = std::ptrdiff_t
+
+ +

Definition at line 21 of file flow_counted_value_view_iterator.h.

+ +
+
+ +

◆ iterator_category

+ +
+
+
+template<typename T>
+ + + + +
using flow::CountedValueViewIterator< T >::iterator_category = std::forward_iterator_tag
+
+ +

Definition at line 22 of file flow_counted_value_view_iterator.h.

+ +
+
+ +

◆ pointer

+ +
+
+
+template<typename T>
+ + + + +
using flow::CountedValueViewIterator< T >::pointer = const T*
+
+ +

Definition at line 20 of file flow_counted_value_view_iterator.h.

+ +
+
+ +

◆ reference

+ +
+
+
+template<typename T>
+ + + + +
using flow::CountedValueViewIterator< T >::reference = const T&
+
+ +

Definition at line 19 of file flow_counted_value_view_iterator.h.

+ +
+
+ +

◆ value_type

+ +
+
+
+template<typename T>
+ + + + +
using flow::CountedValueViewIterator< T >::value_type = T
+
+ +

Definition at line 18 of file flow_counted_value_view_iterator.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ CountedValueViewIterator() [1/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
flow::CountedValueViewIterator< T >::CountedValueViewIterator ()
+
+inline
+
+ +

Definition at line 24 of file flow_counted_value_view_iterator.h.

+ +

References count_, and value_.

+ +

Referenced by operator!=, operator++(), operator++(), and operator==.

+ +
+
+ +

◆ CountedValueViewIterator() [2/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
flow::CountedValueViewIterator< T >::CountedValueViewIterator (const T & value,
std::size_t count = 0 )
+
+inline
+
+ +

Definition at line 28 of file flow_counted_value_view_iterator.h.

+
28 :
+ +
30 }
+
Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual ran...
+
+

References count_, and value_.

+ +
+
+

Member Function Documentation

+ +

◆ operator*()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
const T & flow::CountedValueViewIterator< T >::operator* () const
+
+inline
+
+ +

Definition at line 32 of file flow_counted_value_view_iterator.h.

+
32 {
+
33 assert(value_ && "no value");
+
34 return *value_;
+
35 }
+
+

References value_.

+ +
+
+ +

◆ operator++() [1/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
CountedValueViewIterator & flow::CountedValueViewIterator< T >::operator++ ()
+
+inline
+
+ +

Definition at line 42 of file flow_counted_value_view_iterator.h.

+
42 {
+
43 assert(count_ > 0 && "negative count");
+
44 --count_;
+
45 return *this;
+
46 }
+
+

References count_, and CountedValueViewIterator().

+ +
+
+ +

◆ operator++() [2/2]

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
CountedValueViewIterator flow::CountedValueViewIterator< T >::operator++ (int )
+
+inline
+
+ +

Definition at line 48 of file flow_counted_value_view_iterator.h.

+
48 {
+ +
50 --count_;
+
51 return cpy;
+
52 }
+ +
+

References count_, and CountedValueViewIterator().

+ +
+
+ +

◆ operator->()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + +
const T * flow::CountedValueViewIterator< T >::operator-> () const
+
+inline
+
+ +

Definition at line 37 of file flow_counted_value_view_iterator.h.

+
37 {
+
38 assert(value_ && "no value");
+
39 return value_;
+
40 }
+
+

References value_.

+ +
+
+ + +

◆ operator!=

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
bool operator!= (const CountedValueViewIterator< T > & lhs,
const CountedValueViewIterator< T > & rhs )
+
+friend
+
+ +

Definition at line 58 of file flow_counted_value_view_iterator.h.

+
58 {
+
59 return !(lhs == rhs);
+
60 }
+
+

References CountedValueViewIterator().

+ +
+
+ +

◆ operator==

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
bool operator== (const CountedValueViewIterator< T > & lhs,
const CountedValueViewIterator< T > & rhs )
+
+friend
+
+ +

Definition at line 54 of file flow_counted_value_view_iterator.h.

+
54 {
+
55 return lhs.count_ == rhs.count_ && lhs.value_ == rhs.value_;
+
56 }
+
+

References count_, CountedValueViewIterator(), and value_.

+ +
+
+

Member Data Documentation

+ +

◆ count_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
std::size_t flow::CountedValueViewIterator< T >::count_
+
+private
+
+
+ +

◆ value_

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + +
const T* flow::CountedValueViewIterator< T >::value_
+
+private
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_counted_value_view_iterator.js b/docs/classflow_1_1_counted_value_view_iterator.js new file mode 100644 index 0000000..bd35cc7 --- /dev/null +++ b/docs/classflow_1_1_counted_value_view_iterator.js @@ -0,0 +1,18 @@ +var classflow_1_1_counted_value_view_iterator = +[ + [ "difference_type", "classflow_1_1_counted_value_view_iterator.html#ab15d7850ec1d51e9c23b298d79009207", null ], + [ "iterator_category", "classflow_1_1_counted_value_view_iterator.html#ae3c6ce089aca7af55dbd0ea85d083a0b", null ], + [ "pointer", "classflow_1_1_counted_value_view_iterator.html#a46c830285785216a842c7cb504b56e72", null ], + [ "reference", "classflow_1_1_counted_value_view_iterator.html#a4fffa537ac2693dd8f3258b909575de9", null ], + [ "value_type", "classflow_1_1_counted_value_view_iterator.html#acaef28f35bd304c4e561f6ec4aea2d00", null ], + [ "CountedValueViewIterator", "classflow_1_1_counted_value_view_iterator.html#aec5e48263e265314df292c11b62b780d", null ], + [ "CountedValueViewIterator", "classflow_1_1_counted_value_view_iterator.html#ae5fcbb0fd603cd40e5562d3f76f846df", null ], + [ "operator*", "classflow_1_1_counted_value_view_iterator.html#a15cd12e7b60ac56f657362dda2c5dc68", null ], + [ "operator++", "classflow_1_1_counted_value_view_iterator.html#afd00e1df6549e44a2429e929d8bdf909", null ], + [ "operator++", "classflow_1_1_counted_value_view_iterator.html#a7fd5897e27305768eaf068cbe4644de5", null ], + [ "operator->", "classflow_1_1_counted_value_view_iterator.html#a634a2db73627fcbd4fee77e1a3c2375e", null ], + [ "operator!=", "classflow_1_1_counted_value_view_iterator.html#ab5abdaf11e4149bbc1cbbdf620845ef9", null ], + [ "operator==", "classflow_1_1_counted_value_view_iterator.html#ad74bbd8d67a9bf77887a1825d158a94b", null ], + [ "count_", "classflow_1_1_counted_value_view_iterator.html#afa83583c08318439349f6b901aee9b78", null ], + [ "value_", "classflow_1_1_counted_value_view_iterator.html#afe83d60be27bae44aeaf8df0b1daf17a", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_debug_class-members.html b/docs/classflow_1_1_debug_class-members.html new file mode 100644 index 0000000..2264e2d --- /dev/null +++ b/docs/classflow_1_1_debug_class-members.html @@ -0,0 +1,119 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::DebugClass Member List
+
+
+ +

This is the complete list of members for flow::DebugClass, including all inherited members.

+ + + + + + + + + + + + +
copies_flow::DebugClassprivate
copyCounter_flow::DebugClassprivate
DebugClass()flow::DebugClassinline
DebugClass(const DebugClass &rhs)flow::DebugClassinline
DebugClass(DebugClass &&rhs) noexceptflow::DebugClassinline
globalIdflow::DebugClassinlineprivatestatic
id_flow::DebugClassprivate
operator<<(std::ostream &out, const DebugClass &obj)flow::DebugClassfriend
operator=(const DebugClass &rhs)flow::DebugClassinline
operator=(DebugClass &&rhs) noexceptflow::DebugClassinline
~DebugClass()flow::DebugClassinline
+
+
+ + + + diff --git a/docs/classflow_1_1_debug_class.html b/docs/classflow_1_1_debug_class.html new file mode 100644 index 0000000..169b0fd --- /dev/null +++ b/docs/classflow_1_1_debug_class.html @@ -0,0 +1,505 @@ + + + + + + + +Flow: flow::DebugClass Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::DebugClass Class Reference
+
+
+ +

Debug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on. + More...

+ +

#include <flow_debug_memory.h>

+ + + + + + + + +

+Public Member Functions

 DebugClass ()
 DebugClass (const DebugClass &rhs)
 DebugClass (DebugClass &&rhs) noexcept
 ~DebugClass ()
DebugClassoperator= (const DebugClass &rhs)
DebugClassoperator= (DebugClass &&rhs) noexcept
+ + + + +

+Private Attributes

std::shared_ptr< std::size_t > copyCounter_
std::size_t copies_
std::size_t id_
+ + +

+Static Private Attributes

static std::size_t globalId = 0
+ + +

+Friends

std::ostream & operator<< (std::ostream &out, const DebugClass &obj)
+

Detailed Description

+

Debug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on.

+ +

Definition at line 27 of file flow_debug_memory.h.

+

Constructor & Destructor Documentation

+ +

◆ DebugClass() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
flow::DebugClass::DebugClass ()
+
+inline
+
+ +

Definition at line 33 of file flow_debug_memory.h.

+
34 : copyCounter_(std::make_shared<std::size_t>(0)),
+
35 copies_(0),
+
36 id_(globalId++) {
+
37 std::cout << std::format("default_ctor id {}, copies {}\n", id_, copies_);
+
38 }
+ +
static std::size_t globalId
+ +
std::shared_ptr< std::size_t > copyCounter_
+
+

References copies_, copyCounter_, globalId, and id_.

+ +

Referenced by DebugClass(), DebugClass(), operator<<, operator=(), and operator=().

+ +
+
+ +

◆ DebugClass() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
flow::DebugClass::DebugClass (const DebugClass & rhs)
+
+inline
+
+ +

Definition at line 40 of file flow_debug_memory.h.

+
41 : copyCounter_(rhs.copyCounter_),
+ +
43 id_(rhs.id_) {
+
44
+
45 std::cout << std::format("copy_ctor id {}, copies {}\n", id_, copies_);
+
46 }
+
+

References copies_, copyCounter_, DebugClass(), and id_.

+ +
+
+ +

◆ DebugClass() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
flow::DebugClass::DebugClass (DebugClass && rhs)
+
+inlinenoexcept
+
+ +

Definition at line 48 of file flow_debug_memory.h.

+
49 : copyCounter_(std::move(rhs.copyCounter_)),
+
50 copies_(rhs.copies_),
+
51 id_(rhs.id_) {
+
52 std::cout << std::format("move_ctor id {}, copies {}\n", id_, copies_);
+
53 }
+
+

References copies_, DebugClass(), and id_.

+ +
+
+ +

◆ ~DebugClass()

+ +
+
+ + + + + +
+ + + + + + + +
flow::DebugClass::~DebugClass ()
+
+inline
+
+ +

Definition at line 55 of file flow_debug_memory.h.

+
55 {
+
56 std::cout << std::format("dtor id {}, copies {}\n", id_, copies_);
+
57 }
+
+

References copies_, and id_.

+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
DebugClass & flow::DebugClass::operator= (const DebugClass & rhs)
+
+inline
+
+ +

Definition at line 59 of file flow_debug_memory.h.

+
59 {
+
60 copyCounter_ = rhs.copyCounter_;
+
61 copies_ = ++(*copyCounter_);
+
62 id_ = rhs.id_;
+
63 std::cout << std::format("copy_op id {}, copies {}\n", id_, copies_);
+
64 }
+
+

References copies_, copyCounter_, DebugClass(), and id_.

+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
DebugClass & flow::DebugClass::operator= (DebugClass && rhs)
+
+inlinenoexcept
+
+ +

Definition at line 66 of file flow_debug_memory.h.

+
66 {
+
67 copyCounter_ = std::move(rhs.copyCounter_);
+
68 copies_ = rhs.copies_;
+
69 id_ = rhs.id_;
+
70 std::cout << std::format("move_op id {}, copies {}\n", id_, copies_);
+
71 }
+
+

References copies_, copyCounter_, DebugClass(), and id_.

+ +
+
+ + +

◆ operator<<

+ +
+
+ + + + + +
+ + + + + + + + + + + +
std::ostream & operator<< (std::ostream & out,
const DebugClass & obj )
+
+friend
+
+ +

Definition at line 76 of file flow_debug_memory.h.

+
76 {
+
77 out << std::format("{{id: {}, copies: {}}}", obj.id_, obj.copies_);
+
78 return out;
+
79 }
+
+

References copies_, DebugClass(), and id_.

+ +
+
+

Member Data Documentation

+ +

◆ copies_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::DebugClass::copies_
+
+private
+
+ +

Definition at line 29 of file flow_debug_memory.h.

+ +

Referenced by DebugClass(), DebugClass(), DebugClass(), operator<<, operator=(), operator=(), and ~DebugClass().

+ +
+
+ +

◆ copyCounter_

+ +
+
+ + + + + +
+ + + + +
std::shared_ptr<std::size_t> flow::DebugClass::copyCounter_
+
+private
+
+ +

Definition at line 28 of file flow_debug_memory.h.

+ +

Referenced by DebugClass(), DebugClass(), operator=(), and operator=().

+ +
+
+ +

◆ globalId

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::DebugClass::globalId = 0
+
+inlinestaticprivate
+
+ +

Definition at line 74 of file flow_debug_memory.h.

+ +

Referenced by DebugClass().

+ +
+
+ +

◆ id_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::DebugClass::id_
+
+private
+
+ +

Definition at line 30 of file flow_debug_memory.h.

+ +

Referenced by DebugClass(), DebugClass(), DebugClass(), operator<<, operator=(), operator=(), and ~DebugClass().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_debug_class.js b/docs/classflow_1_1_debug_class.js new file mode 100644 index 0000000..14be86a --- /dev/null +++ b/docs/classflow_1_1_debug_class.js @@ -0,0 +1,14 @@ +var classflow_1_1_debug_class = +[ + [ "DebugClass", "classflow_1_1_debug_class.html#a31d3750a346067255700270ac37a8248", null ], + [ "DebugClass", "classflow_1_1_debug_class.html#a29fd182d9df656b7531b0cb829c7a629", null ], + [ "DebugClass", "classflow_1_1_debug_class.html#ac6e3df93ac573336f3a0a267ab6b18e1", null ], + [ "~DebugClass", "classflow_1_1_debug_class.html#a48a695f9cec5b0115ebdf61a5f15b5ea", null ], + [ "operator=", "classflow_1_1_debug_class.html#a306b6c316e11e3d9d7fb1adf140a98df", null ], + [ "operator=", "classflow_1_1_debug_class.html#a04f020eccd10fcb93503add61ba461db", null ], + [ "operator<<", "classflow_1_1_debug_class.html#ac9ebd40c457de9d9aad379e360f3e66f", null ], + [ "copies_", "classflow_1_1_debug_class.html#a741bd5a98db4e7cae036ac8148fdf0df", null ], + [ "copyCounter_", "classflow_1_1_debug_class.html#ae52bd2c39871159b4c0f89aca547c2a7", null ], + [ "globalId", "classflow_1_1_debug_class.html#aa914f20c66eb15c818bbe0fb2df89b9e", null ], + [ "id_", "classflow_1_1_debug_class.html#ac375c9dca9062cebadebc94198dc1996", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_default_memory_resource-members.html b/docs/classflow_1_1_default_memory_resource-members.html new file mode 100644 index 0000000..6113cfd --- /dev/null +++ b/docs/classflow_1_1_default_memory_resource-members.html @@ -0,0 +1,114 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::DefaultMemoryResource Member List
+
+
+ +

This is the complete list of members for flow::DefaultMemoryResource, including all inherited members.

+ + + + + + + +
allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
allocateImp(std::size_t bytes, std::size_t alignment)flow::DefaultMemoryResourceinlineprivatevirtual
deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
deallocateImp(void *address, std::size_t bytes, std::size_t alignment)flow::DefaultMemoryResourceinlineprivatevirtual
getResource()flow::DefaultMemoryResourceinlinestatic
~MemoryResource()=defaultflow::MemoryResourcevirtual
+
+
+ + + + diff --git a/docs/classflow_1_1_default_memory_resource.html b/docs/classflow_1_1_default_memory_resource.html new file mode 100644 index 0000000..dc044f1 --- /dev/null +++ b/docs/classflow_1_1_default_memory_resource.html @@ -0,0 +1,261 @@ + + + + + + + +Flow: flow::DefaultMemoryResource Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::DefaultMemoryResource Class Reference
+
+
+ +

A default memory resource that wraps global ::operator new and ::operator delete. + More...

+ +

#include <flow_default_memory_resource.h>

+
Inheritance diagram for flow::DefaultMemoryResource:
+
+
+ + + + +

+Static Public Member Functions

static DefaultMemoryResourcegetResource ()
+ + + +

+Private Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment)
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment)
+ + + + + +

+Additional Inherited Members

Public Member Functions inherited from flow::MemoryResource
virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+

Detailed Description

+

A default memory resource that wraps global ::operator new and ::operator delete.

+ +

Definition at line 9 of file flow_default_memory_resource.h.

+

Member Function Documentation

+ +

◆ allocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
virtual void * flow::DefaultMemoryResource::allocateImp (std::size_t bytes,
std::size_t alignment )
+
+inlineprivatevirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 17 of file flow_default_memory_resource.h.

+
17 {
+
18 return ::operator new(bytes, static_cast<std::align_val_t>(alignment));
+
19 }
+
+
+
+ +

◆ deallocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
virtual void flow::DefaultMemoryResource::deallocateImp (void * address,
std::size_t bytes,
std::size_t alignment )
+
+inlineprivatevirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 21 of file flow_default_memory_resource.h.

+
21 {
+
22 ::operator delete(address, static_cast<std::align_val_t>(alignment));
+
23 }
+
+
+
+ +

◆ getResource()

+ +
+
+ + + + + +
+ + + + + + + +
DefaultMemoryResource & flow::DefaultMemoryResource::getResource ()
+
+inlinestatic
+
+ +

Definition at line 11 of file flow_default_memory_resource.h.

+
11 {
+
12 static DefaultMemoryResource instance{};
+
13 return instance;
+
14 }
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_default_memory_resource.js b/docs/classflow_1_1_default_memory_resource.js new file mode 100644 index 0000000..376226f --- /dev/null +++ b/docs/classflow_1_1_default_memory_resource.js @@ -0,0 +1,6 @@ +var classflow_1_1_default_memory_resource = +[ + [ "allocateImp", "classflow_1_1_default_memory_resource.html#a5b3b10ccc61e2b8d17606eb5fc0f1627", null ], + [ "deallocateImp", "classflow_1_1_default_memory_resource.html#ae780c88790db29cf6e74b2363463f86d", null ], + [ "getResource", "classflow_1_1_default_memory_resource.html#a01bea59a2f2d07da11856e060153a08f", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_default_memory_resource.png b/docs/classflow_1_1_default_memory_resource.png new file mode 100644 index 0000000..1607749 Binary files /dev/null and b/docs/classflow_1_1_default_memory_resource.png differ diff --git a/docs/classflow_1_1_memory_resource-members.html b/docs/classflow_1_1_memory_resource-members.html new file mode 100644 index 0000000..0082dc2 --- /dev/null +++ b/docs/classflow_1_1_memory_resource-members.html @@ -0,0 +1,113 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::MemoryResource Member List
+
+
+ +

This is the complete list of members for flow::MemoryResource, including all inherited members.

+ + + + + + +
allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
allocateImp(std::size_t bytes, std::size_t alignment)=0flow::MemoryResourceprotectedpure virtual
deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
deallocateImp(void *address, std::size_t bytes, std::size_t alignment)=0flow::MemoryResourceprotectedpure virtual
~MemoryResource()=defaultflow::MemoryResourcevirtual
+
+
+ + + + diff --git a/docs/classflow_1_1_memory_resource.html b/docs/classflow_1_1_memory_resource.html new file mode 100644 index 0000000..d69903e --- /dev/null +++ b/docs/classflow_1_1_memory_resource.html @@ -0,0 +1,327 @@ + + + + + + + +Flow: flow::MemoryResource Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::MemoryResource Class Referenceabstract
+
+
+ +

A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory. + More...

+ +

#include <flow_memory_resource.h>

+
Inheritance diagram for flow::MemoryResource:
+
+
+ + + + + + +

+Public Member Functions

virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+ + + +

+Protected Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment)=0
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment)=0
+

Detailed Description

+

A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory.

+ +

Definition at line 10 of file flow_memory_resource.h.

+

Constructor & Destructor Documentation

+ +

◆ ~MemoryResource()

+ +
+
+ + + + + +
+ + + + + + + +
virtual flow::MemoryResource::~MemoryResource ()
+
+virtualdefault
+
+ +
+
+

Member Function Documentation

+ +

◆ allocate()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
void * flow::MemoryResource::allocate (std::size_t bytes,
std::size_t alignment = alignof(std::max_align_t) )
+
+inline
+
+ +

Definition at line 14 of file flow_memory_resource.h.

+
14 {
+
15 return allocateImp(bytes, alignment);
+
16 }
+
virtual void * allocateImp(std::size_t bytes, std::size_t alignment)=0
+
+

References allocateImp().

+ +
+
+ +

◆ allocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
virtual void * flow::MemoryResource::allocateImp (std::size_t bytes,
std::size_t alignment )
+
+protectedpure virtual
+
+
+ +

◆ deallocate()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
void flow::MemoryResource::deallocate (void * address,
std::size_t bytes,
std::size_t alignment = alignof(std::max_align_t) )
+
+inline
+
+ +

Definition at line 18 of file flow_memory_resource.h.

+
18 {
+
19 deallocateImp(address, bytes, alignment);
+
20 }
+
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment)=0
+
+

References deallocateImp().

+ +
+
+ +

◆ deallocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
virtual void flow::MemoryResource::deallocateImp (void * address,
std::size_t bytes,
std::size_t alignment )
+
+protectedpure virtual
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_memory_resource.js b/docs/classflow_1_1_memory_resource.js new file mode 100644 index 0000000..d0c2c63 --- /dev/null +++ b/docs/classflow_1_1_memory_resource.js @@ -0,0 +1,8 @@ +var classflow_1_1_memory_resource = +[ + [ "~MemoryResource", "classflow_1_1_memory_resource.html#aed7eed2f0372002ff66df9decc501071", null ], + [ "allocate", "classflow_1_1_memory_resource.html#a5f348b979d67c8503d67d6a5ec7bfda9", null ], + [ "allocateImp", "classflow_1_1_memory_resource.html#a8179af2eb6e69df16d8ee3d82286ec10", null ], + [ "deallocate", "classflow_1_1_memory_resource.html#a624ccdb4ce7db4bb30ccf43ef8802352", null ], + [ "deallocateImp", "classflow_1_1_memory_resource.html#a0fe4fd1de140064284dee1cc16c33e21", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_memory_resource.png b/docs/classflow_1_1_memory_resource.png new file mode 100644 index 0000000..1a321e5 Binary files /dev/null and b/docs/classflow_1_1_memory_resource.png differ diff --git a/docs/classflow_1_1_polymorphic_allocator-members.html b/docs/classflow_1_1_polymorphic_allocator-members.html new file mode 100644 index 0000000..03b42a3 --- /dev/null +++ b/docs/classflow_1_1_polymorphic_allocator-members.html @@ -0,0 +1,120 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::PolymorphicAllocator< T > Member List
+
+
+ +

This is the complete list of members for flow::PolymorphicAllocator< T >, including all inherited members.

+ + + + + + + + + + + + + +
allocate(std::size_t count)flow::PolymorphicAllocator< T >inline
construct(U *address, Args &&... args)flow::PolymorphicAllocator< T >inline
deallocate(T *address, std::size_t count) noexceptflow::PolymorphicAllocator< T >inline
destroy(U *address) noexceptflow::PolymorphicAllocator< T >inline
operator!=(const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)flow::PolymorphicAllocator< T >friend
operator==(const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)flow::PolymorphicAllocator< T >friend
PolymorphicAllocator classflow::PolymorphicAllocator< T >friend
PolymorphicAllocator()flow::PolymorphicAllocator< T >inline
PolymorphicAllocator(MemoryResource &resource)flow::PolymorphicAllocator< T >inlineexplicit
PolymorphicAllocator(const PolymorphicAllocator< U > &allocator) noexceptflow::PolymorphicAllocator< T >inline
resource_flow::PolymorphicAllocator< T >private
value_type typedefflow::PolymorphicAllocator< T >
+
+
+ + + + diff --git a/docs/classflow_1_1_polymorphic_allocator.html b/docs/classflow_1_1_polymorphic_allocator.html new file mode 100644 index 0000000..2109c86 --- /dev/null +++ b/docs/classflow_1_1_polymorphic_allocator.html @@ -0,0 +1,591 @@ + + + + + + + +Flow: flow::PolymorphicAllocator< T > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::PolymorphicAllocator< T > Class Template Reference
+
+
+ +

A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation. + More...

+ +

#include <flow_polymorphic_allocator.h>

+ + + +

+Public Types

using value_type = T
+ + + + + + + + + + + + + + + +

+Public Member Functions

 PolymorphicAllocator ()
 PolymorphicAllocator (MemoryResource &resource)
template<typename U>
 PolymorphicAllocator (const PolymorphicAllocator< U > &allocator) noexcept
T * allocate (std::size_t count)
 Allocate raw memory that can contain at least count number of objects.
void deallocate (T *address, std::size_t count) noexcept
 Deallocates allocated raw memory.
template<typename U, typename... Args>
void construct (U *address, Args &&... args)
 Constructs an object in place at the given address.
template<typename U>
void destroy (U *address) noexcept
 Destroys the object at the given address.
+ + +

+Private Attributes

MemoryResourceresource_
+ + + + + + + +

+Friends

template<typename U>
class PolymorphicAllocator
template<typename U>
bool operator== (const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)
template<typename U>
bool operator!= (const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)
+

Detailed Description

+
template<typename T = std::byte>
+class flow::PolymorphicAllocator< T >

A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation.

+ +

Definition at line 12 of file flow_polymorphic_allocator.h.

+

Member Typedef Documentation

+ +

◆ value_type

+ +
+
+
+template<typename T = std::byte>
+ + + + +
using flow::PolymorphicAllocator< T >::value_type = T
+
+ +

Definition at line 14 of file flow_polymorphic_allocator.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ PolymorphicAllocator() [1/3]

+ +
+
+
+template<typename T = std::byte>
+ + + + + +
+ + + + + + + +
flow::PolymorphicAllocator< T >::PolymorphicAllocator ()
+
+inline
+
+ +

Definition at line 17 of file flow_polymorphic_allocator.h.

+
+
19 }
+
A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is...
+ +
+

References resource_.

+ +
+
+ +

◆ PolymorphicAllocator() [2/3]

+ +
+
+
+template<typename T = std::byte>
+ + + + + +
+ + + + + + + +
flow::PolymorphicAllocator< T >::PolymorphicAllocator (MemoryResource & resource)
+
+inlineexplicit
+
+ +

Definition at line 21 of file flow_polymorphic_allocator.h.

+
+
23 }
+
+

References resource_.

+ +
+
+ +

◆ PolymorphicAllocator() [3/3]

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U>
+ + + + + +
+ + + + + + + +
flow::PolymorphicAllocator< T >::PolymorphicAllocator (const PolymorphicAllocator< U > & allocator)
+
+inlinenoexcept
+
+ +

Definition at line 26 of file flow_polymorphic_allocator.h.

+
+
28 }
+
+

References PolymorphicAllocator.

+ +
+
+

Member Function Documentation

+ +

◆ allocate()

+ +
+
+
+template<typename T = std::byte>
+ + + + + +
+ + + + + + + +
T * flow::PolymorphicAllocator< T >::allocate (std::size_t count)
+
+inline
+
+ +

Allocate raw memory that can contain at least count number of objects.

+
Parameters
+ + +
countNumber of objects to allocate
+
+
+
Returns
The raw memory.
+ +

Definition at line 35 of file flow_polymorphic_allocator.h.

+
35 {
+
36 return static_cast<T*>(resource_->allocate(sizeof(T) * count, alignof(T)));
+
37 }
+
+

References resource_.

+ +
+
+ +

◆ construct()

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U, typename... Args>
+ + + + + +
+ + + + + + + + + + + +
void flow::PolymorphicAllocator< T >::construct (U * address,
Args &&... args )
+
+inline
+
+ +

Constructs an object in place at the given address.

+ +

Definition at line 52 of file flow_polymorphic_allocator.h.

+
52 {
+ +
54 }
+
+
+
+ +

◆ deallocate()

+ +
+
+
+template<typename T = std::byte>
+ + + + + +
+ + + + + + + + + + + +
void flow::PolymorphicAllocator< T >::deallocate (T * address,
std::size_t count )
+
+inlinenoexcept
+
+ +

Deallocates allocated raw memory.

+
Parameters
+ + + +
addressRaw memory to deallocate.
countNumber of objects allocated.
+
+
+ +

Definition at line 44 of file flow_polymorphic_allocator.h.

+
44 {
+
45 resource_->deallocate(address, sizeof(T) * count, alignof(T));
+
46 }
+
+

References resource_.

+ +
+
+ +

◆ destroy()

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U>
+ + + + + +
+ + + + + + + +
void flow::PolymorphicAllocator< T >::destroy (U * address)
+
+inlinenoexcept
+
+ +

Destroys the object at the given address.

+ +

Definition at line 60 of file flow_polymorphic_allocator.h.

+
60 {
+
61 address->~U();
+
62 }
+
+
+
+ + +

◆ operator!=

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U>
+ + + + + +
+ + + + + + + + + + + +
bool operator!= (const flow::PolymorphicAllocator< T > & lhs,
const flow::PolymorphicAllocator< U > & rhs )
+
+friend
+
+ +

Definition at line 76 of file flow_polymorphic_allocator.h.

+
76 {
+
77 return !(lhs == rhs);
+
78 }
+
+
+
+ +

◆ operator==

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U>
+ + + + + +
+ + + + + + + + + + + +
bool operator== (const flow::PolymorphicAllocator< T > & lhs,
const flow::PolymorphicAllocator< U > & rhs )
+
+friend
+
+ +

Definition at line 71 of file flow_polymorphic_allocator.h.

+
71 {
+
72 return lhs.resource_ == rhs.resource_;
+
73 }
+
+

References resource_.

+ +
+
+ +

◆ PolymorphicAllocator

+ +
+
+
+template<typename T = std::byte>
+
+template<typename U>
+ + + + + +
+ + + + +
friend class PolymorphicAllocator
+
+friend
+
+ +

Definition at line 68 of file flow_polymorphic_allocator.h.

+ +

References PolymorphicAllocator.

+ +

Referenced by PolymorphicAllocator(), and PolymorphicAllocator.

+ +
+
+

Member Data Documentation

+ +

◆ resource_

+ +
+
+
+template<typename T = std::byte>
+ + + + + +
+ + + + +
MemoryResource* flow::PolymorphicAllocator< T >::resource_
+
+private
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_polymorphic_allocator.js b/docs/classflow_1_1_polymorphic_allocator.js new file mode 100644 index 0000000..54a46d8 --- /dev/null +++ b/docs/classflow_1_1_polymorphic_allocator.js @@ -0,0 +1,15 @@ +var classflow_1_1_polymorphic_allocator = +[ + [ "value_type", "classflow_1_1_polymorphic_allocator.html#a9856518e727c58c747d28b25701bd8c1", null ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html#a61ce18be7ea581a5281a5bceb32917ff", null ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html#abdb1a1785d0e9ee4baaf5ee819dcb29e", null ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html#aaa09cc96471e180791aa70167fd8112e", null ], + [ "allocate", "classflow_1_1_polymorphic_allocator.html#a9ecfbea0e237d47dbaeb792d40470981", null ], + [ "construct", "classflow_1_1_polymorphic_allocator.html#ae2e657ac5eb873d11ad71723277caaa8", null ], + [ "deallocate", "classflow_1_1_polymorphic_allocator.html#a246865912a463ce03695521796e96c0b", null ], + [ "destroy", "classflow_1_1_polymorphic_allocator.html#abc9cffd1ba2487b9446352c42b8b820d", null ], + [ "operator!=", "classflow_1_1_polymorphic_allocator.html#aef1689a9b79f3750119e25fabf20f3f8", null ], + [ "operator==", "classflow_1_1_polymorphic_allocator.html#a6bc365874bc82309e83d3d2dd28fb5eb", null ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html#a9de9cf20311e8ddb8e9c9128157f4884", null ], + [ "resource_", "classflow_1_1_polymorphic_allocator.html#a15d7aac64ac85004897b094b38ca73bd", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_pool_memory_resource-members.html b/docs/classflow_1_1_pool_memory_resource-members.html new file mode 100644 index 0000000..71859db --- /dev/null +++ b/docs/classflow_1_1_pool_memory_resource-members.html @@ -0,0 +1,118 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::PoolMemoryResource Member List
+
+
+ +

This is the complete list of members for flow::PoolMemoryResource, including all inherited members.

+ + + + + + + + + + + +
allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
allocateImp(std::size_t bytes, std::size_t alignment) overrideflow::PoolMemoryResourceinlineprotectedvirtual
blockAlignment_flow::PoolMemoryResourceprotected
blockSize_flow::PoolMemoryResourceprotected
deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
deallocateImp(void *address, std::size_t bytes, std::size_t alignment) overrideflow::PoolMemoryResourceinlineprotectedvirtual
head_flow::PoolMemoryResourceprotected
PoolMemoryResource(void *buffer, std::size_t capacity, std::size_t blockSize, std::size_t blockAlignment=sizeof(std::max_align_t))flow::PoolMemoryResourceinline
~MemoryResource()=defaultflow::MemoryResourcevirtual
~PoolMemoryResource()flow::PoolMemoryResourceinline
+
+
+ + + + diff --git a/docs/classflow_1_1_pool_memory_resource.html b/docs/classflow_1_1_pool_memory_resource.html new file mode 100644 index 0000000..d5dc577 --- /dev/null +++ b/docs/classflow_1_1_pool_memory_resource.html @@ -0,0 +1,433 @@ + + + + + + + +Flow: flow::PoolMemoryResource Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::PoolMemoryResource Class Reference
+
+
+ +

A pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory. + More...

+ +

#include <flow_pool_memory_resource.h>

+
Inheritance diagram for flow::PoolMemoryResource:
+
+
+ + + + +

+Classes

struct  Header
+ + + + + + + +

+Public Member Functions

 PoolMemoryResource (void *buffer, std::size_t capacity, std::size_t blockSize, std::size_t blockAlignment=sizeof(std::max_align_t))
 ~PoolMemoryResource ()
Public Member Functions inherited from flow::MemoryResource
virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+ + + +

+Protected Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment) override
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment) override
+ + + + +

+Protected Attributes

std::size_t blockSize_
std::size_t blockAlignment_
Headerhead_
+

Detailed Description

+

A pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory.

+ +

Definition at line 15 of file flow_pool_memory_resource.h.

+

Constructor & Destructor Documentation

+ +

◆ PoolMemoryResource()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
flow::PoolMemoryResource::PoolMemoryResource (void * buffer,
std::size_t capacity,
std::size_t blockSize,
std::size_t blockAlignment = sizeof(std::max_align_t) )
+
+inline
+
+ +

Definition at line 17 of file flow_pool_memory_resource.h.

+
18 : blockSize_(blockSize), blockAlignment_(blockAlignment), head_(nullptr) {
+
19
+
20 Header** headPtr = &head_;
+
21 for (;;) {
+
22 Header* header = alignWithHeader<Header>(blockAlignment_, blockSize_, buffer, capacity);
+
23 if (!header) {
+
24 break;
+
25 }
+
26
+
27 new (header) Header(nullptr);
+
28 *headPtr = header;
+
29 headPtr = &(header->next);
+
30
+
31 buffer = reinterpret_cast<std::byte*>(buffer) + sizeof(Header) + blockSize;
+
32 capacity -= sizeof(Header) + blockSize;
+
33 }
+
34 }
+ + + +
Header * alignWithHeader(std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
Align the header + buffer to their corresponding alignments. If the capacity is not big enough to acc...
+ +
+

References flow::alignWithHeader(), blockAlignment_, blockSize_, head_, and flow::PoolMemoryResource::Header::next.

+ +
+
+ +

◆ ~PoolMemoryResource()

+ +
+
+ + + + + +
+ + + + + + + +
flow::PoolMemoryResource::~PoolMemoryResource ()
+
+inline
+
+ +

Definition at line 36 of file flow_pool_memory_resource.h.

+
36 {
+
37 // May be useless, since it has a trivial destructor.
+
38 while (head_) {
+
39 Header* next = head_->next;
+
40 head_->~Header();
+
41 head_ = next;
+
42 }
+
43 }
+
+

References head_.

+ +
+
+

Member Function Documentation

+ +

◆ allocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
virtual void * flow::PoolMemoryResource::allocateImp (std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 54 of file flow_pool_memory_resource.h.

+
54 {
+
55 if (blockSize_ < bytes || blockAlignment_ < alignment || !head_) {
+
56 throw std::bad_alloc();
+
57 }
+
58
+
59 void* allocatedBlock = head_ + 1;
+
60 head_ = head_->next;
+
61 return allocatedBlock;
+
62 }
+
+

References blockAlignment_, blockSize_, and head_.

+ +
+
+ +

◆ deallocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
virtual void flow::PoolMemoryResource::deallocateImp (void * address,
std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 64 of file flow_pool_memory_resource.h.

+
67 {
+
68 Header* header = reinterpret_cast<Header*>(address) - 1;
+
69 header->next = head_;
+
70 head_ = header;
+
71 }
+ +
+

References head_, and flow::PoolMemoryResource::Header::next.

+ +
+
+

Member Data Documentation

+ +

◆ blockAlignment_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::PoolMemoryResource::blockAlignment_
+
+protected
+
+ +

Definition at line 51 of file flow_pool_memory_resource.h.

+ +

Referenced by allocateImp(), and PoolMemoryResource().

+ +
+
+ +

◆ blockSize_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::PoolMemoryResource::blockSize_
+
+protected
+
+ +

Definition at line 50 of file flow_pool_memory_resource.h.

+ +

Referenced by allocateImp(), and PoolMemoryResource().

+ +
+
+ +

◆ head_

+ +
+
+ + + + + +
+ + + + +
Header* flow::PoolMemoryResource::head_
+
+protected
+
+ +

Definition at line 52 of file flow_pool_memory_resource.h.

+ +

Referenced by allocateImp(), deallocateImp(), PoolMemoryResource(), and ~PoolMemoryResource().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_pool_memory_resource.js b/docs/classflow_1_1_pool_memory_resource.js new file mode 100644 index 0000000..28daef2 --- /dev/null +++ b/docs/classflow_1_1_pool_memory_resource.js @@ -0,0 +1,11 @@ +var classflow_1_1_pool_memory_resource = +[ + [ "Header", "structflow_1_1_pool_memory_resource_1_1_header.html", "structflow_1_1_pool_memory_resource_1_1_header" ], + [ "PoolMemoryResource", "classflow_1_1_pool_memory_resource.html#a3ac35916ea439a181138f26c8ad158e1", null ], + [ "~PoolMemoryResource", "classflow_1_1_pool_memory_resource.html#a5fd5e0967552063825e24232b3c4c5bc", null ], + [ "allocateImp", "classflow_1_1_pool_memory_resource.html#a3cfb07a234f406f4fb8c1d1c154861bc", null ], + [ "deallocateImp", "classflow_1_1_pool_memory_resource.html#ad096a8ce328207d87d572b19ae51f324", null ], + [ "blockAlignment_", "classflow_1_1_pool_memory_resource.html#a78edca92b66c6501c24f699bb13090ab", null ], + [ "blockSize_", "classflow_1_1_pool_memory_resource.html#ac14d17a1ae812d2f72140249a05f32be", null ], + [ "head_", "classflow_1_1_pool_memory_resource.html#a06a3832bb9d9708ee001638ad8690c65", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_pool_memory_resource.png b/docs/classflow_1_1_pool_memory_resource.png new file mode 100644 index 0000000..18a7eae Binary files /dev/null and b/docs/classflow_1_1_pool_memory_resource.png differ diff --git a/docs/classflow_1_1_stack_memory_resource-members.html b/docs/classflow_1_1_stack_memory_resource-members.html new file mode 100644 index 0000000..0000789 --- /dev/null +++ b/docs/classflow_1_1_stack_memory_resource-members.html @@ -0,0 +1,116 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::StackMemoryResource Member List
+
+
+ +

This is the complete list of members for flow::StackMemoryResource, including all inherited members.

+ + + + + + + + + +
allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
allocateImp(std::size_t bytes, std::size_t alignment) overrideflow::StackMemoryResourceinlineprotectedvirtual
buffer_flow::StackMemoryResourceprotected
capacity_flow::StackMemoryResourceprotected
deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))flow::MemoryResourceinline
deallocateImp(void *address, std::size_t bytes, std::size_t alignment) overrideflow::StackMemoryResourceinlineprotectedvirtual
StackMemoryResource(void *buffer, std::size_t capacity) noexceptflow::StackMemoryResourceinlineexplicit
~MemoryResource()=defaultflow::MemoryResourcevirtual
+
+
+ + + + diff --git a/docs/classflow_1_1_stack_memory_resource.html b/docs/classflow_1_1_stack_memory_resource.html new file mode 100644 index 0000000..73fe844 --- /dev/null +++ b/docs/classflow_1_1_stack_memory_resource.html @@ -0,0 +1,353 @@ + + + + + + + +Flow: flow::StackMemoryResource Class Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::StackMemoryResource Class Reference
+
+
+ +

A stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation. + More...

+ +

#include <flow_stack_memory_resource.h>

+
Inheritance diagram for flow::StackMemoryResource:
+
+
+ + + + +

+Classes

struct  Header
+ + + + + + +

+Public Member Functions

 StackMemoryResource (void *buffer, std::size_t capacity) noexcept
Public Member Functions inherited from flow::MemoryResource
virtual ~MemoryResource ()=default
void * allocate (std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
void deallocate (void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+ + + +

+Protected Member Functions

virtual void * allocateImp (std::size_t bytes, std::size_t alignment) override
virtual void deallocateImp (void *address, std::size_t bytes, std::size_t alignment) override
+ + + +

+Protected Attributes

void * buffer_
std::size_t capacity_
+

Detailed Description

+

A stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation.

+ +

Definition at line 15 of file flow_stack_memory_resource.h.

+

Constructor & Destructor Documentation

+ +

◆ StackMemoryResource()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
flow::StackMemoryResource::StackMemoryResource (void * buffer,
std::size_t capacity )
+
+inlineexplicitnoexcept
+
+ +

Definition at line 17 of file flow_stack_memory_resource.h.

+ +
+
+

Member Function Documentation

+ +

◆ allocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
virtual void * flow::StackMemoryResource::allocateImp (std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 29 of file flow_stack_memory_resource.h.

+
29 {
+
30 void* oldBuffer = buffer_;
+
31
+
32 void* alignedHeader = flow::alignWithHeader<Header>(alignment, bytes, buffer_, capacity_);
+
33 if (!alignedHeader) {
+
34 throw std::bad_alloc();
+
35 }
+
36
+
37 new (alignedHeader) Header(oldBuffer);
+
38 void* allocatedBlock = reinterpret_cast<Header*>(alignedHeader) + 1;
+
39 buffer_ = reinterpret_cast<std::byte*>(allocatedBlock) + bytes;
+
40 capacity_ -= sizeof(Header) + bytes;
+
41 return allocatedBlock;
+
42 }
+
Header * alignWithHeader(std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
Align the header + buffer to their corresponding alignments. If the capacity is not big enough to acc...
+ +
+

References flow::alignWithHeader(), buffer_, and capacity_.

+ +
+
+ +

◆ deallocateImp()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
virtual void flow::StackMemoryResource::deallocateImp (void * address,
std::size_t bytes,
std::size_t alignment )
+
+inlineoverrideprotectedvirtual
+
+ +

Implements flow::MemoryResource.

+ +

Definition at line 44 of file flow_stack_memory_resource.h.

+
44 {
+
45 // TODO: assert address is the top most valid address
+
46 assert(address == nullptr || address <= buffer_);
+
47 if (!address) {
+
48 return;
+
49 }
+
50
+
51 Header* header = reinterpret_cast<Header*>(address) - 1;
+
52 std::size_t padding = pointerDistance(header->oldBuffer, header);
+
53 buffer_ = header->oldBuffer;
+
54 capacity_ += padding + sizeof(Header) + bytes;
+
55 header->~Header();
+
56 }
+
std::size_t pointerDistance(const T *first, const U *last)
Calculate the distance from the first pointer to the last pointer in bytes.
+
+

References buffer_, capacity_, flow::StackMemoryResource::Header::oldBuffer, and flow::pointerDistance().

+ +
+
+

Member Data Documentation

+ +

◆ buffer_

+ +
+
+ + + + + +
+ + + + +
void* flow::StackMemoryResource::buffer_
+
+protected
+
+ +

Definition at line 26 of file flow_stack_memory_resource.h.

+ +

Referenced by allocateImp(), and deallocateImp().

+ +
+
+ +

◆ capacity_

+ +
+
+ + + + + +
+ + + + +
std::size_t flow::StackMemoryResource::capacity_
+
+protected
+
+ +

Definition at line 27 of file flow_stack_memory_resource.h.

+ +

Referenced by allocateImp(), and deallocateImp().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_stack_memory_resource.js b/docs/classflow_1_1_stack_memory_resource.js new file mode 100644 index 0000000..46a91cb --- /dev/null +++ b/docs/classflow_1_1_stack_memory_resource.js @@ -0,0 +1,9 @@ +var classflow_1_1_stack_memory_resource = +[ + [ "Header", "structflow_1_1_stack_memory_resource_1_1_header.html", "structflow_1_1_stack_memory_resource_1_1_header" ], + [ "StackMemoryResource", "classflow_1_1_stack_memory_resource.html#a993576cf99976c5cb4c07581dcf89e7a", null ], + [ "allocateImp", "classflow_1_1_stack_memory_resource.html#a2ac0250b455868bd79a38da643b421d5", null ], + [ "deallocateImp", "classflow_1_1_stack_memory_resource.html#a472e9dd93c0aad65c2a3768254d2bf1f", null ], + [ "buffer_", "classflow_1_1_stack_memory_resource.html#a2f4289d48c9ac450dc8f2f44f5c0ef25", null ], + [ "capacity_", "classflow_1_1_stack_memory_resource.html#ad4add4a5c15fafb57478f030146d4e91", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_stack_memory_resource.png b/docs/classflow_1_1_stack_memory_resource.png new file mode 100644 index 0000000..5fe74f1 Binary files /dev/null and b/docs/classflow_1_1_stack_memory_resource.png differ diff --git a/docs/classflow_1_1_timer-members.html b/docs/classflow_1_1_timer-members.html new file mode 100644 index 0000000..3defe28 --- /dev/null +++ b/docs/classflow_1_1_timer-members.html @@ -0,0 +1,116 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Timer< ClockType > Member List
+
+
+ +

This is the complete list of members for flow::Timer< ClockType >, including all inherited members.

+ + + + + + + + + +
begin_flow::Timer< ClockType >private
record()flow::Timer< ClockType >inline
reset()flow::Timer< ClockType >inline
size() constflow::Timer< ClockType >inline
TimePoint typedefflow::Timer< ClockType >private
timepoints_flow::Timer< ClockType >private
Timer(std::size_t reserveSize=8)flow::Timer< ClockType >inlineexplicit
toString() constflow::Timer< ClockType >inline
+
+
+ + + + diff --git a/docs/classflow_1_1_timer.html b/docs/classflow_1_1_timer.html new file mode 100644 index 0000000..2afdb8e --- /dev/null +++ b/docs/classflow_1_1_timer.html @@ -0,0 +1,434 @@ + + + + + + + +Flow: flow::Timer< ClockType > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Timer< ClockType > Class Template Reference
+
+
+ +

A simple timer to record timelapses. Uses chrono::steady_clock by default. + More...

+ +

#include <flow_timer.h>

+ + + + + + + + + + + + +

+Public Member Functions

constexpr Timer (std::size_t reserveSize=8)
 Constructs a Timer and reserves space for a given number of time points.
constexpr std::size_t size () const
 Returns the number of recorded time points.
void reset ()
 Clears all recorded time points and reset the starting time.
void record ()
 Records the current time point relative to the last call to start().
std::string toString () const
 Formats and returns a string showing all recorded durations since the timer resets.
+ + +

+Private Types

using TimePoint = ClockType::time_point
+ + + +

+Private Attributes

TimePoint begin_ {}
std::vector< TimePointtimepoints_ {}
+

Detailed Description

+
template<typename ClockType = std::chrono::steady_clock>
+class flow::Timer< ClockType >

A simple timer to record timelapses. Uses chrono::steady_clock by default.

+ +

Definition at line 11 of file flow_timer.h.

+

Member Typedef Documentation

+ +

◆ TimePoint

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + +
using flow::Timer< ClockType >::TimePoint = ClockType::time_point
+
+private
+
+ +

Definition at line 12 of file flow_timer.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Timer()

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + + + + +
flow::Timer< ClockType >::Timer (std::size_t reserveSize = 8)
+
+inlineexplicitconstexpr
+
+ +

Constructs a Timer and reserves space for a given number of time points.

+ +

Definition at line 20 of file flow_timer.h.

+
20 {
+
21 timepoints_.reserve(reserveSize);
+
22 }
+
A simple timer to record timelapses. Uses chrono::steady_clock by default.
Definition flow_timer.h:11
+
std::vector< TimePoint > timepoints_
Definition flow_timer.h:14
+
+

References timepoints_.

+ +
+
+

Member Function Documentation

+ +

◆ record()

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + + + + +
void flow::Timer< ClockType >::record ()
+
+inline
+
+ +

Records the current time point relative to the last call to start().

+ +

Definition at line 43 of file flow_timer.h.

+
43 {
+
44 timepoints_.push_back(ClockType::now());
+
45 }
+
+

References timepoints_.

+ +
+
+ +

◆ reset()

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + + + + +
void flow::Timer< ClockType >::reset ()
+
+inline
+
+ +

Clears all recorded time points and reset the starting time.

+ +

Definition at line 35 of file flow_timer.h.

+
35 {
+
36 timepoints_.clear();
+ +
38 }
+
TimePoint begin_
Definition flow_timer.h:13
+
+

References begin_, and timepoints_.

+ +
+
+ +

◆ size()

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + + + + +
std::size_t flow::Timer< ClockType >::size () const
+
+inlineconstexpr
+
+ +

Returns the number of recorded time points.

+
Returns
Count of time points recorded.
+ +

Definition at line 28 of file flow_timer.h.

+
28 {
+
29 return timepoints_.size();
+
30 }
+
+

References timepoints_.

+ +
+
+ +

◆ toString()

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + + + + +
std::string flow::Timer< ClockType >::toString () const
+
+inline
+
+ +

Formats and returns a string showing all recorded durations since the timer resets.

+
Returns
Formatted string of all recorded time intervals.
+ +

Definition at line 51 of file flow_timer.h.

+
51 {
+
52 std::string str = std::format("Total record entries: {}\n", timepoints_.size());
+
53 std::size_t i = 0;
+
54 for (const auto& timepoint : timepoints_) {
+
55 auto dur = timepoint - begin_;
+
56 str += std::format("\t[{}] {}, {}, {}\n",
+
57 i,
+ + + +
61 ++i;
+
62 }
+
63 return str;
+
64 }
+
+

References begin_, and timepoints_.

+ +
+
+

Member Data Documentation

+ +

◆ begin_

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + +
TimePoint flow::Timer< ClockType >::begin_ {}
+
+private
+
+ +

Definition at line 13 of file flow_timer.h.

+
13{};
+
+

Referenced by reset(), and toString().

+ +
+
+ +

◆ timepoints_

+ +
+
+
+template<typename ClockType = std::chrono::steady_clock>
+ + + + + +
+ + + + +
std::vector<TimePoint> flow::Timer< ClockType >::timepoints_ {}
+
+private
+
+ +

Definition at line 14 of file flow_timer.h.

+
14{};
+
+

Referenced by record(), reset(), size(), Timer(), and toString().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_timer.js b/docs/classflow_1_1_timer.js new file mode 100644 index 0000000..7f1e8e4 --- /dev/null +++ b/docs/classflow_1_1_timer.js @@ -0,0 +1,11 @@ +var classflow_1_1_timer = +[ + [ "TimePoint", "classflow_1_1_timer.html#aaab2494b84d8f0522aa888c52675b60f", null ], + [ "Timer", "classflow_1_1_timer.html#a84fb288a95562d7511d226ebe6ad6f8e", null ], + [ "record", "classflow_1_1_timer.html#a1e1fdbe90de75ff50c147a965b756f2b", null ], + [ "reset", "classflow_1_1_timer.html#a74b4619eeb69ef54d750bcb91aa837fe", null ], + [ "size", "classflow_1_1_timer.html#a0bd09e9dc2f660a4e8b3393dd06dbf64", null ], + [ "toString", "classflow_1_1_timer.html#a491df8664619dd62baf9e1eac1170d96", null ], + [ "begin_", "classflow_1_1_timer.html#acbd02d5581f7c9944d26b2af920de561", null ], + [ "timepoints_", "classflow_1_1_timer.html#a561f3b246b164cafaa2e7e8e9e99d230", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_tuple-members.html b/docs/classflow_1_1_tuple-members.html new file mode 100644 index 0000000..cd5b83f --- /dev/null +++ b/docs/classflow_1_1_tuple-members.html @@ -0,0 +1,109 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Tuple< Ts > Member List
+
+
+ +

This is the complete list of members for flow::Tuple< Ts >, including all inherited members.

+ + +
size() constflow::Tuple< Ts >inline
+
+
+ + + + diff --git a/docs/classflow_1_1_tuple.html b/docs/classflow_1_1_tuple.html new file mode 100644 index 0000000..74deb41 --- /dev/null +++ b/docs/classflow_1_1_tuple.html @@ -0,0 +1,160 @@ + + + + + + + +Flow: flow::Tuple< Ts > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Tuple< Ts > Class Template Reference
+
+
+ +

#include <flow_tuple.h>

+ + + +

+Public Member Functions

constexpr std::size_t size () const
+

Detailed Description

+
template<typename... Ts>
+class flow::Tuple< Ts >
+

Definition at line 5 of file flow_tuple.h.

+

Member Function Documentation

+ +

◆ size()

+ +
+
+
+template<typename... Ts>
+ + + + + +
+ + + + + + + +
std::size_t flow::Tuple< Ts >::size () const
+
+inlineconstexpr
+
+ +

Definition at line 7 of file flow_tuple.h.

+
7 {
+
8 return 0;
+
9 }
+
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_tuple.js b/docs/classflow_1_1_tuple.js new file mode 100644 index 0000000..25037e1 --- /dev/null +++ b/docs/classflow_1_1_tuple.js @@ -0,0 +1,4 @@ +var classflow_1_1_tuple = +[ + [ "size", "classflow_1_1_tuple.html#ac21246e9ba10eac47b3ef6370535214f", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4-members.html b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4-members.html new file mode 100644 index 0000000..6f5dd3f --- /dev/null +++ b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4-members.html @@ -0,0 +1,115 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Tuple< T, Ts... > Member List
+
+
+ +

This is the complete list of members for flow::Tuple< T, Ts... >, including all inherited members.

+ + + + + + + + +
BaseType typedefflow::Tuple< T, Ts... >private
get()flow::Tuple< T, Ts... >inline
get() constflow::Tuple< T, Ts... >inline
size() constflow::Tuple< T, Ts... >inline
Tuple()flow::Tuple< T, Ts... >inline
Tuple(Arg1 &&value, Args2 &&... values)flow::Tuple< T, Ts... >inlineexplicit
value_flow::Tuple< T, Ts... >private
+
+
+ + + + diff --git a/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html new file mode 100644 index 0000000..3b7a4e2 --- /dev/null +++ b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html @@ -0,0 +1,402 @@ + + + + + + + +Flow: flow::Tuple< T, Ts... > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Tuple< T, Ts... > Class Template Reference
+
+
+ +

#include <flow_tuple.h>

+
Inheritance diagram for flow::Tuple< T, Ts... >:
+
+
+ + + + + + + + + + + +

+Public Member Functions

constexpr Tuple ()
template<typename Arg1, typename ... Args2>
constexpr Tuple (Arg1 &&value, Args2 &&... values)
constexpr std::size_t size () const
template<std::size_t N>
auto & get ()
template<std::size_t N>
const auto & get () const
+ + +

+Private Types

using BaseType = Tuple<Ts...>
+ + +

+Private Attributes

value_
+ + + +

+Additional Inherited Members

Private Member Functions inherited from flow::Tuple< Ts... >
constexpr std::size_t size () const
+

Detailed Description

+
template<typename T, typename... Ts>
+class flow::Tuple< T, Ts... >
+

Definition at line 13 of file flow_tuple.h.

+

Member Typedef Documentation

+ +

◆ BaseType

+ +
+
+
+template<typename T, typename... Ts>
+ + + + + +
+ + + + +
using flow::Tuple< T, Ts... >::BaseType = Tuple<Ts...>
+
+private
+
+ +

Definition at line 14 of file flow_tuple.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Tuple() [1/2]

+ +
+
+
+template<typename T, typename... Ts>
+ + + + + +
+ + + + + + + +
flow::Tuple< T, Ts... >::Tuple ()
+
+inlineconstexpr
+
+ +

Definition at line 18 of file flow_tuple.h.

+
19 : BaseType{}, value_{} {
+
20 }
+
Tuple< Ts... > BaseType
Definition flow_tuple.h:14
+ +
+

References value_.

+ +
+
+ +

◆ Tuple() [2/2]

+ +
+
+
+template<typename T, typename... Ts>
+
+template<typename Arg1, typename ... Args2>
+ + + + + +
+ + + + + + + + + + + +
flow::Tuple< T, Ts... >::Tuple (Arg1 && value,
Args2 &&... values )
+
+inlineexplicitconstexpr
+
+ +

Definition at line 23 of file flow_tuple.h.

+ +

References value_.

+ +
+
+

Member Function Documentation

+ +

◆ get() [1/2]

+ +
+
+
+template<typename T, typename... Ts>
+
+template<std::size_t N>
+ + + + + +
+ + + + + + + +
auto & flow::Tuple< T, Ts... >::get ()
+
+inline
+
+ +

Definition at line 32 of file flow_tuple.h.

+
32 {
+
33 if constexpr (N == 0) {
+
34 return value_;
+
35 } else {
+
36 return BaseType::get<N - 1>();
+
37 }
+
38 }
+
+

References value_.

+ +
+
+ +

◆ get() [2/2]

+ +
+
+
+template<typename T, typename... Ts>
+
+template<std::size_t N>
+ + + + + +
+ + + + + + + +
const auto & flow::Tuple< T, Ts... >::get () const
+
+inline
+
+ +

Definition at line 41 of file flow_tuple.h.

+
41 {
+
42 if constexpr (N == 0) {
+
43 return value_;
+
44 } else {
+
45 return BaseType::get<N - 1>();
+
46 }
+
47 }
+
+

References value_.

+ +
+
+ +

◆ size()

+ +
+
+
+template<typename T, typename... Ts>
+ + + + + +
+ + + + + + + +
std::size_t flow::Tuple< T, Ts... >::size () const
+
+inlineconstexpr
+
+ +

Definition at line 27 of file flow_tuple.h.

+
27 {
+
28 return sizeof...(Ts) + 1;
+
29 }
+
+
+
+

Member Data Documentation

+ +

◆ value_

+ +
+
+
+template<typename T, typename... Ts>
+ + + + + +
+ + + + +
T flow::Tuple< T, Ts... >::value_
+
+private
+
+ +

Definition at line 15 of file flow_tuple.h.

+ +

Referenced by get(), get(), Tuple(), and Tuple().

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.js b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.js new file mode 100644 index 0000000..ce5973c --- /dev/null +++ b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.js @@ -0,0 +1,10 @@ +var classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4 = +[ + [ "BaseType", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a4f1f896d869a98776eb4ea84f90ff3f9", null ], + [ "Tuple", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a55b886793da978c41864c41132402df2", null ], + [ "Tuple", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a7f60fa146191162adc0fa354fb1238cc", null ], + [ "get", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a9e0704bb42876ba20c0fde9df37b980f", null ], + [ "get", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a9fd9a8776d08fac17e76168b054204cd", null ], + [ "size", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#a6fa5e57287bdb5c2bfbaf12333816cec", null ], + [ "value_", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html#ae7bb027da9f28e7ea61c06ba37d322ab", null ] +]; \ No newline at end of file diff --git a/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.png b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.png new file mode 100644 index 0000000..0f5bb50 Binary files /dev/null and b/docs/classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.png differ diff --git a/docs/classflow_1_1_vector-members.html b/docs/classflow_1_1_vector-members.html new file mode 100644 index 0000000..6532c02 --- /dev/null +++ b/docs/classflow_1_1_vector-members.html @@ -0,0 +1,171 @@ + + + + + + + +Flow: Member List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Vector< T, Allocator, Strategy > Member List
+
+
+ +

This is the complete list of members for flow::Vector< T, Allocator, Strategy >, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
allocator_flow::Vector< T, Allocator, Strategy >private
allocator_trait typedefflow::Vector< T, Allocator, Strategy >private
allocator_type typedefflow::Vector< T, Allocator, Strategy >
back() noexceptflow::Vector< T, Allocator, Strategy >inline
back() const noexceptflow::Vector< T, Allocator, Strategy >inline
begin() noexceptflow::Vector< T, Allocator, Strategy >inline
begin() const noexceptflow::Vector< T, Allocator, Strategy >inline
buffer_flow::Vector< T, Allocator, Strategy >private
capacity() const noexceptflow::Vector< T, Allocator, Strategy >inline
capacity_flow::Vector< T, Allocator, Strategy >private
clear() noexceptflow::Vector< T, Allocator, Strategy >inline
const_iterator typedefflow::Vector< T, Allocator, Strategy >
const_pointer typedefflow::Vector< T, Allocator, Strategy >
const_reference typedefflow::Vector< T, Allocator, Strategy >
difference_type typedefflow::Vector< T, Allocator, Strategy >
emplace(iterator pos, Args &&... args)flow::Vector< T, Allocator, Strategy >inline
emplaceBack(Args &&... args)flow::Vector< T, Allocator, Strategy >inline
empty() const noexceptflow::Vector< T, Allocator, Strategy >inline
end() noexceptflow::Vector< T, Allocator, Strategy >inline
end() const noexceptflow::Vector< T, Allocator, Strategy >inline
erase(iterator pos) noexceptflow::Vector< T, Allocator, Strategy >inline
erase(iterator first, iterator last) noexceptflow::Vector< T, Allocator, Strategy >inline
front() noexceptflow::Vector< T, Allocator, Strategy >inline
front() const noexceptflow::Vector< T, Allocator, Strategy >inline
get_allocator() const noexceptflow::Vector< T, Allocator, Strategy >inline
growthStrategy_flow::Vector< T, Allocator, Strategy >private
insert(iterator pos, const T &value)flow::Vector< T, Allocator, Strategy >inline
insert(iterator pos, T &&value)flow::Vector< T, Allocator, Strategy >inline
insert(iterator pos, std::size_t count, const T &value)flow::Vector< T, Allocator, Strategy >inline
insert(iterator pos, It first, It last)flow::Vector< T, Allocator, Strategy >inline
insert(iterator pos, std::initializer_list< T > list)flow::Vector< T, Allocator, Strategy >inline
iterator typedefflow::Vector< T, Allocator, Strategy >
operator=(Vector rhs) noexceptflow::Vector< T, Allocator, Strategy >inline
operator[](std::size_t i) noexceptflow::Vector< T, Allocator, Strategy >inline
operator[](std::size_t i) const noexceptflow::Vector< T, Allocator, Strategy >inline
pointer typedefflow::Vector< T, Allocator, Strategy >
popBack() noexceptflow::Vector< T, Allocator, Strategy >inline
pushBack(const T &value)flow::Vector< T, Allocator, Strategy >inline
pushBack(T &&value)flow::Vector< T, Allocator, Strategy >inline
reference typedefflow::Vector< T, Allocator, Strategy >
relocateBuffer(std::size_t capacity)flow::Vector< T, Allocator, Strategy >inlineprivate
relocateBufferWithHoles(std::size_t capacity, iterator pos, std::size_t holeSize)flow::Vector< T, Allocator, Strategy >inlineprivate
reserve(std::size_t capacity)flow::Vector< T, Allocator, Strategy >inline
resize(std::size_t size)flow::Vector< T, Allocator, Strategy >inline
resize(std::size_t size, const T &value)flow::Vector< T, Allocator, Strategy >inline
resizeImp(std::size_t size, const U &... optionalValue)flow::Vector< T, Allocator, Strategy >inlineprivate
size() const noexceptflow::Vector< T, Allocator, Strategy >inline
size_flow::Vector< T, Allocator, Strategy >private
size_type typedefflow::Vector< T, Allocator, Strategy >
swap(Vector &lhs, Vector &rhs) noexceptflow::Vector< T, Allocator, Strategy >friend
updateBuffer(T *buffer, std::size_t capacity)flow::Vector< T, Allocator, Strategy >inlineprivate
value_type typedefflow::Vector< T, Allocator, Strategy >
Vector() noexceptflow::Vector< T, Allocator, Strategy >inline
Vector(const allocator_type &allocator)flow::Vector< T, Allocator, Strategy >inlineexplicit
Vector(const Vector &rhs)flow::Vector< T, Allocator, Strategy >inline
Vector(const Vector &rhs, const allocator_type &allocator)flow::Vector< T, Allocator, Strategy >inline
Vector(Vector &&rhs) noexceptflow::Vector< T, Allocator, Strategy >inline
Vector(Vector &&rhs, const allocator_type &allocator)flow::Vector< T, Allocator, Strategy >inline
Vector(It first, It last, const allocator_type &allocator={})flow::Vector< T, Allocator, Strategy >inlineexplicit
Vector(std::initializer_list< T > list, const allocator_type &allocator={})flow::Vector< T, Allocator, Strategy >inline
Vector(std::size_t count, const allocator_type &allocator={})flow::Vector< T, Allocator, Strategy >inlineexplicit
Vector(std::size_t count, const T &value, const allocator_type &allocator={})flow::Vector< T, Allocator, Strategy >inlineexplicit
~Vector()flow::Vector< T, Allocator, Strategy >inline
+
+
+ + + + diff --git a/docs/classflow_1_1_vector.html b/docs/classflow_1_1_vector.html new file mode 100644 index 0000000..517aba5 --- /dev/null +++ b/docs/classflow_1_1_vector.html @@ -0,0 +1,2479 @@ + + + + + + + +Flow: flow::Vector< T, Allocator, Strategy > Class Template Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::Vector< T, Allocator, Strategy > Class Template Reference
+
+
+ +

#include <flow_vector.h>

+ + + + + + + + + + + + +

+Public Types

using value_type = T
using reference = T&
using const_reference = const T&
using pointer = T*
using const_pointer = const T*
using iterator = T*
using const_iterator = const T*
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using allocator_type = std::allocator_traits<Allocator>::template rebind_alloc<T>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

constexpr Vector () noexcept
constexpr Vector (const allocator_type &allocator)
constexpr Vector (const Vector &rhs)
constexpr Vector (const Vector &rhs, const allocator_type &allocator)
constexpr Vector (Vector &&rhs) noexcept
constexpr Vector (Vector &&rhs, const allocator_type &allocator)
template<std::input_iterator It>
constexpr Vector (It first, It last, const allocator_type &allocator={})
constexpr Vector (std::initializer_list< T > list, const allocator_type &allocator={})
constexpr Vector (std::size_t count, const allocator_type &allocator={})
constexpr Vector (std::size_t count, const T &value, const allocator_type &allocator={})
 ~Vector ()
Vectoroperator= (Vector rhs) noexcept
T & operator[] (std::size_t i) noexcept
const T & operator[] (std::size_t i) const noexcept
allocator_type get_allocator () const noexcept
iterator begin () noexcept
constexpr const_iterator begin () const noexcept
iterator end () noexcept
constexpr const_iterator end () const noexcept
constexpr std::size_t size () const noexcept
constexpr std::size_t capacity () const noexcept
constexpr bool empty () const noexcept
T & front () noexcept
constexpr const T & front () const noexcept
T & back () noexcept
constexpr const T & back () const noexcept
void clear () noexcept
void reserve (std::size_t capacity)
void resize (std::size_t size)
void resize (std::size_t size, const T &value)
void pushBack (const T &value)
void pushBack (T &&value)
template<typename ... Args>
void emplaceBack (Args &&... args)
void popBack () noexcept
iterator erase (iterator pos) noexcept
 Removes the element at the given position.
iterator erase (iterator first, iterator last) noexcept
 Removes elements in the range [first, last).
template<typename ... Args>
void emplace (iterator pos, Args &&... args)
void insert (iterator pos, const T &value)
void insert (iterator pos, T &&value)
void insert (iterator pos, std::size_t count, const T &value)
template<std::input_iterator It>
void insert (iterator pos, It first, It last)
void insert (iterator pos, std::initializer_list< T > list)
+ + +

+Private Types

using allocator_trait = std::allocator_traits<Allocator>::template rebind_traits<T>
+ + + + + + +

+Private Member Functions

void updateBuffer (T *buffer, std::size_t capacity)
void relocateBuffer (std::size_t capacity)
void relocateBufferWithHoles (std::size_t capacity, iterator pos, std::size_t holeSize)
template<typename ... U>
void resizeImp (std::size_t size, const U &... optionalValue)
+ + + + + + +

+Private Attributes

allocator_type allocator_
Strategy growthStrategy_
std::size_t size_
std::size_t capacity_
T * buffer_
+ + +

+Friends

void swap (Vector &lhs, Vector &rhs) noexcept
+

Detailed Description

+
template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+class flow::Vector< T, Allocator, Strategy >
+

Definition at line 47 of file flow_vector.h.

+

Member Typedef Documentation

+ +

◆ allocator_trait

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
using flow::Vector< T, Allocator, Strategy >::allocator_trait = std::allocator_traits<Allocator>::template rebind_traits<T>
+
+private
+
+ +

Definition at line 61 of file flow_vector.h.

+ +
+
+ +

◆ allocator_type

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::allocator_type = std::allocator_traits<Allocator>::template rebind_alloc<T>
+
+ +

Definition at line 58 of file flow_vector.h.

+ +
+
+ +

◆ const_iterator

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::const_iterator = const T*
+
+ +

Definition at line 55 of file flow_vector.h.

+ +
+
+ +

◆ const_pointer

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::const_pointer = const T*
+
+ +

Definition at line 53 of file flow_vector.h.

+ +
+
+ +

◆ const_reference

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::const_reference = const T&
+
+ +

Definition at line 51 of file flow_vector.h.

+ +
+
+ +

◆ difference_type

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::difference_type = std::ptrdiff_t
+
+ +

Definition at line 57 of file flow_vector.h.

+ +
+
+ +

◆ iterator

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::iterator = T*
+
+ +

Definition at line 54 of file flow_vector.h.

+ +
+
+ +

◆ pointer

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::pointer = T*
+
+ +

Definition at line 52 of file flow_vector.h.

+ +
+
+ +

◆ reference

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::reference = T&
+
+ +

Definition at line 50 of file flow_vector.h.

+ +
+
+ +

◆ size_type

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::size_type = std::size_t
+
+ +

Definition at line 56 of file flow_vector.h.

+ +
+
+ +

◆ value_type

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + +
using flow::Vector< T, Allocator, Strategy >::value_type = T
+
+ +

Definition at line 49 of file flow_vector.h.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Vector() [1/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector ()
+
+inlineconstexprnoexcept
+
+ +

Definition at line 116 of file flow_vector.h.

+
+
118 }
+
std::allocator_traits< Allocator >::template rebind_alloc< T > allocator_type
Definition flow_vector.h:58
+
constexpr Vector() noexcept
+
+

References Vector().

+ +

Referenced by operator=(), swap, Vector(), Vector(), Vector(), Vector(), and Vector().

+ +
+
+ +

◆ Vector() [2/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (const allocator_type & allocator)
+
+inlineexplicitconstexpr
+
+ +

Definition at line 120 of file flow_vector.h.

+
+ +
123 size_(0),
+
124 capacity_(0),
+
125 buffer_(nullptr) {
+
126 }
+ + +
Strategy growthStrategy_
Definition flow_vector.h:64
+
std::size_t size_
Definition flow_vector.h:65
+
std::size_t capacity_
Definition flow_vector.h:66
+
allocator_type allocator_
Definition flow_vector.h:63
+
+

References allocator_, buffer_, capacity_, growthStrategy_, and size_.

+ +
+
+ +

◆ Vector() [3/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (const Vector< T, Allocator, Strategy > & rhs)
+
+inlineconstexpr
+
+ +

Definition at line 128 of file flow_vector.h.

+
+
130 }
+
allocator_type get_allocator() const noexcept
+
+

References get_allocator(), and Vector().

+ +
+
+ +

◆ Vector() [4/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (const Vector< T, Allocator, Strategy > & rhs,
const allocator_type & allocator )
+
+inlineconstexpr
+
+ +

Definition at line 132 of file flow_vector.h.

+
+ +
135 size_(rhs.size_),
+ + + +
139 }
+
iterator begin() noexcept
+
iterator end() noexcept
+
OutputIt uninitializedForward(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
Forward elements from a source range to uninitialized memory.
+
+

References allocator_, begin(), buffer_, capacity_, end(), growthStrategy_, size_, flow::uninitializedForward(), and Vector().

+ +
+
+ +

◆ Vector() [5/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (Vector< T, Allocator, Strategy > && rhs)
+
+inlineconstexprnoexcept
+
+ +

Definition at line 142 of file flow_vector.h.

+
+
144 }
+
+

References Vector().

+ +
+
+ +

◆ Vector() [6/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (Vector< T, Allocator, Strategy > && rhs,
const allocator_type & allocator )
+
+inlineconstexpr
+
+ +

Definition at line 147 of file flow_vector.h.

+
148 : Vector(allocator) {
+
149
+
150 if (rhs.get_allocator() == allocator) {
+
151 swap(*this, rhs);
+
152 } else {
+
153 // Create a copy with new allocator, then swap over.
+ +
155 swap(*this, rhsCopy);
+
156 }
+
157 }
+
friend void swap(Vector &lhs, Vector &rhs) noexcept
+
+

References Vector().

+ +
+
+ +

◆ Vector() [7/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+template<std::input_iterator It>
+ + + + + +
+ + + + + + + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (It first,
It last,
const allocator_type & allocator = {} )
+
+inlineexplicitconstexpr
+
+ +

Definition at line 160 of file flow_vector.h.

+
160 {})
+ + + + + + +
167 }
+
std::allocator_traits< Allocator >::template rebind_traits< T > allocator_trait
Definition flow_vector.h:61
+
+
+
+ +

◆ Vector() [8/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (std::initializer_list< T > list,
const allocator_type & allocator = {} )
+
+inlineconstexpr
+
+ +

Definition at line 169 of file flow_vector.h.

+
169 {})
+
170 : Vector(list.begin(), list.end(), allocator) {
+
171 }
+
+
+
+ +

◆ Vector() [9/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (std::size_t count,
const allocator_type & allocator = {} )
+
+inlineexplicitconstexpr
+
+ +

Definition at line 173 of file flow_vector.h.

+
173 {})
+ + +
176 size_(count),
+ + + +
180 }
+
OutputIt uninitializedEmplaceN(AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
Constructs a specified number of objects in uninitialized memory by forwarding arguments to their con...
+
+
+
+ +

◆ Vector() [10/10]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + + + + + + +
flow::Vector< T, Allocator, Strategy >::Vector (std::size_t count,
const T & value,
const allocator_type & allocator = {} )
+
+inlineexplicitconstexpr
+
+ +

Definition at line 182 of file flow_vector.h.

+
182 {})
+ + +
185 size_(count),
+ + + +
189 }
+
OutputIt uninitializedFillN(AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
Fills count elements in uninitialized memory with a value.
+
+
+
+ +

◆ ~Vector()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
flow::Vector< T, Allocator, Strategy >::~Vector ()
+
+inline
+
+ +

Definition at line 192 of file flow_vector.h.

+
192 {
+ +
194 }
+
void deleteBuffer(AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is...
+
+

References allocator_, buffer_, capacity_, flow::deleteBuffer(), and size_.

+ +
+
+

Member Function Documentation

+ +

◆ back() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
const T & flow::Vector< T, Allocator, Strategy >::back () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 262 of file flow_vector.h.

+
262 {
+
263 assert(0 < size_ && "access empty Vector back");
+
264 return buffer_[size_ - 1];
+
265 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ back() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
T & flow::Vector< T, Allocator, Strategy >::back ()
+
+inlinenoexcept
+
+ +

Definition at line 257 of file flow_vector.h.

+
257 {
+
258 assert(0 < size_ && "access empty Vector back");
+
259 return buffer_[size_ - 1];
+
260 }
+
+

References buffer_, and size_.

+ +

Referenced by emplace().

+ +
+
+ +

◆ begin() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
const_iterator flow::Vector< T, Allocator, Strategy >::begin () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 222 of file flow_vector.h.

+
222 {
+
223 return buffer_;
+
224 }
+
+

References buffer_.

+ +
+
+ +

◆ begin() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
iterator flow::Vector< T, Allocator, Strategy >::begin ()
+
+inlinenoexcept
+
+ +

Definition at line 218 of file flow_vector.h.

+
218 {
+
219 return buffer_;
+
220 }
+
+

References buffer_.

+ +

Referenced by erase(), erase(), insert(), relocateBuffer(), relocateBufferWithHoles(), and Vector().

+ +
+
+ +

◆ capacity()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
std::size_t flow::Vector< T, Allocator, Strategy >::capacity () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 239 of file flow_vector.h.

+
239 {
+
240 return capacity_;
+
241 }
+
+

References capacity_.

+ +

Referenced by relocateBuffer(), relocateBufferWithHoles(), reserve(), and updateBuffer().

+ +
+
+ +

◆ clear()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::clear ()
+
+inlinenoexcept
+
+ +

Definition at line 268 of file flow_vector.h.

+
268 {
+ +
270 size_ = 0;
+
271 }
+
void destroyElementsN(AllocatorType &allocator, InputIt first, std::size_t count) noexcept
Destroys count objects in a range.
+
+

References allocator_, buffer_, flow::destroyElementsN(), and size_.

+ +
+
+ +

◆ emplace()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+template<typename ... Args>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::emplace (iterator pos,
Args &&... args )
+
+inline
+
+ +

Definition at line 341 of file flow_vector.h.

+
341 {
+
342 // Special case: append at the end.
+
343 if (pos == end()) {
+ +
345 return;
+
346 }
+
347
+
348 if (size_ < capacity_) {
+
349 // Enough capacity, right shift the elements.
+
350 // Major optimization to use memcpy, copy_backward, or range move_backward instead of handroll loop. A 70% reduction in computation time.
+ +
352 std::move_backward(pos, end()-1, end());
+ +
354
+
355 } else {
+
356 // Not enough capacity, relocate all to a new buffer.
+ + + +
360 }
+
361 ++size_;
+
362 }
+
void emplaceBack(Args &&... args)
+
void relocateBufferWithHoles(std::size_t capacity, iterator pos, std::size_t holeSize)
Definition flow_vector.h:87
+
T & back() noexcept
+
+

References allocator_, back(), buffer_, capacity_, emplaceBack(), end(), growthStrategy_, relocateBufferWithHoles(), and size_.

+ +

Referenced by insert(), and insert().

+ +
+
+ +

◆ emplaceBack()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+template<typename ... Args>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::emplaceBack (Args &&... args)
+
+inline
+
+ +

Definition at line 298 of file flow_vector.h.

+
298 {
+
299 if (size_ == capacity_) {
+ +
301 }
+ +
303 ++size_;
+
304 }
+
void relocateBuffer(std::size_t capacity)
Definition flow_vector.h:78
+
+

References allocator_, buffer_, capacity_, growthStrategy_, relocateBuffer(), and size_.

+ +

Referenced by emplace(), pushBack(), and pushBack().

+ +
+
+ +

◆ empty()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
bool flow::Vector< T, Allocator, Strategy >::empty () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 243 of file flow_vector.h.

+
243 {
+
244 return size_ == 0;
+
245 }
+
+

References size_.

+ +
+
+ +

◆ end() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
const_iterator flow::Vector< T, Allocator, Strategy >::end () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 230 of file flow_vector.h.

+
230 {
+
231 return buffer_ + size_;
+
232 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ end() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
iterator flow::Vector< T, Allocator, Strategy >::end ()
+
+inlinenoexcept
+
+ +

Definition at line 226 of file flow_vector.h.

+
226 {
+
227 return buffer_ + size_;
+
228 }
+
+

References buffer_, and size_.

+ +

Referenced by emplace(), erase(), erase(), insert(), relocateBuffer(), relocateBufferWithHoles(), and Vector().

+ +
+
+ +

◆ erase() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
iterator flow::Vector< T, Allocator, Strategy >::erase (iterator first,
iterator last )
+
+inlinenoexcept
+
+ +

Removes elements in the range [first, last).

+
Parameters
+ + + +
firstIterator to the start of the range to remove.
lastIterator to the end of the range to remove.
+
+
+
Returns
Iterator to the next element, or end() if range ended at the last element.
+ +

Definition at line 330 of file flow_vector.h.

+
330 {
+
331 assert(begin() <= first && last <= end() && "can not erase before begin() or past the end()");
+
332 assert(first <= last && "first must be before last");
+
333
+ + +
336 size_ -= last - first;
+
337 return first;
+
338 }
+ +
void destroyElements(AllocatorType &allocator, InputIt first, InputIt last) noexcept
Destroys a range of constructed objects in memory.
+
+

References allocator_, begin(), flow::destroyElements(), end(), and size_.

+ +
+
+ +

◆ erase() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
iterator flow::Vector< T, Allocator, Strategy >::erase (iterator pos)
+
+inlinenoexcept
+
+ +

Removes the element at the given position.

+
Parameters
+ + +
posIterator to the element to remove (must not be end()).
+
+
+
Returns
Iterator to the next element, or end() if last was removed.
+ +

Definition at line 317 of file flow_vector.h.

+
317 {
+
318 assert(begin() <= pos && pos < end() && "can not erase before begin() or at the end()");
+
319 std::move(pos + 1, end(), pos);
+
320 popBack();
+
321 return pos;
+
322 }
+
void popBack() noexcept
+
+

References begin(), end(), and popBack().

+ +
+
+ +

◆ front() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
const T & flow::Vector< T, Allocator, Strategy >::front () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 252 of file flow_vector.h.

+
252 {
+
253 assert(0 < size_ && "access empty Vector front");
+
254 return buffer_[0];
+
255 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ front() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
T & flow::Vector< T, Allocator, Strategy >::front ()
+
+inlinenoexcept
+
+ +

Definition at line 247 of file flow_vector.h.

+
247 {
+
248 assert(0 < size_ && "access empty Vector front");
+
249 return buffer_[0];
+
250 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ get_allocator()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
allocator_type flow::Vector< T, Allocator, Strategy >::get_allocator () const
+
+inlinenoexcept
+
+ +

Definition at line 213 of file flow_vector.h.

+
213 {
+
214 return allocator_;
+
215 }
+
+

References allocator_.

+ +

Referenced by Vector().

+ +
+
+ +

◆ insert() [1/5]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::insert (iterator pos,
const T & value )
+
+inline
+
+ +

Definition at line 364 of file flow_vector.h.

+
364 {
+
365 emplace(pos, value);
+
366 }
+
void emplace(iterator pos, Args &&... args)
+
+

References emplace().

+ +

Referenced by insert(), and insert().

+ +
+
+ +

◆ insert() [2/5]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+template<std::input_iterator It>
+ + + + + +
+ + + + + + + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::insert (iterator pos,
It first,
It last )
+
+inline
+
+ +

Definition at line 378 of file flow_vector.h.

+
378 {
+ + +
381
+
382 if (capacity_ < requiredSize) {
+
383 // Not enough capacity, relocate to a new buffer.
+ + + + +
388 } else {
+
389 // Enough capacity, shift elements.
+
390 // Inserted that are inbound = Shifted that are outbound.
+ + + + +
395
+
396 // Shifted elements that are on uninitialized buffer range.
+
397 // This range can be empty if insert at end().
+ +
399
+
400 // Shifted elements that are on initialized buffer range.
+
401 // This range can be empty if all shifted elements must move to the uninitialized buffer from the previous step.
+ +
403
+
404 // Inserted elements that are on initialized buffer range starting at pos.
+
405 // This range can be empty if insert at end().
+
406 for (std::size_t i = 0; i < conflictedRangeSize; ++i, ++first, ++pos) {
+
407 *pos = *first;
+
408 }
+
409
+
410 // Inserted elements that are on uninitialized buffer range.
+
411 // This range can be empty if insertedElementSize <= shiftedElementSize -> conflictedRangeSize = insertedElementSize.
+
412 // Such that there are enough space in the initialized buffer range.
+ +
414 }
+
415
+ +
417 }
+
OutputIt uninitializedMove(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
Moves elements from a source range to uninitialized memory.
+
OutputIt uninitializedForwardN(AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
Forward count elements from a source range to uninitialized memory.
+
+

References allocator_, begin(), capacity_, end(), growthStrategy_, relocateBufferWithHoles(), size_, flow::uninitializedForward(), flow::uninitializedForwardN(), and flow::uninitializedMove().

+ +
+
+ +

◆ insert() [3/5]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::insert (iterator pos,
std::initializer_list< T > list )
+
+inline
+
+ +

Definition at line 419 of file flow_vector.h.

+
419 {
+
420 insert(pos, list.begin(), list.end());
+
421 }
+
void insert(iterator pos, const T &value)
+
+

References insert().

+ +
+
+ +

◆ insert() [4/5]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::insert (iterator pos,
std::size_t count,
const T & value )
+
+inline
+
+ +

Definition at line 372 of file flow_vector.h.

+ +

References insert().

+ +
+
+ +

◆ insert() [5/5]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::insert (iterator pos,
T && value )
+
+inline
+
+ +

Definition at line 368 of file flow_vector.h.

+
368 {
+ +
370 }
+
+

References emplace().

+ +
+
+ +

◆ operator=()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
Vector & flow::Vector< T, Allocator, Strategy >::operator= (Vector< T, Allocator, Strategy > rhs)
+
+inlinenoexcept
+
+ +

Definition at line 197 of file flow_vector.h.

+
197 {
+
198 swap(*this, rhs);
+
199 return *this;
+
200 }
+
+

References swap, and Vector().

+ +
+
+ +

◆ operator[]() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
const T & flow::Vector< T, Allocator, Strategy >::operator[] (std::size_t i) const
+
+inlinenoexcept
+
+ +

Definition at line 207 of file flow_vector.h.

+
207 {
+
208 assert(i < size_ && "index out of bound");
+
209 return buffer_[i];
+
210 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ operator[]() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
T & flow::Vector< T, Allocator, Strategy >::operator[] (std::size_t i)
+
+inlinenoexcept
+
+ +

Definition at line 202 of file flow_vector.h.

+
202 {
+
203 assert(i < size_ && "index out of bound");
+
204 return buffer_[i];
+
205 }
+
+

References buffer_, and size_.

+ +
+
+ +

◆ popBack()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::popBack ()
+
+inlinenoexcept
+
+ +

Definition at line 306 of file flow_vector.h.

+
306 {
+
307 assert(0 < size_ && "can not pop back from an empty vector");
+
308 --size_;
+ +
310 }
+
+

References allocator_, buffer_, and size_.

+ +

Referenced by erase().

+ +
+
+ +

◆ pushBack() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::pushBack (const T & value)
+
+inline
+
+ +

Definition at line 289 of file flow_vector.h.

+
289 {
+ +
291 }
+
+

References emplaceBack().

+ +
+
+ +

◆ pushBack() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::pushBack (T && value)
+
+inline
+
+ +

Definition at line 293 of file flow_vector.h.

+
293 {
+ +
295 }
+
+

References emplaceBack().

+ +
+
+ +

◆ relocateBuffer()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::relocateBuffer (std::size_t capacity)
+
+inlineprivate
+
+ +

Definition at line 78 of file flow_vector.h.

+
78 {
+
79 assert(capacity_ < capacity && "new capacity is no larger than the old capacity");
+
80
+ + + +
84 }
+
constexpr std::size_t capacity() const noexcept
+
void updateBuffer(T *buffer, std::size_t capacity)
Definition flow_vector.h:70
+
+

References allocator_, begin(), capacity(), capacity_, end(), flow::uninitializedMove(), and updateBuffer().

+ +

Referenced by emplaceBack(), reserve(), and resizeImp().

+ +
+
+ +

◆ relocateBufferWithHoles()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::relocateBufferWithHoles (std::size_t capacity,
iterator pos,
std::size_t holeSize )
+
+inlineprivate
+
+ +

Definition at line 87 of file flow_vector.h.

+
87 {
+
88 assert(capacity_ < capacity && "new capacity is no larger than the old capacity");
+
89
+ +
91 iterator leftHalf = uninitializedMove(allocator_, begin(), pos, buffer); // Move left half.
+
92 uninitializedMove(allocator_, pos, end(), leftHalf + holeSize); // Move right half.
+ +
94 }
+
+

References allocator_, begin(), capacity(), capacity_, end(), flow::uninitializedMove(), and updateBuffer().

+ +

Referenced by emplace(), and insert().

+ +
+
+ +

◆ reserve()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::reserve (std::size_t capacity)
+
+inline
+
+ +

Definition at line 273 of file flow_vector.h.

+
273 {
+
274 if (capacity_ < capacity) {
+ +
276 }
+
277 }
+
+

References capacity(), capacity_, and relocateBuffer().

+ +
+
+ +

◆ resize() [1/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
void flow::Vector< T, Allocator, Strategy >::resize (std::size_t size)
+
+inline
+
+ +

Definition at line 279 of file flow_vector.h.

+
279 {
+ +
281 }
+
constexpr std::size_t size() const noexcept
+
void resizeImp(std::size_t size, const U &... optionalValue)
Definition flow_vector.h:97
+
+

References resizeImp(), and size().

+ +
+
+ +

◆ resize() [2/2]

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::resize (std::size_t size,
const T & value )
+
+inline
+
+ +

Definition at line 283 of file flow_vector.h.

+
283 {
+ +
285 }
+
+

References resizeImp(), and size().

+ +
+
+ +

◆ resizeImp()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+template<typename ... U>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::resizeImp (std::size_t size,
const U &... optionalValue )
+
+inlineprivate
+
+ +

Definition at line 97 of file flow_vector.h.

+
97 {
+
98 static_assert(sizeof...(optionalValue) <= 1, "no fill value or exactly one copy");
+
99 if (size_ < size) {
+
100 // Relocate if not enough capacity.
+
101 if (capacity_ < size) {
+ +
103 }
+ +
105
+
106 } else if (size < size_) {
+
107 // Shrink.
+ +
109 }
+
110 size_ = size;
+
111 }
+
OutputIt uninitializedEmplace(AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
Constructs objects in uninitialized memory by copying arguments to their constructor....
+
+

References allocator_, buffer_, capacity_, flow::destroyElements(), relocateBuffer(), size(), size_, and flow::uninitializedEmplace().

+ +

Referenced by resize(), and resize().

+ +
+
+ +

◆ size()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + +
std::size_t flow::Vector< T, Allocator, Strategy >::size () const
+
+inlineconstexprnoexcept
+
+ +

Definition at line 235 of file flow_vector.h.

+
235 {
+
236 return size_;
+
237 }
+
+

References size_.

+ +

Referenced by resize(), resize(), and resizeImp().

+ +
+
+ +

◆ updateBuffer()

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void flow::Vector< T, Allocator, Strategy >::updateBuffer (T * buffer,
std::size_t capacity )
+
+inlineprivate
+
+ +

Definition at line 70 of file flow_vector.h.

+
70 {
+ + + +
74 }
+
+

References allocator_, buffer_, capacity(), capacity_, flow::deleteBuffer(), and size_.

+ +

Referenced by relocateBuffer(), and relocateBufferWithHoles().

+ +
+
+ + +

◆ swap

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + + + + + + + + +
void swap (Vector< T, Allocator, Strategy > & lhs,
Vector< T, Allocator, Strategy > & rhs )
+
+friend
+
+ +

Definition at line 424 of file flow_vector.h.

+ +

References swap, and Vector().

+ +

Referenced by operator=(), and swap.

+ +
+
+

Member Data Documentation

+ +

◆ allocator_

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
allocator_type flow::Vector< T, Allocator, Strategy >::allocator_
+
+private
+
+
+ +

◆ buffer_

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
T* flow::Vector< T, Allocator, Strategy >::buffer_
+
+private
+
+
+ +

◆ capacity_

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
std::size_t flow::Vector< T, Allocator, Strategy >::capacity_
+
+private
+
+
+ +

◆ growthStrategy_

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
Strategy flow::Vector< T, Allocator, Strategy >::growthStrategy_
+
+private
+
+ +

Definition at line 64 of file flow_vector.h.

+ +

Referenced by emplace(), emplaceBack(), insert(), Vector(), and Vector().

+ +
+
+ +

◆ size_

+ +
+
+
+template<typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+ + + + + +
+ + + + +
std::size_t flow::Vector< T, Allocator, Strategy >::size_
+
+private
+
+
+
The documentation for this class was generated from the following file: +
+
+ +
+ + + + diff --git a/docs/classflow_1_1_vector.js b/docs/classflow_1_1_vector.js new file mode 100644 index 0000000..b9bd76e --- /dev/null +++ b/docs/classflow_1_1_vector.js @@ -0,0 +1,66 @@ +var classflow_1_1_vector = +[ + [ "allocator_trait", "classflow_1_1_vector.html#a424909668ab5c7879b210d83dba285df", null ], + [ "allocator_type", "classflow_1_1_vector.html#ad756f48cb4b3d644d3ee2272016e53de", null ], + [ "const_iterator", "classflow_1_1_vector.html#aa4f0dcb2f767deb46994373b482b6a18", null ], + [ "const_pointer", "classflow_1_1_vector.html#a90e6c66561997c8e87dcf45565b6b444", null ], + [ "const_reference", "classflow_1_1_vector.html#ac10202bb1cc96d8801447779c18d19d2", null ], + [ "difference_type", "classflow_1_1_vector.html#ad698ac46b7cd873095875b41509e0a3c", null ], + [ "iterator", "classflow_1_1_vector.html#a3133e96d4479ecd0534588a8df0b5eb7", null ], + [ "pointer", "classflow_1_1_vector.html#adc242dbb463beb99e19cb80f9e67e2b0", null ], + [ "reference", "classflow_1_1_vector.html#abc2b6c908cb60802eab99fdf9f25b14f", null ], + [ "size_type", "classflow_1_1_vector.html#a2181ecd90ff7fce1ff9c8876d8d05b3b", null ], + [ "value_type", "classflow_1_1_vector.html#ad2d841f6f75875ad349b649648c9528b", null ], + [ "Vector", "classflow_1_1_vector.html#af0f1a455c67e5f7a9d10849ed88b7559", null ], + [ "Vector", "classflow_1_1_vector.html#ab2a7b99b11f7bb0a30f1586ea1d178bf", null ], + [ "Vector", "classflow_1_1_vector.html#a5daa11faad80d18ed87c7e0f409b0645", null ], + [ "Vector", "classflow_1_1_vector.html#aebbcc7115c8718581e35b4702247907d", null ], + [ "Vector", "classflow_1_1_vector.html#a1b81dfaab65161f7a66038bffabc7248", null ], + [ "Vector", "classflow_1_1_vector.html#a411e4c3e8586db8943dfce5c3d7340a6", null ], + [ "Vector", "classflow_1_1_vector.html#abb3aa43549b77168fb56371086ec4447", null ], + [ "Vector", "classflow_1_1_vector.html#ae0c4ade36741c6f196021349b5485526", null ], + [ "Vector", "classflow_1_1_vector.html#a67fd714b4b2af6bda5df8b7f1d152869", null ], + [ "Vector", "classflow_1_1_vector.html#a9153f6768f8c3b6aa92c6d8f9538722f", null ], + [ "~Vector", "classflow_1_1_vector.html#a2ed0e854ec90587355a567fa8c2efdc0", null ], + [ "back", "classflow_1_1_vector.html#a23941afb170992195959db92f14bc114", null ], + [ "back", "classflow_1_1_vector.html#ad02fbe2f355e1bea83186cbb97b53d69", null ], + [ "begin", "classflow_1_1_vector.html#af0f7ae6593900ce9862bf99895c4e181", null ], + [ "begin", "classflow_1_1_vector.html#a52107e19ce15e50a4a610a1486203a55", null ], + [ "capacity", "classflow_1_1_vector.html#a5fdda2faa17a39759f1068d09d94f980", null ], + [ "clear", "classflow_1_1_vector.html#ae778656d8599eb0152135aaa57b61057", null ], + [ "emplace", "classflow_1_1_vector.html#a63907d377f79ae43c766427da7391471", null ], + [ "emplaceBack", "classflow_1_1_vector.html#a1246fe8e463045cd9acefd4ffed3bea2", null ], + [ "empty", "classflow_1_1_vector.html#ad4726df83d62b3869b5c28cf93b27c66", null ], + [ "end", "classflow_1_1_vector.html#ad6491063afb2f969da46c7617f09e048", null ], + [ "end", "classflow_1_1_vector.html#ad9bee88ac142d52bc14d3b7c12c5d27a", null ], + [ "erase", "classflow_1_1_vector.html#a233300c7d3c47e40b70af817590c9811", null ], + [ "erase", "classflow_1_1_vector.html#a72bef13d7f81c286d42432ceabe20d20", null ], + [ "front", "classflow_1_1_vector.html#aba8ae41829ab1c48b546778403d99d6c", null ], + [ "front", "classflow_1_1_vector.html#abc27ebfeb384b081289612be2526a703", null ], + [ "get_allocator", "classflow_1_1_vector.html#a0eb1f3871c6a3c5dd0d21eeded97507b", null ], + [ "insert", "classflow_1_1_vector.html#afc9e7deb83d7e224959f1d0c2bcfb2b6", null ], + [ "insert", "classflow_1_1_vector.html#a022a327a5db05b8c23158aa44aa642ea", null ], + [ "insert", "classflow_1_1_vector.html#ac98171a9ca91d6e2b7c77f2b531b7ca1", null ], + [ "insert", "classflow_1_1_vector.html#ac33ba3bee9a3d91ec7233e5ed5767695", null ], + [ "insert", "classflow_1_1_vector.html#a7b99f7d13471a841f4b0bbe7b7e81f00", null ], + [ "operator=", "classflow_1_1_vector.html#a60a7fdd5aa4be9e4abd7b01a351c35e4", null ], + [ "operator[]", "classflow_1_1_vector.html#aa43b28b69455eac2404894fd3b0d6c6b", null ], + [ "operator[]", "classflow_1_1_vector.html#a7c61fc01669f8da61d0f9c23513666de", null ], + [ "popBack", "classflow_1_1_vector.html#ae39c634ffc7d4719734a727dd4e9eb02", null ], + [ "pushBack", "classflow_1_1_vector.html#a49e7b072f9b5c0a2c7e977e92ea79260", null ], + [ "pushBack", "classflow_1_1_vector.html#a7b62dc6983a3b84ac1ee151821f93e92", null ], + [ "relocateBuffer", "classflow_1_1_vector.html#aad83e0ac5232072e914bd75e4b116473", null ], + [ "relocateBufferWithHoles", "classflow_1_1_vector.html#a53fca75839ead5d5a63aa334effc2663", null ], + [ "reserve", "classflow_1_1_vector.html#afa87bdfe245b4b06339eea38ce140ebb", null ], + [ "resize", "classflow_1_1_vector.html#abe9e6c30c45760900e713664e3c7ee95", null ], + [ "resize", "classflow_1_1_vector.html#a956bdadf66a3cf83543fdb4880a7ed30", null ], + [ "resizeImp", "classflow_1_1_vector.html#aa28bafb52ffd5943f74f969f3970700d", null ], + [ "size", "classflow_1_1_vector.html#a174ef01cedf42bda75a148f1e665506e", null ], + [ "updateBuffer", "classflow_1_1_vector.html#ab9a6c86d36489ee0b22dcc7ffadba93b", null ], + [ "swap", "classflow_1_1_vector.html#acc30803f60627ed546fa47629ef134c1", null ], + [ "allocator_", "classflow_1_1_vector.html#ad06c3b5cb971e7dbf7cdba5be93f7f06", null ], + [ "buffer_", "classflow_1_1_vector.html#a597edff02196a283944224a5464c62a0", null ], + [ "capacity_", "classflow_1_1_vector.html#ac2b41594b3b91f858c9c429ef98f4ae0", null ], + [ "growthStrategy_", "classflow_1_1_vector.html#a6194e8a003c84766b0e07ab59129fd60", null ], + [ "size_", "classflow_1_1_vector.html#a6205cfde685f45023d7f26941997a3ee", null ] +]; \ No newline at end of file diff --git a/docs/clipboard.js b/docs/clipboard.js new file mode 100644 index 0000000..9da9f3c --- /dev/null +++ b/docs/clipboard.js @@ -0,0 +1,61 @@ +/** + +The code below is based on the Doxygen Awesome project, see +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2022 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +let clipboard_title = "Copy to clipboard" +let clipboard_icon = `` +let clipboard_successIcon = `` +let clipboard_successDuration = 1000 + +$(function() { + if(navigator.clipboard) { + const fragments = document.getElementsByClassName("fragment") + for(const fragment of fragments) { + const clipboard_div = document.createElement("div") + clipboard_div.classList.add("clipboard") + clipboard_div.innerHTML = clipboard_icon + clipboard_div.title = clipboard_title + $(clipboard_div).click(function() { + const content = this.parentNode.cloneNode(true) + // filter out line number and folded fragments from file listings + content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) + let text = content.textContent + // remove trailing newlines and trailing spaces from empty lines + text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') + navigator.clipboard.writeText(text); + this.classList.add("success") + this.innerHTML = clipboard_successIcon + window.setTimeout(() => { // switch back to normal icon after timeout + this.classList.remove("success") + this.innerHTML = clipboard_icon + }, clipboard_successDuration); + }) + fragment.insertBefore(clipboard_div, fragment.firstChild) + } + } +}) diff --git a/docs/conceptflow_1_1_growth_strategy.html b/docs/conceptflow_1_1_growth_strategy.html new file mode 100644 index 0000000..cdc390b --- /dev/null +++ b/docs/conceptflow_1_1_growth_strategy.html @@ -0,0 +1,117 @@ + + + + + + + +Flow: flow::GrowthStrategy Concept Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow::GrowthStrategy Concept Reference
+
+
+ +

#include <flow_vector.h>

+

Concept definition

+
template<typename Strategy>
+
concept flow::GrowthStrategy = requires(Strategy strategy, std::size_t num) {
+
{ strategy(num) } -> std::same_as<std::size_t>;
+
}
+ +

Detailed Description

+
+

Definition at line 14 of file flow_vector.h.

+
+
+
+ + + + diff --git a/docs/concepts.html b/docs/concepts.html new file mode 100644 index 0000000..8253176 --- /dev/null +++ b/docs/concepts.html @@ -0,0 +1,111 @@ + + + + + + + +Flow: Concepts + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Concepts
+
+
+
Here is a list of all concepts with brief descriptions:
+
[detail level 12]
+ + +
 Nflow
 RGrowthStrategy
+
+
+
+
+ + + + diff --git a/docs/concepts.js b/docs/concepts.js new file mode 100644 index 0000000..6ec90f5 --- /dev/null +++ b/docs/concepts.js @@ -0,0 +1,6 @@ +var concepts = +[ + [ "flow", "namespaceflow.html", [ + [ "GrowthStrategy", "conceptflow_1_1_growth_strategy.html", null ] + ] ] +]; \ No newline at end of file diff --git a/docs/cookie.js b/docs/cookie.js new file mode 100644 index 0000000..53ad21d --- /dev/null +++ b/docs/cookie.js @@ -0,0 +1,58 @@ +/*! + Cookie helper functions + Copyright (c) 2023 Dimitri van Heesch + Released under MIT license. +*/ +let Cookie = { + cookie_namespace: 'doxygen_', + + readSetting(cookie,defVal) { + if (window.chrome) { + const val = localStorage.getItem(this.cookie_namespace+cookie) || + sessionStorage.getItem(this.cookie_namespace+cookie); + if (val) return val; + } else { + let myCookie = this.cookie_namespace+cookie+"="; + if (document.cookie) { + const index = document.cookie.indexOf(myCookie); + if (index != -1) { + const valStart = index + myCookie.length; + let valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + return document.cookie.substring(valStart, valEnd); + } + } + } + return defVal; + }, + + writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete + if (window.chrome) { + if (days==0) { + sessionStorage.setItem(this.cookie_namespace+cookie,val); + } else { + localStorage.setItem(this.cookie_namespace+cookie,val); + } + } else { + let date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; + document.cookie = this.cookie_namespace + cookie + "=" + + val + "; SameSite=Lax;" + expiration + "path=/"; + } + }, + + eraseSetting(cookie) { + if (window.chrome) { + if (localStorage.getItem(this.cookie_namespace+cookie)) { + localStorage.removeItem(this.cookie_namespace+cookie); + } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { + sessionStorage.removeItem(this.cookie_namespace+cookie); + } + } else { + this.writeSetting(cookie,'',-1); + } + }, +} diff --git a/docs/doxygen.css b/docs/doxygen.css new file mode 100644 index 0000000..5d2eecd --- /dev/null +++ b/docs/doxygen.css @@ -0,0 +1,2461 @@ +/* The standard CSS for doxygen 1.14.0*/ + +html { +/* page base colors */ +--page-background-color: white; +--page-foreground-color: black; +--page-link-color: #3D578C; +--page-visited-link-color: #3D578C; +--page-external-link-color: #334975; + +/* index */ +--index-odd-item-bg-color: #F8F9FC; +--index-even-item-bg-color: white; +--index-header-color: black; +--index-separator-color: #A0A0A0; + +/* header */ +--header-background-color: #F9FAFC; +--header-separator-color: #C4CFE5; +--group-header-separator-color: #D9E0EE; +--group-header-color: #354C7B; +--inherit-header-color: gray; + +--footer-foreground-color: #2A3D61; +--footer-logo-width: 75px; +--citation-label-color: #334975; +--glow-color: cyan; + +--title-background-color: white; +--title-separator-color: #C4CFE5; +--directory-separator-color: #9CAFD4; +--separator-color: #4A6AAA; + +--blockquote-background-color: #F7F8FB; +--blockquote-border-color: #9CAFD4; + +--scrollbar-thumb-color: #C4CFE5; +--scrollbar-background-color: #F9FAFC; + +--icon-background-color: #728DC1; +--icon-foreground-color: white; +/* +--icon-doc-image: url('doc.svg'); +--icon-folder-open-image: url('folderopen.svg'); +--icon-folder-closed-image: url('folderclosed.svg');*/ +--icon-folder-open-fill-color: #C4CFE5; +--icon-folder-fill-color: #D8DFEE; +--icon-folder-border-color: #4665A2; +--icon-doc-fill-color: #D8DFEE; +--icon-doc-border-color: #4665A2; + +/* brief member declaration list */ +--memdecl-background-color: #F9FAFC; +--memdecl-separator-color: #DEE4F0; +--memdecl-foreground-color: #555; +--memdecl-template-color: #4665A2; +--memdecl-border-color: #D5DDEC; + +/* detailed member list */ +--memdef-border-color: #A8B8D9; +--memdef-title-background-color: #E2E8F2; +--memdef-proto-background-color: #EEF1F7; +--memdef-proto-text-color: #253555; +--memdef-doc-background-color: white; +--memdef-param-name-color: #602020; +--memdef-template-color: #4665A2; + +/* tables */ +--table-cell-border-color: #2D4068; +--table-header-background-color: #374F7F; +--table-header-foreground-color: #FFFFFF; + +/* labels */ +--label-background-color: #728DC1; +--label-left-top-border-color: #5373B4; +--label-right-bottom-border-color: #C4CFE5; +--label-foreground-color: white; + +/** navigation bar/tree/menu */ +--nav-background-color: #F9FAFC; +--nav-foreground-color: #364D7C; +--nav-border-color: #C4CFE5; +--nav-breadcrumb-separator-color: #C4CFE5; +--nav-breadcrumb-active-bg: #EEF1F7; +--nav-breadcrumb-color: #354C7B; +--nav-breadcrumb-border-color: #E1E7F2; +--nav-splitbar-bg-color: #DCE2EF; +--nav-splitbar-handle-color: #9CAFD4; +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #283A5D; +--nav-text-hover-color: white; +--nav-text-active-color: white; +--nav-menu-button-color: #364D7C; +--nav-menu-background-color: white; +--nav-menu-foreground-color: #555555; +--nav-menu-active-bg: #DCE2EF; +--nav-menu-active-color: #9CAFD4; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.5); +--nav-arrow-color: #B6C4DF; +--nav-arrow-selected-color: #90A5CE; + +/* sync icon */ +--sync-icon-border-color: #C4CFE5; +--sync-icon-background-color: #F9FAFC; +--sync-icon-selected-background-color: #EEF1F7; +--sync-icon-color: #C4CFE5; +--sync-icon-selected-color: #6884BD; + +/* table of contents */ +--toc-background-color: #F4F6FA; +--toc-border-color: #D8DFEE; +--toc-header-color: #4665A2; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: white; +--search-foreground-color: #909090; +--search-active-color: black; +--search-filter-background-color: rgba(255,255,255,.7); +--search-filter-backdrop-filter: blur(4px); +--search-filter-foreground-color: black; +--search-filter-border-color: rgba(150,150,150,.4); +--search-filter-highlight-text-color: white; +--search-filter-highlight-bg-color: #3D578C; +--search-results-foreground-color: #425E97; +--search-results-background-color: rgba(255,255,255,.8); +--search-results-backdrop-filter: blur(4px); +--search-results-border-color: rgba(150,150,150,.4); +--search-box-border-color: #B6C4DF; +--search-close-icon-bg-color: #A0A0A0; +--search-close-icon-fg-color: white; + +/** code fragments */ +--code-keyword-color: #008000; +--code-type-keyword-color: #604020; +--code-flow-keyword-color: #E08000; +--code-comment-color: #800000; +--code-preprocessor-color: #806020; +--code-string-literal-color: #002080; +--code-char-literal-color: #008080; +--code-xml-cdata-color: black; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #4665A2; +--code-external-link-color: #4665A2; +--fragment-foreground-color: black; +--fragment-background-color: #FBFCFD; +--fragment-border-color: #C4CFE5; +--fragment-lineno-border-color: #00FF00; +--fragment-lineno-background-color: #E8E8E8; +--fragment-lineno-foreground-color: black; +--fragment-lineno-link-fg-color: #4665A2; +--fragment-lineno-link-bg-color: #D8D8D8; +--fragment-lineno-link-hover-fg-color: #4665A2; +--fragment-lineno-link-hover-bg-color: #C8C8C8; +--fragment-copy-ok-color: #2EC82E; +--tooltip-foreground-color: black; +--tooltip-background-color: rgba(255,255,255,0.8); +--tooltip-arrow-background-color: white; +--tooltip-border-color: rgba(150,150,150,0.7); +--tooltip-backdrop-filter: blur(3px); +--tooltip-doc-color: grey; +--tooltip-declaration-color: #006318; +--tooltip-link-color: #4665A2; +--tooltip-shadow: 0 4px 8px 0 rgba(0,0,0,.25); +--fold-line-color: #808080; + +/** font-family */ +--font-family-normal: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +/** special sections */ +--warning-color-bg: #f8d1cc; +--warning-color-hl: #b61825; +--warning-color-text: #75070f; +--note-color-bg: #faf3d8; +--note-color-hl: #f3a600; +--note-color-text: #5f4204; +--todo-color-bg: #e4f3ff; +--todo-color-hl: #1879C4; +--todo-color-text: #274a5c; +--test-color-bg: #e8e8ff; +--test-color-hl: #3939C4; +--test-color-text: #1a1a5c; +--deprecated-color-bg: #ecf0f3; +--deprecated-color-hl: #5b6269; +--deprecated-color-text: #43454a; +--bug-color-bg: #e4dafd; +--bug-color-hl: #5b2bdd; +--bug-color-text: #2a0d72; +--invariant-color-bg: #d8f1e3; +--invariant-color-hl: #44b86f; +--invariant-color-text: #265532; +} + +@media (prefers-color-scheme: dark) { + html:not(.dark-mode) { + color-scheme: dark; + +/* page base colors */ +--page-background-color: black; +--page-foreground-color: #C9D1D9; +--page-link-color: #90A5CE; +--page-visited-link-color: #90A5CE; +--page-external-link-color: #A3B4D7; + +/* index */ +--index-odd-item-bg-color: #0B101A; +--index-even-item-bg-color: black; +--index-header-color: #C4CFE5; +--index-separator-color: #334975; + +/* header */ +--header-background-color: #070B11; +--header-separator-color: #141C2E; +--group-header-separator-color: #1D2A43; +--group-header-color: #90A5CE; +--inherit-header-color: #A0A0A0; + +--footer-foreground-color: #5B7AB7; +--footer-logo-width: 60px; +--citation-label-color: #90A5CE; +--glow-color: cyan; + +--title-background-color: #090D16; +--title-separator-color: #212F4B; +--directory-separator-color: #283A5D; +--separator-color: #283A5D; + +--blockquote-background-color: #101826; +--blockquote-border-color: #283A5D; + +--scrollbar-thumb-color: #2C3F65; +--scrollbar-background-color: #070B11; + +--icon-background-color: #334975; +--icon-foreground-color: #C4CFE5; +--icon-folder-open-fill-color: #4665A2; +--icon-folder-fill-color: #5373B4; +--icon-folder-border-color: #C4CFE5; +--icon-doc-fill-color: #6884BD; +--icon-doc-border-color: #C4CFE5; + +/* brief member declaration list */ +--memdecl-background-color: #0B101A; +--memdecl-separator-color: #2C3F65; +--memdecl-foreground-color: #BBB; +--memdecl-template-color: #7C95C6; +--memdecl-border-color: #233250; + +/* detailed member list */ +--memdef-border-color: #233250; +--memdef-title-background-color: #1B2840; +--memdef-proto-background-color: #19243A; +--memdef-proto-text-color: #9DB0D4; +--memdef-doc-background-color: black; +--memdef-param-name-color: #D28757; +--memdef-template-color: #7C95C6; + +/* tables */ +--table-cell-border-color: #283A5D; +--table-header-background-color: #283A5D; +--table-header-foreground-color: #C4CFE5; + +/* labels */ +--label-background-color: #354C7B; +--label-left-top-border-color: #4665A2; +--label-right-bottom-border-color: #283A5D; +--label-foreground-color: #CCCCCC; + +/** navigation bar/tree/menu */ +--nav-background-color: #101826; +--nav-foreground-color: #364D7C; +--nav-border-color: #212F4B; +--nav-breadcrumb-separator-color: #212F4B; +--nav-breadcrumb-active-bg: #1D2A43; +--nav-breadcrumb-color: #90A5CE; +--nav-breadcrumb-border-color: #2A3D61; +--nav-splitbar-bg-color: #283A5D; +--nav-splitbar-handle-color: #4665A2; +--nav-font-size-level1: 13px; +--nav-font-size-level2: 10px; +--nav-font-size-level3: 9px; +--nav-text-normal-color: #B6C4DF; +--nav-text-hover-color: #DCE2EF; +--nav-text-active-color: #DCE2EF; +--nav-menu-button-color: #B6C4DF; +--nav-menu-background-color: #05070C; +--nav-menu-foreground-color: #BBBBBB; +--nav-menu-active-bg: #1D2A43; +--nav-menu-active-color: #C9D3E7; +--nav-menu-toggle-color: rgba(255, 255, 255, 0.2); +--nav-arrow-color: #4665A2; +--nav-arrow-selected-color: #6884BD; + +/* sync icon */ +--sync-icon-border-color: #212F4B; +--sync-icon-background-color: #101826; +--sync-icon-selected-background-color: #1D2A43; +--sync-icon-color: #4665A2; +--sync-icon-selected-color: #5373B4; + +/* table of contents */ +--toc-background-color: #151E30; +--toc-border-color: #202E4A; +--toc-header-color: #A3B4D7; +--toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); + +/** search field */ +--search-background-color: black; +--search-foreground-color: #C5C5C5; +--search-active-color: #F5F5F5; +--search-filter-background-color: #101826; +--search-filter-foreground-color: #90A5CE; +--search-filter-backdrop-filter: none; +--search-filter-border-color: #7C95C6; +--search-filter-highlight-text-color: #BCC9E2; +--search-filter-highlight-bg-color: #283A5D; +--search-results-background-color: black; +--search-results-foreground-color: #90A5CE; +--search-results-backdrop-filter: none; +--search-results-border-color: #334975; +--search-box-border-color: #334975; +--search-close-icon-bg-color: #909090; +--search-close-icon-fg-color: black; + +/** code fragments */ +--code-keyword-color: #CC99CD; +--code-type-keyword-color: #AB99CD; +--code-flow-keyword-color: #E08000; +--code-comment-color: #717790; +--code-preprocessor-color: #65CABE; +--code-string-literal-color: #7EC699; +--code-char-literal-color: #00E0F0; +--code-xml-cdata-color: #C9D1D9; +--code-vhdl-digit-color: #FF00FF; +--code-vhdl-char-color: #C0C0C0; +--code-vhdl-keyword-color: #CF53C9; +--code-vhdl-logic-color: #FF0000; +--code-link-color: #79C0FF; +--code-external-link-color: #79C0FF; +--fragment-foreground-color: #C9D1D9; +--fragment-background-color: #090D16; +--fragment-border-color: #30363D; +--fragment-lineno-border-color: #30363D; +--fragment-lineno-background-color: black; +--fragment-lineno-foreground-color: #6E7681; +--fragment-lineno-link-fg-color: #6E7681; +--fragment-lineno-link-bg-color: #303030; +--fragment-lineno-link-hover-fg-color: #8E96A1; +--fragment-lineno-link-hover-bg-color: #505050; +--fragment-copy-ok-color: #0EA80E; +--tooltip-foreground-color: #C9D1D9; +--tooltip-background-color: #202020; +--tooltip-arrow-background-color: #202020; +--tooltip-backdrop-filter: none; +--tooltip-border-color: #C9D1D9; +--tooltip-doc-color: #D9E1E9; +--tooltip-declaration-color: #20C348; +--tooltip-link-color: #79C0FF; +--tooltip-shadow: none; +--fold-line-color: #808080; + +/** font-family */ +--font-family-normal: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; +--font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +--font-family-title: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; +--font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; +--font-family-search: Arial,Verdana,sans-serif; +--font-family-icon: Arial,Helvetica; +--font-family-tooltip: Roboto,sans-serif; + +/** special sections */ +--warning-color-bg: #2e1917; +--warning-color-hl: #ad2617; +--warning-color-text: #f5b1aa; +--note-color-bg: #3b2e04; +--note-color-hl: #f1b602; +--note-color-text: #ceb670; +--todo-color-bg: #163750; +--todo-color-hl: #1982D2; +--todo-color-text: #dcf0fa; +--test-color-bg: #121258; +--test-color-hl: #4242cf; +--test-color-text: #c0c0da; +--deprecated-color-bg: #2e323b; +--deprecated-color-hl: #738396; +--deprecated-color-text: #abb0bd; +--bug-color-bg: #2a2536; +--bug-color-hl: #7661b3; +--bug-color-text: #ae9ed6; +--invariant-color-bg: #303a35; +--invariant-color-hl: #76ce96; +--invariant-color-text: #cceed5; +}} +body { + background-color: var(--page-background-color); + color: var(--page-foreground-color); +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: var(--font-family-normal); + line-height: 22px; +} + +body.resizing { + user-select: none; + -webkit-user-select: none; +} + +#doc-content { + scrollbar-width: thin; +} + +/* @group Heading Levels */ + +.title { + font-family: var(--font-family-normal); + line-height: 28px; + font-size: 160%; + font-weight: 400; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + box-shadow: 12px 0 var(--page-background-color), + -12px 0 var(--page-background-color), + 12px 1px var(--group-header-separator-color), + -12px 1px var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +td h2.groupheader { + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--glow-color); +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + margin-right: 6px; + padding-right: 6px; + text-align: right; + line-height: 110%; + background-color: var(--nav-background-color); +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + padding-right: 6px; + padding-left: 6px; + border-radius: 0 6px 6px 0; + background-color: var(--nav-menu-active-bg); +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: var(--index-separator-color); +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: var(--index-header-color); +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: var(--index-even-item-bg-color); +} + +.classindex dl.odd { + background-color: var(--index-odd-item-bg-color); +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: var(--page-link-color); + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: var(--page-visited-link-color); +} + +span.label a:hover { + text-decoration: none; + background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.el, a.el:visited, a.code, a.code:visited, a.line, a.line:visited { + color: var(--page-link-color); +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: var(--page-external-link-color); +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul.check { + list-style:none; + text-indent: -16px; + padding-left: 38px; +} +li.unchecked:before { + content: "\2610\A0"; +} +li.checked:before { + content: "\2611\A0"; +} + +ol { + text-indent: 0px; +} + +ul { + text-indent: 0px; + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; + overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid var(--fragment-border-color); + border-radius: 4px; + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); +} + +pre.fragment { + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: var(--font-family-monospace); +} + +span.tt { + white-space: pre; + font-family: var(--font-family-monospace); +} + +.clipboard { + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; + overflow: hidden; + justify-content: center; + align-items: center; + cursor: pointer; +} + +.clipboard.success { + border: 1px solid var(--fragment-foreground-color); + border-radius: 4px; +} + +.fragment:hover .clipboard, .clipboard.success { + opacity: .4; +} + +.clipboard:hover, .clipboard.success { + opacity: 1 !important; +} + +.clipboard:active:not([class~=success]) svg { + transform: scale(.91); +} + +.clipboard.success svg { + fill: var(--fragment-copy-ok-color); +} + +.clipboard.success { + border-color: var(--fragment-copy-ok-color); +} + +div.line { + font-family: var(--font-family-monospace); + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: wrap; + word-break: break-all; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -62px; + padding-left: 62px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: var(--glow-color); + box-shadow: 0 0 10px var(--glow-color); +} + +span.fold { + display: inline-block; + width: 12px; + height: 12px; + margin-left: 4px; + margin-right: 1px; +} + +span.foldnone { + display: inline-block; + position: relative; + cursor: pointer; + user-select: none; +} + +span.fold.plus, span.fold.minus { + width: 10px; + height: 10px; + background-color: var(--fragment-background-color); + position: relative; + border: 1px solid var(--fold-line-color); + margin-right: 1px; +} + +span.fold.plus::before, span.fold.minus::before { + content: ''; + position: absolute; + background-color: var(--fold-line-color); +} + +span.fold.plus::before { + width: 2px; + height: 6px; + top: 2px; + left: 4px; +} + +span.fold.plus::after { + content: ''; + position: absolute; + width: 6px; + height: 2px; + top: 4px; + left: 2px; + background-color: var(--fold-line-color); +} + +span.fold.minus::before { + width: 6px; + height: 2px; + top: 4px; + left: 2px; +} + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid var(--fragment-lineno-border-color); + color: var(--fragment-lineno-foreground-color); + background-color: var(--fragment-lineno-background-color); + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: var(--fragment-lineno-link-fg-color); + background-color: var(--fragment-lineno-link-bg-color); +} + +span.lineno a:hover { + color: var(--fragment-lineno-link-hover-fg-color); + background-color: var(--fragment-lineno-link-hover-bg-color); +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 110%; + font-weight: 500; + margin-left: 0px; + margin-top: 0em; + margin-bottom: 6px; + padding-top: 8px; + padding-bottom: 4px; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: var(--page-foreground-color); + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 12px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: var(--footer-logo-width); +} + +.compoundTemplParams { + color: var(--memdecl-template-color); + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: var(--code-keyword-color); +} + +span.keywordtype { + color: var(--code-type-keyword-color); +} + +span.keywordflow { + color: var(--code-flow-keyword-color); +} + +span.comment { + color: var(--code-comment-color); +} + +span.preprocessor { + color: var(--code-preprocessor-color); +} + +span.stringliteral { + color: var(--code-string-literal-color); +} + +span.charliteral { + color: var(--code-char-literal-color); +} + +span.xmlcdata { + color: var(--code-xml-cdata-color); +} + +span.vhdldigit { + color: var(--code-vhdl-digit-color); +} + +span.vhdlchar { + color: var(--code-vhdl-char-color); +} + +span.vhdlkeyword { + color: var(--code-vhdl-keyword-color); +} + +span.vhdllogic { + color: var(--code-vhdl-logic-color); +} + +blockquote { + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid var(--table-cell-border-color); +} + +th.dirtab { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-weight: bold; +} + +hr { + border: none; + margin-top: 16px; + margin-bottom: 16px; + height: 1px; + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); +} + +.memberdecls tr[class^='memitem'] { + font-family: var(--font-family-monospace); +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight { + padding-top: 2px; + padding-bottom: 2px; +} + +.memTemplParams { + padding-left: 10px; + padding-top: 5px; +} + +.memItemLeft, .memItemRight, .memTemplParams { + background-color: var(--memdecl-background-color); +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: var(--memdecl-foreground-color); +} + +tr[class^='memdesc'] { + box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,.075); +} + +.mdescLeft { + border-left: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); +} + +.mdescRight { + border-right: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); +} + +.memTemplParams { + color: var(--memdecl-template-color); + white-space: nowrap; + font-size: 80%; + border-left: 1px solid var(--memdecl-border-color); + border-right: 1px solid var(--memdecl-border-color); +} + +td.ititle { + border: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding-left: 10px; +} + +tr:not(:first-child) > td.ititle { + border-top: 0; + border-radius: 0; +} + +.memItemLeft { + white-space: nowrap; + border-left: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); + padding-left: 10px; + transition: none; +} + +.memItemRight { + width: 100%; + border-right: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); + padding-right: 10px; + transition: none; +} + +tr.heading + tr[class^='memitem'] td.memItemLeft, +tr.groupHeader + tr[class^='memitem'] td.memItemLeft, +tr.inherit_header + tr[class^='memitem'] td.memItemLeft { + border-top: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; +} + +tr.heading + tr[class^='memitem'] td.memItemRight, +tr.groupHeader + tr[class^='memitem'] td.memItemRight, +tr.inherit_header + tr[class^='memitem'] td.memItemRight { + border-top: 1px solid var(--memdecl-border-color); + border-top-right-radius: 4px; +} + +tr.heading + tr[class^='memitem'] td.memTemplParams, +tr.heading + tr td.ititle, +tr.groupHeader + tr[class^='memitem'] td.memTemplParams, +tr.groupHeader + tr td.ititle, +tr.inherit_header + tr[class^='memitem'] td.memTemplParams { + border-top: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +table.memberdecls tr:last-child td.memItemLeft, +table.memberdecls tr:last-child td.mdescLeft, +table.memberdecls tr[class^='memitem']:has(+ tr.groupHeader) td.memItemLeft, +table.memberdecls tr[class^='memitem']:has(+ tr.inherit_header) td.memItemLeft, +table.memberdecls tr[class^='memdesc']:has(+ tr.groupHeader) td.mdescLeft, +table.memberdecls tr[class^='memdesc']:has(+ tr.inherit_header) td.mdescLeft { + border-bottom-left-radius: 4px; +} + +table.memberdecls tr:last-child td.memItemRight, +table.memberdecls tr:last-child td.mdescRight, +table.memberdecls tr[class^='memitem']:has(+ tr.groupHeader) td.memItemRight, +table.memberdecls tr[class^='memitem']:has(+ tr.inherit_header) td.memItemRight, +table.memberdecls tr[class^='memdesc']:has(+ tr.groupHeader) td.mdescRight, +table.memberdecls tr[class^='memdesc']:has(+ tr.inherit_header) td.mdescRight { + border-bottom-right-radius: 4px; +} + +tr.template .memItemLeft, tr.template .memItemRight { + border-top: none; + padding-top: 0; +} + + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-color: var(--memdef-proto-background-color); + line-height: 1.25; + font-family: var(--font-family-monospace); + font-weight: 500; + font-size: 16px; + float:left; + box-shadow: 0 10px 0 -1px var(--memdef-proto-background-color), + 0 2px 8px 0 rgba(0,0,0,.075); + position: relative; +} + +.memtitle:after { + content: ''; + display: block; + background: var(--memdef-proto-background-color); + height: 10px; + bottom: -10px; + left: 0px; + right: -14px; + position: absolute; + border-top-right-radius: 6px; +} + +.permalink +{ + font-family: var(--font-family-monospace); + font-weight: 500; + line-height: 1.25; + font-size: 16px; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: var(--memdef-template-color); + font-family: var(--font-family-monospace); + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + display: table !important; + width: 100%; + box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); + border-radius: 4px; +} + +.memitem.glow { + box-shadow: 0 0 15px var(--glow-color); +} + +.memname { + font-family: var(--font-family-monospace); + font-size: 13px; + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + background-color: var(--memdef-proto-background-color); + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + +.overload { + font-family: var(--font-family-monospace); + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; +} + +.paramname { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; +} + +.paramname em { + color: var(--memdef-param-name-color); + font-style: normal; + margin-right: 1px; +} + +.paramname .paramdefval { + font-family: var(--font-family-monospace); +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: var(--font-family-monospace); + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); + text-shadow: none; + color: var(--label-foreground-color); + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: var(--index-odd-item-bg-color); +} + +.directory tr.even { + padding-left: 6px; + background-color: var(--index-even-item-bg-color); +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: var(--page-link-color); +} + +.arrow { + color: var(--nav-background-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 14px; + transition: opacity 0.3s ease; +} + +span.arrowhead { + position: relative; + padding: 0; + margin: 0 0 0 2px; + display: inline-block; + width: 5px; + height: 5px; + border-right: 2px solid var(--nav-arrow-color); + border-bottom: 2px solid var(--nav-arrow-color); + transform: rotate(-45deg); + transition: transform 0.3s ease; +} + +span.arrowhead.opened { + transform: rotate(45deg); +} + +.selected span.arrowhead { + border-right: 2px solid var(--nav-arrow-selected-color); + border-bottom: 2px solid var(--nav-arrow-selected-color); +} + +.icon { + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfolder { + width: 24px; + height: 18px; + margin-top: 6px; + vertical-align:top; + display: inline-block; + position: relative; +} + +.icondoc { + width: 24px; + height: 18px; + margin-top: 3px; + vertical-align:top; + display: inline-block; + position: relative; +} + +.folder-icon { + width: 16px; + height: 11px; + background-color: var(--icon-folder-fill-color); + border: 1px solid var(--icon-folder-border-color); + border-radius: 0 2px 2px 2px; + position: relative; + box-sizing: content-box; +} + +.folder-icon::after { + content: ''; + position: absolute; + top: 2px; + left: -1px; + width: 16px; + height: 7px; + background-color: var(--icon-folder-open-fill-color); + border: 1px solid var(--icon-folder-border-color); + border-radius: 7px 7px 2px 2px; + transform-origin: top left; + opacity: 0; + transition: all 0.3s linear; +} + +.folder-icon::before { + content: ''; + position: absolute; + top: -3px; + left: -1px; + width: 6px; + height: 2px; + background-color: var(--icon-folder-fill-color); + border-top: 1px solid var(--icon-folder-border-color); + border-left: 1px solid var(--icon-folder-border-color); + border-right: 1px solid var(--icon-folder-border-color); + border-radius: 2px 2px 0 0; +} + +.folder-icon.open::after { + top: 3px; + opacity: 1; +} + +.doc-icon { + left: 6px; + width: 12px; + height: 16px; + background-color: var(--icon-doc-border-color); + clip-path: polygon(0 0, 66% 0, 100% 25%, 100% 100%, 0 100%); + position: relative; + display: inline-block; +} +.doc-icon::before { + content: ""; + left: 1px; + top: 1px; + width: 10px; + height: 14px; + background-color: var(--icon-doc-fill-color); + clip-path: polygon(0 0, 66% 0, 100% 25%, 100% 100%, 0 100%); + position: absolute; + box-sizing: border-box; +} +.doc-icon::after { + content: ""; + left: 7px; + top: 0px; + width: 3px; + height: 3px; + background-color: transparent; + position: absolute; + border: 1px solid var(--icon-doc-border-color); +} + + + + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +span.dynarrow { + position: relative; + display: inline-block; + width: 12px; + bottom: 1px; +} + +address { + font-style: normal; + color: var(--footer-foreground-color); +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit { + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fieldinit { + padding-top: 3px; + text-align: right; +} + + +.fieldtable td.fielddoc { + border-bottom: 1px solid var(--memdef-border-color); +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + +/* ----------- navigation breadcrumb styling ----------- */ + +#nav-path ul { + height: 30px; + line-height: 30px; + color: var(--nav-text-normal-color); + overflow: hidden; + margin: 0px; + padding-left: 4px; + background-image: none; + background: var(--page-background-color); + border-bottom: 1px solid var(--nav-breadcrumb-separator-color); + font-size: var(--nav-font-size-level1); + font-family: var(--font-family-nav); + position: relative; + z-index: 100; +} + +#main-nav { + border-bottom: 1px solid var(--nav-border-color); +} + +.navpath li { + list-style-type:none; + float:left; + color: var(--nav-foreground-color); +} + +.navpath li.footer { + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + font-size: 8pt; + color: var(--footer-foreground-color); +} + +#nav-path li.navelem { + background-image: none; + display: flex; + align-items: center; + padding-left: 15px; +} + +.navpath li.navelem a { + text-shadow: none; + display: inline-block; + color: var(--nav-breadcrumb-color); + position: relative; + top: 0px; + height: 30px; + margin-right: -20px; +} + +#nav-path li.navelem:after { + content: ''; + display: inline-block; + position: relative; + top: 0; + right: -15px; + width: 30px; + height: 30px; + transform: scaleX(0.5) scale(0.707) rotate(45deg); + z-index: 10; + background: var(--page-background-color); + box-shadow: 2px -2px 0 2px var(--nav-breadcrumb-separator-color); + border-radius: 0 5px 0 50px; +} + +#nav-path li.navelem:first-child { + margin-left: -6px; +} + +#nav-path li.navelem:hover, +#nav-path li.navelem:hover:after { + background-color: var(--nav-breadcrumb-active-bg); +} + +/* ---------------------- */ + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + margin: 0px; + background-color: var(--header-background-color); + border-bottom: 1px solid var(--header-separator-color); +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl { + padding: 0 0 0 0; +} + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.important, dl.note, dl.deprecated, dl.bug, +dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention, dl.important { + background: var(--warning-color-bg); + border-left: 8px solid var(--warning-color-hl); + color: var(--warning-color-text); +} + +dl.warning dt, dl.attention dt, dl.important dt { + color: var(--warning-color-hl); +} + +dl.note, dl.remark { + background: var(--note-color-bg); + border-left: 8px solid var(--note-color-hl); + color: var(--note-color-text); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-hl); +} + +dl.todo { + background: var(--todo-color-bg); + border-left: 8px solid var(--todo-color-hl); + color: var(--todo-color-text); +} + +dl.todo dt { + color: var(--todo-color-hl); +} + +dl.test { + background: var(--test-color-bg); + border-left: 8px solid var(--test-color-hl); + color: var(--test-color-text); +} + +dl.test dt { + color: var(--test-color-hl); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.bug { + background: var(--bug-color-bg); + border-left: 8px solid var(--bug-color-hl); + color: var(--bug-color-text); +} + +dl.bug dt a { + color: var(--bug-color-hl) !important; +} + +dl.deprecated { + background: var(--deprecated-color-bg); + border-left: 8px solid var(--deprecated-color-hl); + color: var(--deprecated-color-text); +} + +dl.deprecated dt a { + color: var(--deprecated-color-hl) !important; +} + +dl.note dd, dl.warning dd, dl.pre dd, dl.post dd, +dl.remark dd, dl.attention dd, dl.important dd, dl.invariant dd, +dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color-bg); + border-left: 8px solid var(--invariant-color-hl); + color: var(--invariant-color-text); +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-hl); +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: var(--font-family-title); + margin: 0; + padding: 0; +} + +#side-nav #projectname +{ + font-size: 130%; +} + +#projectbrief +{ + font-size: 90%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: var(--font-family-title); + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0 0 0 5px; + margin: 0px; + border-bottom: 1px solid var(--title-separator-color); + background-color: var(--title-background-color); +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 var(--font-family-toc); + color: var(--toc-header-color); + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li[class^='level'] { + margin-left: 15px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.empty { + background-image: none; + margin-top: 0px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: 400; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0 2px 0; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 12px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + color: var(--tooltip-foreground-color); + background-color: var(--tooltip-background-color); + backdrop-filter: var(--tooltip-backdrop-filter); + -webkit-backdrop-filter: var(--tooltip-backdrop-filter); + border: 1px solid var(--tooltip-border-color); + border-radius: 4px; + box-shadow: var(--tooltip-shadow); + display: none; + font-size: smaller; + max-width: 80%; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: var(--tooltip-doc-color); + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: var(--tooltip-link-color); +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: var(--tooltip-declaration-color); +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: var(--tooltip-arrow-background-color); + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: var(--tooltip-arrow-background-color); + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: var(--tooltip-border-color); + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: var(--tooltip-border-color); + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: var(--tooltip-border-color); + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid var(--table-cell-border-color); + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: var(--table-header-background-color); + color: var(--table-header-foreground-color); + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd +{ + display: inline-block; +} +tt, code, kbd +{ + vertical-align: top; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +:root { + scrollbar-width: thin; + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/docs/doxygen.svg b/docs/doxygen.svg new file mode 100644 index 0000000..79a7635 --- /dev/null +++ b/docs/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/doxygen_crawl.html b/docs/doxygen_crawl.html new file mode 100644 index 0000000..5d8a3b0 --- /dev/null +++ b/docs/doxygen_crawl.html @@ -0,0 +1,304 @@ + + + +Validator / crawler helper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/dynsections.js b/docs/dynsections.js new file mode 100644 index 0000000..d89724e --- /dev/null +++ b/docs/dynsections.js @@ -0,0 +1,198 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function toggleVisibility(linkObj) { + return dynsection.toggleVisibility(linkObj); +} + +let dynsection = { + // helper function + updateStripes : function() { + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); + }, + + toggleVisibility : function(linkObj) { + const base = $(linkObj).attr('id'); + const summary = $('#'+base+'-summary'); + const content = $('#'+base+'-content'); + const trigger = $('#'+base+'-trigger'); + const src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.slideUp('fast'); + summary.show(); + $(linkObj).find('.arrowhead').addClass('closed').removeClass('opened'); + } else { + content.slideDown('fast'); + summary.hide(); + $(linkObj).find('.arrowhead').removeClass('closed').addClass('opened'); + } + return false; + }, + + toggleLevel : function(level) { + $('table.directory tr').each(function() { + const l = this.id.split('_').length-1; + const i = $('#img'+this.id.substring(3)); + const a = $('#arr'+this.id.substring(3)); + if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').addClass('plus').removeClass('minus'); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; +/* @license-end */ +$(function() { + $('.code,.codeRef').each(function() { + $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); + $.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ]; + $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); + }); +}); diff --git a/docs/files.html b/docs/files.html new file mode 100644 index 0000000..0e08b18 --- /dev/null +++ b/docs/files.html @@ -0,0 +1,124 @@ + + + + + + + +Flow: File List + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
File List
+
+ +
+
+ + + + diff --git a/docs/files_dup.js b/docs/files_dup.js new file mode 100644 index 0000000..b4165a4 --- /dev/null +++ b/docs/files_dup.js @@ -0,0 +1,18 @@ +var files_dup = +[ + [ "flow_arena_memory_resource.h", "flow__arena__memory__resource_8h.html", "flow__arena__memory__resource_8h" ], + [ "flow_concurrent_flex_queue.h", "flow__concurrent__flex__queue_8h.html", "flow__concurrent__flex__queue_8h" ], + [ "flow_concurrent_queue.h", "flow__concurrent__queue_8h.html", "flow__concurrent__queue_8h" ], + [ "flow_counted_value_view_iterator.h", "flow__counted__value__view__iterator_8h.html", "flow__counted__value__view__iterator_8h" ], + [ "flow_debug_memory.h", "flow__debug__memory_8h.html", "flow__debug__memory_8h" ], + [ "flow_default_memory_resource.h", "flow__default__memory__resource_8h.html", "flow__default__memory__resource_8h" ], + [ "flow_memory_algorithm.h", "flow__memory__algorithm_8h.html", "flow__memory__algorithm_8h" ], + [ "flow_memory_resource.h", "flow__memory__resource_8h.html", "flow__memory__resource_8h" ], + [ "flow_polymorphic_allocator.h", "flow__polymorphic__allocator_8h.html", "flow__polymorphic__allocator_8h" ], + [ "flow_pool_memory_resource.h", "flow__pool__memory__resource_8h.html", "flow__pool__memory__resource_8h" ], + [ "flow_random_algorithm.h", "flow__random__algorithm_8h.html", "flow__random__algorithm_8h" ], + [ "flow_stack_memory_resource.h", "flow__stack__memory__resource_8h.html", "flow__stack__memory__resource_8h" ], + [ "flow_timer.h", "flow__timer_8h.html", "flow__timer_8h" ], + [ "flow_tuple.h", "flow__tuple_8h.html", "flow__tuple_8h" ], + [ "flow_vector.h", "flow__vector_8h.html", "flow__vector_8h" ] +]; \ No newline at end of file diff --git a/docs/flow__arena__memory__resource_8h.html b/docs/flow__arena__memory__resource_8h.html new file mode 100644 index 0000000..e701f1f --- /dev/null +++ b/docs/flow__arena__memory__resource_8h.html @@ -0,0 +1,130 @@ + + + + + + + +Flow: flow_arena_memory_resource.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_arena_memory_resource.h File Reference
+
+
+
#include "flow_memory_resource.h"
+#include <cassert>
+#include <cstddef>
+#include <exception>
+#include <memory>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::ArenaMemoryResource
 A linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__arena__memory__resource_8h.js b/docs/flow__arena__memory__resource_8h.js new file mode 100644 index 0000000..a93a309 --- /dev/null +++ b/docs/flow__arena__memory__resource_8h.js @@ -0,0 +1,4 @@ +var flow__arena__memory__resource_8h = +[ + [ "flow::ArenaMemoryResource", "classflow_1_1_arena_memory_resource.html", "classflow_1_1_arena_memory_resource" ] +]; \ No newline at end of file diff --git a/docs/flow__arena__memory__resource_8h_source.html b/docs/flow__arena__memory__resource_8h_source.html new file mode 100644 index 0000000..d0b9ca6 --- /dev/null +++ b/docs/flow__arena__memory__resource_8h_source.html @@ -0,0 +1,168 @@ + + + + + + + +Flow: flow_arena_memory_resource.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_arena_memory_resource.h
+
+
+Go to the documentation of this file.
1#pragma once
+ +
3#include <cassert>
+
4#include <cstddef>
+
5#include <exception>
+
6#include <memory>
+
7
+
+
8namespace flow {
+
9
+
+ +
15 public:
+
+
16 explicit ArenaMemoryResource(void* buffer, std::size_t capacity) noexcept
+
17 : buffer_(buffer), capacity_(capacity) {
+
18#ifdef _DEBUG
+
19 beginBuffer_ = buffer;
+
20#endif
+
21 }
+
+
22
+
23 protected:
+
24#ifdef _DEBUG
+
25 void* beginBuffer_;
+
26#endif
+
27 void* buffer_;
+
28 std::size_t capacity_;
+
29
+
+
30 virtual void* allocateImp(std::size_t bytes, std::size_t alignment) override {
+
31 void* aligned = std::align(alignment, bytes, buffer_, capacity_);
+
32 if (!aligned || capacity_ < bytes) {
+
33 throw std::bad_alloc();
+
34 }
+
35
+
36 buffer_ = static_cast<std::byte*>(aligned) + bytes;
+
37 capacity_ -= bytes;
+
38 return aligned;
+
39 }
+
+
40
+
+
41 virtual void deallocateImp(
+
42 [[maybe_unused]] void* address,
+
43 [[maybe_unused]] std::size_t bytes,
+
44 [[maybe_unused]] std::size_t alignment) override {
+
45 assert(address == nullptr || (beginBuffer_ <= address && address <= buffer_));
+
46 }
+
+
47 };
+
+
48}
+
+ +
virtual void * allocateImp(std::size_t bytes, std::size_t alignment) override
+
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment) override
+ +
ArenaMemoryResource(void *buffer, std::size_t capacity) noexcept
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+ + +
+
+
+ + + + diff --git a/docs/flow__concurrent__flex__queue_8h.html b/docs/flow__concurrent__flex__queue_8h.html new file mode 100644 index 0000000..4cafb74 --- /dev/null +++ b/docs/flow__concurrent__flex__queue_8h.html @@ -0,0 +1,128 @@ + + + + + + + +Flow: flow_concurrent_flex_queue.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_concurrent_flex_queue.h File Reference
+
+
+
#include <memory>
+#include <mutex>
+#include <optional>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::ConcurrentFlexQueue< T >
struct  flow::ConcurrentFlexQueue< T >::Node
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__concurrent__flex__queue_8h.js b/docs/flow__concurrent__flex__queue_8h.js new file mode 100644 index 0000000..56e530f --- /dev/null +++ b/docs/flow__concurrent__flex__queue_8h.js @@ -0,0 +1,5 @@ +var flow__concurrent__flex__queue_8h = +[ + [ "flow::ConcurrentFlexQueue< T >", "classflow_1_1_concurrent_flex_queue.html", "classflow_1_1_concurrent_flex_queue" ], + [ "flow::ConcurrentFlexQueue< T >::Node", "structflow_1_1_concurrent_flex_queue_1_1_node.html", "structflow_1_1_concurrent_flex_queue_1_1_node" ] +]; \ No newline at end of file diff --git a/docs/flow__concurrent__flex__queue_8h_source.html b/docs/flow__concurrent__flex__queue_8h_source.html new file mode 100644 index 0000000..ebc4d58 --- /dev/null +++ b/docs/flow__concurrent__flex__queue_8h_source.html @@ -0,0 +1,235 @@ + + + + + + + +Flow: flow_concurrent_flex_queue.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_concurrent_flex_queue.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <memory>
+
3#include <mutex>
+
4#include <optional>
+
5
+
6namespace flow {
+
7
+
8 template <typename T>
+
+ +
10
+
+
11 struct Node {
+
12 std::optional<T> value;
+
13 std::unique_ptr<Node> next;
+
14 };
+
+
15
+
16 std::unique_ptr<Node> head_;
+ +
18 mutable std::mutex headMux_{};
+
19 mutable std::mutex tailMux_{};
+
20 std::condition_variable blocked_{};
+
21
+
22 public:
+
+ +
24 : head_(std::make_unique<Node>()), tail_(head_.get()) {
+
25 }
+
+
26
+ + + + +
31
+
+
35 bool empty() const {
+
36 std::scoped_lock lock(headMux_, tailMux_);
+
37 return head_.get() == tail_;
+
38 }
+
+
39
+
45 template <typename U>
+
+
46 void push(U&& value) {
+
47 std::unique_ptr<Node> dummy = std::make_unique<Node>();
+
48 {
+
49 std::lock_guard lock(tailMux_);
+
50 tail_->value = std::forward<U>(value);
+
51 tail_->next = std::move(dummy);
+
52 tail_ = tail_->next.get();
+
53 }
+
54 blocked_.notify_one();
+
55 }
+
+
56
+
62 template <typename ...Args>
+
+
63 void emplace(Args&&... args) {
+
64 std::unique_ptr<Node> dummy = std::make_unique<Node>();
+
65 {
+
66 std::lock_guard lock(tailMux_);
+
67 tail_->value = T{ std::forward<Args>(args)... };
+
68 tail_->next = std::move(dummy);
+
69 tail_ = tail_->next.get();
+
70 }
+
71 blocked_.notify_one();
+
72 }
+
+
73
+
+
79 std::optional<T> tryFront() const {
+
80 std::unique_lock lock(headMux_);
+
81 if (head_.get() == tail_) {
+
82 return std::nullopt;
+
83 }
+
84 return head_->value;
+
85 }
+
+
86
+
+
92 std::optional<T> tryPop() {
+
93 std::unique_lock lock(headMux_);
+
94 if (head_.get() == tail_) {
+
95 return std::nullopt;
+
96 }
+
97
+
98 auto oldHead = std::move(head_);
+
99 head_ = std::move(oldHead->next);
+
100 return std::move(oldHead->value);
+
101 }
+
+
102
+
+ +
109 std::unique_lock lock(headMux_);
+
110 blocked_.wait(lock, [&]() {
+
111 return head_.get() != tail_;
+
112 });
+
113
+
114 auto oldHead = std::move(head_);
+
115 head_ = std::move(oldHead->next);
+
116 return oldHead->value.value();
+
117 }
+
+
118 };
+
+
119}
+
ConcurrentFlexQueue(const ConcurrentFlexQueue &)=delete
+ +
void emplace(Args &&... args)
Construct a new element in the concurrent flex queue inplace.
+ + +
ConcurrentFlexQueue(ConcurrentFlexQueue &&)=delete
+ +
std::optional< T > tryPop()
Try pop and return the first element in the concurrent flex queue. If the concurrent flex queue is em...
+
void push(U &&value)
Push a new element to the concurrent flex queue.
+
T waitPop()
Wait until the concurrent flex queue has at least one element, then pop and return the first element ...
+ +
ConcurrentFlexQueue & operator=(const ConcurrentFlexQueue &)=delete
+
std::optional< T > tryFront() const
Try return the first element in the concurrent flex queue. If the concurrent flex queue is empty,...
+
ConcurrentFlexQueue & operator=(ConcurrentFlexQueue &&)=delete
+ + + + + + +
+
+
+ + + + diff --git a/docs/flow__concurrent__queue_8h.html b/docs/flow__concurrent__queue_8h.html new file mode 100644 index 0000000..d127af3 --- /dev/null +++ b/docs/flow__concurrent__queue_8h.html @@ -0,0 +1,128 @@ + + + + + + + +Flow: flow_concurrent_queue.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_concurrent_queue.h File Reference
+
+
+
#include <deque>
+#include <mutex>
+#include <optional>
+#include <queue>
+
+

Go to the source code of this file.

+ + + +

+Classes

class  flow::ConcurrentQueue< T, Container >
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__concurrent__queue_8h.js b/docs/flow__concurrent__queue_8h.js new file mode 100644 index 0000000..79e7020 --- /dev/null +++ b/docs/flow__concurrent__queue_8h.js @@ -0,0 +1,4 @@ +var flow__concurrent__queue_8h = +[ + [ "flow::ConcurrentQueue< T, Container >", "classflow_1_1_concurrent_queue.html", "classflow_1_1_concurrent_queue" ] +]; \ No newline at end of file diff --git a/docs/flow__concurrent__queue_8h_source.html b/docs/flow__concurrent__queue_8h_source.html new file mode 100644 index 0000000..0974185 --- /dev/null +++ b/docs/flow__concurrent__queue_8h_source.html @@ -0,0 +1,225 @@ + + + + + + + +Flow: flow_concurrent_queue.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_concurrent_queue.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <deque>
+
3#include <mutex>
+
4#include <optional>
+
5#include <queue>
+
6
+
7namespace flow {
+
8 template <typename T, typename Container = std::deque<T>>
+
+ +
10 using allocator_type = Container::allocator_type;
+
11
+
12 std::queue<T, Container> queue_;
+
13 mutable std::mutex mux_{};
+
14 std::condition_variable blocked_{};
+
15
+
16 public:
+
+
21 explicit ConcurrentQueue(const allocator_type& allocator = allocator_type())
+
22 : queue_(allocator) {
+
23 }
+
+
24
+ + + + +
29
+
+
33 bool empty() const {
+
34 std::lock_guard lock(mux_);
+
35 return queue_.empty();
+
36 }
+
+
37
+
+
41 std::size_t size() const {
+
42 std::lock_guard lock(mux_);
+
43 return queue_.size();
+
44 }
+
+
45
+
51 template <typename U>
+
+
52 void push(U&& value) {
+
53 {
+
54 std::lock_guard lock(mux_);
+
55 queue_.push(std::forward<U>(value));
+
56 }
+
57 blocked_.notify_one();
+
58 }
+
+
59
+
65 template <typename ...Args>
+
+
66 void emplace(Args&&... args) {
+
67 {
+
68 std::lock_guard lock(mux_);
+
69 queue_.emplace(std::forward<Args>(args)...);
+
70 }
+
71 blocked_.notify_one();
+
72 }
+
+
73
+
+
79 std::optional<T> tryFront() const {
+
80 std::lock_guard lock(mux_);
+
81 if (queue_.empty()) {
+
82 return std::nullopt;
+
83 }
+
84 return queue_.front();
+
85 }
+
+
86
+
+
92 std::optional<T> tryPop() {
+
93 std::lock_guard lock(mux_);
+
94 if (queue_.empty()) {
+
95 return std::nullopt;
+
96 }
+
97
+
98 std::optional<T> value{ std::move(queue_.front()) };
+
99 queue_.pop();
+
100 return value;
+
101 }
+
+
102
+
+ +
109 std::unique_lock lock(mux_);
+
110 blocked_.wait(lock, [&]() {
+
111 return !queue_.empty();
+
112 });
+
113
+
114 T value = std::move(queue_.front());
+
115 queue_.pop();
+
116 return value;
+
117 }
+
+
118 };
+
+
119}
+
T waitPop()
Wait until the concurrent queue has at least one element, then pop and return the first element in th...
+
std::optional< T > tryFront() const
Try return the first element in the concurrent queue. If the concurrent queue is empty,...
+
ConcurrentQueue(const allocator_type &allocator=allocator_type())
Construct a concurrent queue. The elements follow the FIFO order.
+ +
ConcurrentQueue & operator=(const ConcurrentQueue &)=delete
+
std::optional< T > tryPop()
Try pop and return the first element in the concurrent queue. If the concurrent queue is empty,...
+
void push(U &&value)
Push a new element to the concurrent queue.
+
void emplace(Args &&... args)
Construct a new element in the concurrent queue inplace.
+
ConcurrentQueue(ConcurrentQueue &&)=delete
+
ConcurrentQueue & operator=(ConcurrentQueue &&)=delete
+
ConcurrentQueue(const ConcurrentQueue &)=delete
+
std::queue< T, Container > queue_
+ +
std::condition_variable blocked_
+ +
Container::allocator_type allocator_type
+ +
+
+
+ + + + diff --git a/docs/flow__counted__value__view__iterator_8h.html b/docs/flow__counted__value__view__iterator_8h.html new file mode 100644 index 0000000..a545572 --- /dev/null +++ b/docs/flow__counted__value__view__iterator_8h.html @@ -0,0 +1,128 @@ + + + + + + + +Flow: flow_counted_value_view_iterator.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_counted_value_view_iterator.h File Reference
+
+
+
#include <cassert>
+#include <cstddef>
+#include <iterator>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::CountedValueViewIterator< T >
 Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__counted__value__view__iterator_8h.js b/docs/flow__counted__value__view__iterator_8h.js new file mode 100644 index 0000000..e23cfdc --- /dev/null +++ b/docs/flow__counted__value__view__iterator_8h.js @@ -0,0 +1,4 @@ +var flow__counted__value__view__iterator_8h = +[ + [ "flow::CountedValueViewIterator< T >", "classflow_1_1_counted_value_view_iterator.html", "classflow_1_1_counted_value_view_iterator" ] +]; \ No newline at end of file diff --git a/docs/flow__counted__value__view__iterator_8h_source.html b/docs/flow__counted__value__view__iterator_8h_source.html new file mode 100644 index 0000000..b571d1a --- /dev/null +++ b/docs/flow__counted__value__view__iterator_8h_source.html @@ -0,0 +1,198 @@ + + + + + + + +Flow: flow_counted_value_view_iterator.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_counted_value_view_iterator.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <cassert>
+
3#include <cstddef>
+
4#include <iterator>
+
5
+
6namespace flow {
+
7
+
12 template <typename T>
+
+ +
14 const T* value_;
+
15 std::size_t count_;
+
16
+
17 public:
+
18 using value_type = T;
+
19 using reference = const T&;
+
20 using pointer = const T*;
+
21 using difference_type = std::ptrdiff_t;
+
22 using iterator_category = std::forward_iterator_tag;
+
23
+
+ +
25 value_(nullptr), count_(0) {
+
26 }
+
+
27
+
+
28 CountedValueViewIterator(const T& value, std::size_t count = 0) :
+
29 value_(&value), count_(count) {
+
30 }
+
+
31
+
+
32 const T& operator*() const {
+
33 assert(value_ && "no value");
+
34 return *value_;
+
35 }
+
+
36
+
+
37 const T* operator->() const {
+
38 assert(value_ && "no value");
+
39 return value_;
+
40 }
+
+
41
+
+ +
43 assert(count_ > 0 && "negative count");
+
44 --count_;
+
45 return *this;
+
46 }
+
+
47
+
+ +
49 CountedValueViewIterator cpy = *this;
+
50 --count_;
+
51 return cpy;
+
52 }
+
+
53
+
+
54 friend bool operator==(const CountedValueViewIterator& lhs, const CountedValueViewIterator& rhs) {
+
55 return lhs.count_ == rhs.count_ && lhs.value_ == rhs.value_;
+
56 }
+
+
57
+
+
58 friend bool operator!=(const CountedValueViewIterator& lhs, const CountedValueViewIterator& rhs) {
+
59 return !(lhs == rhs);
+
60 }
+
+
61 };
+
+
62}
+ + + + + + +
friend bool operator!=(const CountedValueViewIterator &lhs, const CountedValueViewIterator &rhs)
+ +
friend bool operator==(const CountedValueViewIterator &lhs, const CountedValueViewIterator &rhs)
+ +
CountedValueViewIterator(const T &value, std::size_t count=0)
+ + + + + +
+
+
+ + + + diff --git a/docs/flow__debug__memory_8h.html b/docs/flow__debug__memory_8h.html new file mode 100644 index 0000000..9efce3c --- /dev/null +++ b/docs/flow__debug__memory_8h.html @@ -0,0 +1,132 @@ + + + + + + + +Flow: flow_debug_memory.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_debug_memory.h File Reference
+
+
+
#include <format>
+#include <iostream>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::DebugClass
 Debug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on. More...
+ + +

+Namespaces

namespace  flow
+ + + +

+Functions

void flow::enableMemoryGuard ()
 Enable MSVC native memory leak checker in debug mode. Not compatible with the address sanitizer.
+
+
+ +
+ + + + diff --git a/docs/flow__debug__memory_8h.js b/docs/flow__debug__memory_8h.js new file mode 100644 index 0000000..34b0746 --- /dev/null +++ b/docs/flow__debug__memory_8h.js @@ -0,0 +1,5 @@ +var flow__debug__memory_8h = +[ + [ "flow::DebugClass", "classflow_1_1_debug_class.html", "classflow_1_1_debug_class" ], + [ "flow::enableMemoryGuard", "namespaceflow.html#a66db7e81436bb94ac54e68f4f13be960", null ] +]; \ No newline at end of file diff --git a/docs/flow__debug__memory_8h_source.html b/docs/flow__debug__memory_8h_source.html new file mode 100644 index 0000000..26ff373 --- /dev/null +++ b/docs/flow__debug__memory_8h_source.html @@ -0,0 +1,210 @@ + + + + + + + +Flow: flow_debug_memory.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_debug_memory.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <format>
+
3#include <iostream>
+
4
+
5// MSVC built-in debug flag
+
6#if defined _DEBUG && (defined _WIN32 || defined _WIN64)
+
7#include <stdlib.h>
+
8#include <crtdbg.h>
+
9#define _CRTDBG_MAP_ALLOC
+
10#endif
+
11
+
12namespace flow {
+
+
17 inline void enableMemoryGuard() {
+
18 #ifdef _CRTDBG_MAP_ALLOC
+
19 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+
20 #endif
+
21 }
+
+
22
+
+
27 class DebugClass {
+
28 std::shared_ptr<std::size_t> copyCounter_;
+
29 std::size_t copies_;
+
30 std::size_t id_;
+
31
+
32 public:
+
+ +
34 : copyCounter_(std::make_shared<std::size_t>(0)),
+
35 copies_(0),
+
36 id_(globalId++) {
+
37 std::cout << std::format("default_ctor id {}, copies {}\n", id_, copies_);
+
38 }
+
+
39
+
+ + + +
43 id_(rhs.id_) {
+
44
+
45 std::cout << std::format("copy_ctor id {}, copies {}\n", id_, copies_);
+
46 }
+
+
47
+
+
48 DebugClass(DebugClass&& rhs) noexcept
+
49 : copyCounter_(std::move(rhs.copyCounter_)),
+
50 copies_(rhs.copies_),
+
51 id_(rhs.id_) {
+
52 std::cout << std::format("move_ctor id {}, copies {}\n", id_, copies_);
+
53 }
+
+
54
+
+ +
56 std::cout << std::format("dtor id {}, copies {}\n", id_, copies_);
+
57 }
+
+
58
+
+ + +
61 copies_ = ++(*copyCounter_);
+
62 id_ = rhs.id_;
+
63 std::cout << std::format("copy_op id {}, copies {}\n", id_, copies_);
+
64 }
+
+
65
+
+
66 DebugClass& operator=(DebugClass&& rhs) noexcept {
+
67 copyCounter_ = std::move(rhs.copyCounter_);
+
68 copies_ = rhs.copies_;
+
69 id_ = rhs.id_;
+
70 std::cout << std::format("move_op id {}, copies {}\n", id_, copies_);
+
71 }
+
+
72
+
73 private:
+
74 static inline std::size_t globalId = 0;
+
75
+
+
76 friend std::ostream& operator<<(std::ostream& out, const DebugClass& obj) {
+
77 out << std::format("{{id: {}, copies: {}}}", obj.id_, obj.copies_);
+
78 return out;
+
79 }
+
+
80 };
+
+
81}
+
DebugClass & operator=(DebugClass &&rhs) noexcept
+
DebugClass(const DebugClass &rhs)
+
DebugClass & operator=(const DebugClass &rhs)
+ + + +
static std::size_t globalId
+ +
DebugClass(DebugClass &&rhs) noexcept
+
friend std::ostream & operator<<(std::ostream &out, const DebugClass &obj)
+
std::shared_ptr< std::size_t > copyCounter_
+ +
void enableMemoryGuard()
Enable MSVC native memory leak checker in debug mode. Not compatible with the address sanitizer.
+
+
+
+ + + + diff --git a/docs/flow__default__memory__resource_8h.html b/docs/flow__default__memory__resource_8h.html new file mode 100644 index 0000000..48a3bc5 --- /dev/null +++ b/docs/flow__default__memory__resource_8h.html @@ -0,0 +1,126 @@ + + + + + + + +Flow: flow_default_memory_resource.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_default_memory_resource.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  flow::DefaultMemoryResource
 A default memory resource that wraps global ::operator new and ::operator delete. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__default__memory__resource_8h.js b/docs/flow__default__memory__resource_8h.js new file mode 100644 index 0000000..fbe0475 --- /dev/null +++ b/docs/flow__default__memory__resource_8h.js @@ -0,0 +1,4 @@ +var flow__default__memory__resource_8h = +[ + [ "flow::DefaultMemoryResource", "classflow_1_1_default_memory_resource.html", "classflow_1_1_default_memory_resource" ] +]; \ No newline at end of file diff --git a/docs/flow__default__memory__resource_8h_source.html b/docs/flow__default__memory__resource_8h_source.html new file mode 100644 index 0000000..1e3c155 --- /dev/null +++ b/docs/flow__default__memory__resource_8h_source.html @@ -0,0 +1,143 @@ + + + + + + + +Flow: flow_default_memory_resource.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_default_memory_resource.h
+
+
+Go to the documentation of this file.
1#pragma once
+ +
3
+
4namespace flow {
+
5
+
+ +
10 public:
+
+ +
12 static DefaultMemoryResource instance{};
+
13 return instance;
+
14 }
+
+
15
+
16 private:
+
+
17 virtual void* allocateImp(std::size_t bytes, std::size_t alignment) {
+
18 return ::operator new(bytes, static_cast<std::align_val_t>(alignment));
+
19 }
+
+
20
+
+
21 virtual void deallocateImp(void* address, [[maybe_unused]] std::size_t bytes, std::size_t alignment) {
+
22 ::operator delete(address, static_cast<std::align_val_t>(alignment));
+
23 }
+
+
24 };
+
+
25}
+
A default memory resource that wraps global operator new and operator delete.
+
static DefaultMemoryResource & getResource()
+
virtual void * allocateImp(std::size_t bytes, std::size_t alignment)
+
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment)
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+ + +
+
+
+ + + + diff --git a/docs/flow__memory__algorithm_8h.html b/docs/flow__memory__algorithm_8h.html new file mode 100644 index 0000000..4a9ed74 --- /dev/null +++ b/docs/flow__memory__algorithm_8h.html @@ -0,0 +1,165 @@ + + + + + + + +Flow: flow_memory_algorithm.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_memory_algorithm.h File Reference
+
+
+
#include <cassert>
+#include <iterator>
+#include <memory>
+
+

Go to the source code of this file.

+ + + +

+Namespaces

namespace  flow
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedForward (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
 Forward elements from a source range to uninitialized memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedMove (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
 Moves elements from a source range to uninitialized memory.
template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
OutputIt flow::uninitializedEmplace (AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
 Constructs objects in uninitialized memory by copying arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.
template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
OutputIt flow::uninitializedFill (AllocatorType &allocator, OutputIt first, OutputIt last, const T &value)
 Fills uninitialized memory with copies of a value.
template<typename AllocatorType, std::forward_iterator InputIt>
void flow::destroyElements (AllocatorType &allocator, InputIt first, InputIt last) noexcept
 Destroys a range of constructed objects in memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedForwardN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
 Forward count elements from a source range to uninitialized memory.
template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
OutputIt flow::uninitializedMoveN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest) noexcept
 Moves count elements from a source range to uninitialized memory.
template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
OutputIt flow::uninitializedEmplaceN (AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
 Constructs a specified number of objects in uninitialized memory by forwarding arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.
template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
OutputIt flow::uninitializedFillN (AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
 Fills count elements in uninitialized memory with a value.
template<typename AllocatorType, std::forward_iterator InputIt>
void flow::destroyElementsN (AllocatorType &allocator, InputIt first, std::size_t count) noexcept
 Destroys count objects in a range.
template<typename AllocatorType, typename T>
void flow::deleteBuffer (AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
 Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is the buffer capacity.
template<typename T, typename U>
std::size_t flow::pointerDistance (const T *first, const U *last)
 Calculate the distance from the first pointer to the last pointer in bytes.
template<typename Header>
Header * flow::alignWithHeader (std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
 Align the header + buffer to their corresponding alignments. If the capacity is not big enough to accommodate, then return nullptr. This function is similar to std::align, but it also aligns a header in the front.
+
+
+ +
+ + + + diff --git a/docs/flow__memory__algorithm_8h.js b/docs/flow__memory__algorithm_8h.js new file mode 100644 index 0000000..00a36aa --- /dev/null +++ b/docs/flow__memory__algorithm_8h.js @@ -0,0 +1,16 @@ +var flow__memory__algorithm_8h = +[ + [ "flow::alignWithHeader", "namespaceflow.html#ad508020eec40eabb44ecd17a0ea944a1", null ], + [ "flow::deleteBuffer", "namespaceflow.html#a95a53e967634035ab7b02a7a0fd8d41a", null ], + [ "flow::destroyElements", "namespaceflow.html#a0917ae92fc9372994be63e2b07d7da43", null ], + [ "flow::destroyElementsN", "namespaceflow.html#a2097cda5f5388d27f3c92804fdea2917", null ], + [ "flow::pointerDistance", "namespaceflow.html#a4cdb6701097d19bfe56dc9b98d0ab18d", null ], + [ "flow::uninitializedEmplace", "namespaceflow.html#a003a0f5de60743211f4a12ad692ea545", null ], + [ "flow::uninitializedEmplaceN", "namespaceflow.html#ae91210e00bd937af8781ad61d96bb7af", null ], + [ "flow::uninitializedFill", "namespaceflow.html#ac44af902cb4c10b49fa9f5992daa6c92", null ], + [ "flow::uninitializedFillN", "namespaceflow.html#a5991193d2c2c3220704b7ffe43284798", null ], + [ "flow::uninitializedForward", "namespaceflow.html#a7cbf79d9d81ea0bf923173bf94d18282", null ], + [ "flow::uninitializedForwardN", "namespaceflow.html#a5f5545b19674be10035741dc55ab7805", null ], + [ "flow::uninitializedMove", "namespaceflow.html#a51e3de912b53f5b8d08f6167efae5d43", null ], + [ "flow::uninitializedMoveN", "namespaceflow.html#a1110956ca4c95ee5c42c1e988dab6ecd", null ] +]; \ No newline at end of file diff --git a/docs/flow__memory__algorithm_8h_source.html b/docs/flow__memory__algorithm_8h_source.html new file mode 100644 index 0000000..ff8e463 --- /dev/null +++ b/docs/flow__memory__algorithm_8h_source.html @@ -0,0 +1,260 @@ + + + + + + + +Flow: flow_memory_algorithm.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_memory_algorithm.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <cassert>
+
3#include <iterator>
+
4#include <memory>
+
5
+
6namespace flow {
+
7
+
19 template <typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
+
+
20 OutputIt uninitializedForward(AllocatorType& allocator, InputIt first, InputIt last, OutputIt dest) {
+
21 for (; first != last; ++first, ++dest) {
+
22 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*dest), *first);
+
23 }
+
24 return dest;
+
25 }
+
+
26
+
38 template <typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
+
+
39 OutputIt uninitializedMove(AllocatorType& allocator, InputIt first, InputIt last, OutputIt dest) noexcept {
+
40 return uninitializedForward(allocator, std::move_iterator(first), std::move_iterator(last), dest);
+
41 }
+
+
42
+
55 template <typename AllocatorType, std::forward_iterator OutputIt, typename ...Args>
+
+
56 OutputIt uninitializedEmplace(AllocatorType& allocator, OutputIt first, OutputIt last, const Args&... args) {
+
57 for (; first != last; ++first) {
+
58 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*first), args...);
+
59 }
+
60 return first;
+
61 }
+
+
62
+
74 template <typename AllocatorType, std::forward_iterator OutputIt, typename T>
+
+
75 OutputIt uninitializedFill(AllocatorType& allocator, OutputIt first, OutputIt last, const T& value) {
+
76 return uninitializedEmplace(allocator, first, last, value);
+
77 }
+
+
78
+
87 template <typename AllocatorType, std::forward_iterator InputIt>
+
+
88 void destroyElements(AllocatorType& allocator, InputIt first, InputIt last) noexcept {
+
89 for (; first != last; ++first) {
+
90 std::allocator_traits<AllocatorType>::destroy(allocator, std::addressof(*first));
+
91 }
+
92 }
+
+
93
+
105 template <typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
+
+
106 OutputIt uninitializedForwardN(AllocatorType& allocator, InputIt first, std::size_t count, OutputIt dest) {
+
107 for (std::size_t i = 0; i < count; ++i, ++first, ++dest) {
+
108 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*dest), *first);
+
109 }
+
110 return dest;
+
111 }
+
+
112
+
124 template <typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
+
+
125 OutputIt uninitializedMoveN(AllocatorType& allocator, InputIt first, std::size_t count, OutputIt dest) noexcept {
+
126 return uninitializedForwardN(allocator, std::move_iterator(first), count, dest);
+
127 }
+
+
128
+
141 template <typename AllocatorType, std::forward_iterator OutputIt, typename ...Args>
+
+
142 OutputIt uninitializedEmplaceN(AllocatorType& allocator, OutputIt first, std::size_t count, const Args&... args) {
+
143 for (std::size_t i = 0; i < count; ++i, ++first) {
+
144 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*first), args...);
+
145 }
+
146 return first;
+
147 }
+
+
148
+
160 template <typename AllocatorType, std::forward_iterator OutputIt, typename T>
+
+
161 OutputIt uninitializedFillN(AllocatorType& allocator, OutputIt first, std::size_t count, const T& value) {
+
162 return uninitializedEmplaceN(allocator, first, count, value);
+
163 }
+
+
164
+
173 template <typename AllocatorType, std::forward_iterator InputIt>
+
+
174 void destroyElementsN(AllocatorType& allocator, InputIt first, std::size_t count) noexcept {
+
175 for (std::size_t i = 0; i < count; ++i, ++first) {
+
176 std::allocator_traits<AllocatorType>::destroy(allocator, std::addressof(*first));
+
177 }
+
178 }
+
+
179
+
190 template <typename AllocatorType, typename T>
+
+
191 void deleteBuffer(AllocatorType& allocator, T* buffer, std::size_t size, std::size_t capacity) noexcept {
+
192 destroyElementsN(allocator, buffer, size);
+
193 std::allocator_traits<AllocatorType>::deallocate(allocator, buffer, capacity);
+
194 }
+
+
195
+
202 template <typename T, typename U>
+
+
203 std::size_t pointerDistance(const T* first, const U* last) {
+
204 assert(first <= last && "first pointer address must be smaller than the last pointer address");
+
205 return reinterpret_cast<const std::byte*>(last) - reinterpret_cast<const std::byte*>(first);
+
206 }
+
+
207
+
219 template <typename Header>
+
+
220 Header* alignWithHeader(std::size_t alignment, std::size_t size, void*& buffer, std::size_t& capacity) noexcept {
+
221
+
222 // https://stackoverflow.com/questions/46457449/is-it-always-the-case-that-sizeoft-alignoft-for-all-object-types-t
+
223 assert(size >= alignment && "size is smaller than its alignment");
+
224 if (capacity < sizeof(Header) + size) {
+
225 return nullptr;
+
226 }
+
227
+
228 // Set the block alignment to be at least as big as the header alignment.
+
229 // If the allocated block is aligned, then its header is aligned.
+
230 alignment = std::max(alignment, alignof(Header));
+
231
+
232 // Reserve at least sizeof(Header) before the allocated block.
+
233 void* allocatedBlock = reinterpret_cast<Header*>(buffer) + 1;
+
234 std::size_t capacityAfterHeader = capacity - sizeof(Header);
+
235 if (!std::align(alignment, size, allocatedBlock, capacityAfterHeader)) {
+
236 return nullptr;
+
237 }
+
238
+
239 // Calculate the address of the header.
+
240 Header* header = reinterpret_cast<Header*>(allocatedBlock) - 1;
+
241 assert(reinterpret_cast<std::uintptr_t>(header) % alignof(Header) == 0 && "allocated buffer is not aligned with the header");
+
242
+
243 capacity -= pointerDistance(buffer, header);
+
244 buffer = header;
+
245 return header;
+
246 }
+
+
247}
+ +
OutputIt uninitializedEmplace(AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
Constructs objects in uninitialized memory by copying arguments to their constructor....
+
void destroyElements(AllocatorType &allocator, InputIt first, InputIt last) noexcept
Destroys a range of constructed objects in memory.
+
OutputIt uninitializedMoveN(AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest) noexcept
Moves count elements from a source range to uninitialized memory.
+
void destroyElementsN(AllocatorType &allocator, InputIt first, std::size_t count) noexcept
Destroys count objects in a range.
+
std::size_t pointerDistance(const T *first, const U *last)
Calculate the distance from the first pointer to the last pointer in bytes.
+
OutputIt uninitializedMove(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
Moves elements from a source range to uninitialized memory.
+
OutputIt uninitializedFillN(AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
Fills count elements in uninitialized memory with a value.
+
OutputIt uninitializedForwardN(AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
Forward count elements from a source range to uninitialized memory.
+
OutputIt uninitializedForward(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
Forward elements from a source range to uninitialized memory.
+
void deleteBuffer(AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is...
+
OutputIt uninitializedFill(AllocatorType &allocator, OutputIt first, OutputIt last, const T &value)
Fills uninitialized memory with copies of a value.
+
Header * alignWithHeader(std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
Align the header + buffer to their corresponding alignments. If the capacity is not big enough to acc...
+
OutputIt uninitializedEmplaceN(AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
Constructs a specified number of objects in uninitialized memory by forwarding arguments to their con...
+
+
+
+ + + + diff --git a/docs/flow__memory__resource_8h.html b/docs/flow__memory__resource_8h.html new file mode 100644 index 0000000..277a0f0 --- /dev/null +++ b/docs/flow__memory__resource_8h.html @@ -0,0 +1,126 @@ + + + + + + + +Flow: flow_memory_resource.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_memory_resource.h File Reference
+
+
+
#include <cstddef>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::MemoryResource
 A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__memory__resource_8h.js b/docs/flow__memory__resource_8h.js new file mode 100644 index 0000000..5b7fe00 --- /dev/null +++ b/docs/flow__memory__resource_8h.js @@ -0,0 +1,4 @@ +var flow__memory__resource_8h = +[ + [ "flow::MemoryResource", "classflow_1_1_memory_resource.html", "classflow_1_1_memory_resource" ] +]; \ No newline at end of file diff --git a/docs/flow__memory__resource_8h_source.html b/docs/flow__memory__resource_8h_source.html new file mode 100644 index 0000000..6e7f1ee --- /dev/null +++ b/docs/flow__memory__resource_8h_source.html @@ -0,0 +1,141 @@ + + + + + + + +Flow: flow_memory_resource.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_memory_resource.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <cstddef>
+
3
+
4namespace flow {
+
5
+
+ +
11 public:
+
12 virtual ~MemoryResource() = default;
+
13
+
+
14 void* allocate(std::size_t bytes, std::size_t alignment = alignof(std::max_align_t)) {
+
15 return allocateImp(bytes, alignment);
+
16 }
+
+
17
+
+
18 void deallocate(void* address, std::size_t bytes, std::size_t alignment = alignof(std::max_align_t)) {
+
19 deallocateImp(address, bytes, alignment);
+
20 }
+
+
21
+
22 protected:
+
23 virtual void* allocateImp(std::size_t bytes, std::size_t alignment) = 0;
+
24 virtual void deallocateImp(void* address, std::size_t bytes, std::size_t alignment) = 0;
+
25 };
+
+
26}
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment)=0
+
void * allocate(std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+
void deallocate(void *address, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
+
virtual void * allocateImp(std::size_t bytes, std::size_t alignment)=0
+
virtual ~MemoryResource()=default
+ +
+
+
+ + + + diff --git a/docs/flow__polymorphic__allocator_8h.html b/docs/flow__polymorphic__allocator_8h.html new file mode 100644 index 0000000..8aae83f --- /dev/null +++ b/docs/flow__polymorphic__allocator_8h.html @@ -0,0 +1,127 @@ + + + + + + + +Flow: flow_polymorphic_allocator.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_polymorphic_allocator.h File Reference
+
+
+
#include "flow_default_memory_resource.h"
+#include <cstddef>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::PolymorphicAllocator< T >
 A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__polymorphic__allocator_8h.js b/docs/flow__polymorphic__allocator_8h.js new file mode 100644 index 0000000..b7c9a00 --- /dev/null +++ b/docs/flow__polymorphic__allocator_8h.js @@ -0,0 +1,4 @@ +var flow__polymorphic__allocator_8h = +[ + [ "flow::PolymorphicAllocator< T >", "classflow_1_1_polymorphic_allocator.html", "classflow_1_1_polymorphic_allocator" ] +]; \ No newline at end of file diff --git a/docs/flow__polymorphic__allocator_8h_source.html b/docs/flow__polymorphic__allocator_8h_source.html new file mode 100644 index 0000000..5135709 --- /dev/null +++ b/docs/flow__polymorphic__allocator_8h_source.html @@ -0,0 +1,203 @@ + + + + + + + +Flow: flow_polymorphic_allocator.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_polymorphic_allocator.h
+
+
+Go to the documentation of this file.
1#pragma once
+ +
3#include <cstddef>
+
4
+
5namespace flow {
+
6
+
11 template <typename T = std::byte>
+
+ +
13 public:
+
14 using value_type = T; // Minimum requirement for allocator_traits
+
15
+
16
+
+ +
18 : resource_(&DefaultMemoryResource::getResource()) {
+
19 }
+
+
20
+
+ +
22 : resource_(&resource) {
+
23 }
+
+
24
+
25 template <typename U>
+
+ +
27 : resource_(allocator.resource_) {
+
28 }
+
+
29
+
+
35 T* allocate(std::size_t count) {
+
36 return static_cast<T*>(resource_->allocate(sizeof(T) * count, alignof(T)));
+
37 }
+
+
38
+
+
44 void deallocate(T* address, std::size_t count) noexcept {
+
45 resource_->deallocate(address, sizeof(T) * count, alignof(T));
+
46 }
+
+
47
+
51 template <typename U, typename... Args>
+
+
52 void construct(U* address, Args&&... args) {
+
53 ::new(address) U(std::forward<Args>(args)...);
+
54 }
+
+
55
+
59 template <typename U>
+
+
60 void destroy(U* address) noexcept {
+
61 address->~U();
+
62 }
+
+
63
+
64 private:
+
65 MemoryResource* resource_; // Non-owning memory resource.
+
66
+
67 template <typename U>
+ +
69
+
70 template <typename U>
+
+ +
72 return lhs.resource_ == rhs.resource_;
+
73 }
+
+
74
+
75 template <typename U>
+
+ +
77 return !(lhs == rhs);
+
78 }
+
+
79 };
+
+
80}
+
A default memory resource that wraps global operator new and operator delete.
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+
A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is...
+ +
void deallocate(T *address, std::size_t count) noexcept
Deallocates allocated raw memory.
+ +
friend bool operator==(const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)
+ + +
T * allocate(std::size_t count)
Allocate raw memory that can contain at least count number of objects.
+
PolymorphicAllocator(const PolymorphicAllocator< U > &allocator) noexcept
+
void destroy(U *address) noexcept
Destroys the object at the given address.
+
PolymorphicAllocator(MemoryResource &resource)
+
void construct(U *address, Args &&... args)
Constructs an object in place at the given address.
+
friend bool operator!=(const flow::PolymorphicAllocator< T > &lhs, const flow::PolymorphicAllocator< U > &rhs)
+ + +
+
+
+ + + + diff --git a/docs/flow__pool__memory__resource_8h.html b/docs/flow__pool__memory__resource_8h.html new file mode 100644 index 0000000..92c8629 --- /dev/null +++ b/docs/flow__pool__memory__resource_8h.html @@ -0,0 +1,130 @@ + + + + + + + +Flow: flow_pool_memory_resource.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_pool_memory_resource.h File Reference
+
+
+
#include "flow_memory_algorithm.h"
+#include "flow_memory_resource.h"
+#include <cstddef>
+#include <exception>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  flow::PoolMemoryResource
 A pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory. More...
struct  flow::PoolMemoryResource::Header
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__pool__memory__resource_8h.js b/docs/flow__pool__memory__resource_8h.js new file mode 100644 index 0000000..0737c4f --- /dev/null +++ b/docs/flow__pool__memory__resource_8h.js @@ -0,0 +1,5 @@ +var flow__pool__memory__resource_8h = +[ + [ "flow::PoolMemoryResource", "classflow_1_1_pool_memory_resource.html", "classflow_1_1_pool_memory_resource" ], + [ "flow::PoolMemoryResource::Header", "structflow_1_1_pool_memory_resource_1_1_header.html", "structflow_1_1_pool_memory_resource_1_1_header" ] +]; \ No newline at end of file diff --git a/docs/flow__pool__memory__resource_8h_source.html b/docs/flow__pool__memory__resource_8h_source.html new file mode 100644 index 0000000..293b0d4 --- /dev/null +++ b/docs/flow__pool__memory__resource_8h_source.html @@ -0,0 +1,199 @@ + + + + + + + +Flow: flow_pool_memory_resource.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_pool_memory_resource.h
+
+
+Go to the documentation of this file.
1#pragma once
+ + +
4#include <cstddef>
+
5#include <exception>
+
6
+
7namespace flow {
+
8
+
+ +
16 public:
+
+
17 PoolMemoryResource(void* buffer, std::size_t capacity, std::size_t blockSize, std::size_t blockAlignment = sizeof(std::max_align_t))
+
18 : blockSize_(blockSize), blockAlignment_(blockAlignment), head_(nullptr) {
+
19
+
20 Header** headPtr = &head_;
+
21 for (;;) {
+
22 Header* header = alignWithHeader<Header>(blockAlignment_, blockSize_, buffer, capacity);
+
23 if (!header) {
+
24 break;
+
25 }
+
26
+
27 new (header) Header(nullptr);
+
28 *headPtr = header;
+
29 headPtr = &(header->next);
+
30
+
31 buffer = reinterpret_cast<std::byte*>(buffer) + sizeof(Header) + blockSize;
+
32 capacity -= sizeof(Header) + blockSize;
+
33 }
+
34 }
+
+
35
+
+ +
37 // May be useless, since it has a trivial destructor.
+
38 while (head_) {
+
39 Header* next = head_->next;
+
40 head_->~Header();
+
41 head_ = next;
+
42 }
+
43 }
+
+
44
+
45 protected:
+
+
46 struct Header {
+ +
48 };
+
+
49
+
50 std::size_t blockSize_;
+
51 std::size_t blockAlignment_;
+ +
53
+
+
54 virtual void* allocateImp(std::size_t bytes, std::size_t alignment) override {
+
55 if (blockSize_ < bytes || blockAlignment_ < alignment || !head_) {
+
56 throw std::bad_alloc();
+
57 }
+
58
+
59 void* allocatedBlock = head_ + 1;
+
60 head_ = head_->next;
+
61 return allocatedBlock;
+
62 }
+
+
63
+
+
64 virtual void deallocateImp(
+
65 void* address,
+
66 [[maybe_unused]] std::size_t bytes,
+
67 [[maybe_unused]] std::size_t alignment) override {
+
68 Header* header = reinterpret_cast<Header*>(address) - 1;
+
69 header->next = head_;
+
70 head_ = header;
+
71 }
+
+
72 };
+
+
73}
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+ +
PoolMemoryResource(void *buffer, std::size_t capacity, std::size_t blockSize, std::size_t blockAlignment=sizeof(std::max_align_t))
+
virtual void * allocateImp(std::size_t bytes, std::size_t alignment) override
+ + + +
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment) override
+ + + +
Header * alignWithHeader(std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
Align the header + buffer to their corresponding alignments. If the capacity is not big enough to acc...
+ + +
+
+
+ + + + diff --git a/docs/flow__random__algorithm_8h.html b/docs/flow__random__algorithm_8h.html new file mode 100644 index 0000000..733cee7 --- /dev/null +++ b/docs/flow__random__algorithm_8h.html @@ -0,0 +1,133 @@ + + + + + + + +Flow: flow_random_algorithm.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_random_algorithm.h File Reference
+
+
+
#include <algorithm>
+#include <concepts>
+#include <random>
+
+

Go to the source code of this file.

+ + + +

+Namespaces

namespace  flow
+ + + + + + + +

+Functions

template<typename T>
+requires std::integral<T> || std::floating_point<T>
flow::getRandomNumber (T lower, T upper)
 Produces a random number uniformly distributed on the closed interval [lower, upper].
template<std::random_access_iterator It>
void flow::shuffle (It begin, It end)
 Randomly shuffle the elements in the range [begin, end).
+
+
+ +
+ + + + diff --git a/docs/flow__random__algorithm_8h.js b/docs/flow__random__algorithm_8h.js new file mode 100644 index 0000000..c84db09 --- /dev/null +++ b/docs/flow__random__algorithm_8h.js @@ -0,0 +1,5 @@ +var flow__random__algorithm_8h = +[ + [ "flow::getRandomNumber", "namespaceflow.html#ab90fae79ddd51259bfc55e73b295fcd9", null ], + [ "flow::shuffle", "namespaceflow.html#a69464bd65a1f1f8786cf92a34e4d9497", null ] +]; \ No newline at end of file diff --git a/docs/flow__random__algorithm_8h_source.html b/docs/flow__random__algorithm_8h_source.html new file mode 100644 index 0000000..96d9837 --- /dev/null +++ b/docs/flow__random__algorithm_8h_source.html @@ -0,0 +1,139 @@ + + + + + + + +Flow: flow_random_algorithm.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_random_algorithm.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <algorithm>
+
3#include <concepts>
+
4#include <random>
+
5
+
6namespace flow {
+
7
+
12 template <typename T>
+
13 requires std::integral<T> || std::floating_point<T>
+
+
14 T getRandomNumber(T lower, T upper) {
+
15 static std::random_device device{};
+
16 static std::mt19937_64 engine(device());
+
17 if constexpr (std::integral<T>) {
+
18 return std::uniform_int_distribution<T>(lower, upper)(engine);
+
19 } else {
+
20 return std::uniform_real_distribution<T>(lower, upper)(engine);
+
21 }
+
22 }
+
+
23
+
27 template <std::random_access_iterator It>
+
+
28 void shuffle(It begin, It end) {
+
29 static std::random_device device{};
+
30 static std::mt19937_64 engine(device());
+
31 std::shuffle(begin, end, engine);
+
32 }
+
+
33}
+ +
void shuffle(It begin, It end)
Randomly shuffle the elements in the range [begin, end).
+
T getRandomNumber(T lower, T upper)
Produces a random number uniformly distributed on the closed interval [lower, upper].
+
+
+
+ + + + diff --git a/docs/flow__stack__memory__resource_8h.html b/docs/flow__stack__memory__resource_8h.html new file mode 100644 index 0000000..a9f84e9 --- /dev/null +++ b/docs/flow__stack__memory__resource_8h.html @@ -0,0 +1,131 @@ + + + + + + + +Flow: flow_stack_memory_resource.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_stack_memory_resource.h File Reference
+
+
+
#include "flow_memory_algorithm.h"
+#include "flow_memory_resource.h"
+#include <cassert>
+#include <cstddef>
+#include <exception>
+
+

Go to the source code of this file.

+ + + + + +

+Classes

class  flow::StackMemoryResource
 A stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation. More...
struct  flow::StackMemoryResource::Header
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__stack__memory__resource_8h.js b/docs/flow__stack__memory__resource_8h.js new file mode 100644 index 0000000..a5ab587 --- /dev/null +++ b/docs/flow__stack__memory__resource_8h.js @@ -0,0 +1,5 @@ +var flow__stack__memory__resource_8h = +[ + [ "flow::StackMemoryResource", "classflow_1_1_stack_memory_resource.html", "classflow_1_1_stack_memory_resource" ], + [ "flow::StackMemoryResource::Header", "structflow_1_1_stack_memory_resource_1_1_header.html", "structflow_1_1_stack_memory_resource_1_1_header" ] +]; \ No newline at end of file diff --git a/docs/flow__stack__memory__resource_8h_source.html b/docs/flow__stack__memory__resource_8h_source.html new file mode 100644 index 0000000..f6c7000 --- /dev/null +++ b/docs/flow__stack__memory__resource_8h_source.html @@ -0,0 +1,182 @@ + + + + + + + +Flow: flow_stack_memory_resource.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_stack_memory_resource.h
+
+
+Go to the documentation of this file.
1#pragma once
+ + +
4#include <cassert>
+
5#include <cstddef>
+
6#include <exception>
+
7
+
8namespace flow {
+
9
+
+ +
16 public:
+
+
17 explicit StackMemoryResource(void* buffer, std::size_t capacity) noexcept
+
18 : buffer_(buffer), capacity_(capacity) {
+
19 }
+
+
20
+
21 protected:
+
+
22 struct Header {
+
23 void* oldBuffer;
+
24 };
+
+
25
+
26 void* buffer_;
+
27 std::size_t capacity_;
+
28
+
+
29 virtual void* allocateImp(std::size_t bytes, std::size_t alignment) override {
+
30 void* oldBuffer = buffer_;
+
31
+
32 void* alignedHeader = flow::alignWithHeader<Header>(alignment, bytes, buffer_, capacity_);
+
33 if (!alignedHeader) {
+
34 throw std::bad_alloc();
+
35 }
+
36
+
37 new (alignedHeader) Header(oldBuffer);
+
38 void* allocatedBlock = reinterpret_cast<Header*>(alignedHeader) + 1;
+
39 buffer_ = reinterpret_cast<std::byte*>(allocatedBlock) + bytes;
+
40 capacity_ -= sizeof(Header) + bytes;
+
41 return allocatedBlock;
+
42 }
+
+
43
+
+
44 virtual void deallocateImp(void* address, std::size_t bytes, [[maybe_unused]] std::size_t alignment) override {
+
45 // TODO: assert address is the top most valid address
+
46 assert(address == nullptr || address <= buffer_);
+
47 if (!address) {
+
48 return;
+
49 }
+
50
+
51 Header* header = reinterpret_cast<Header*>(address) - 1;
+
52 std::size_t padding = pointerDistance(header->oldBuffer, header);
+
53 buffer_ = header->oldBuffer;
+
54 capacity_ += padding + sizeof(Header) + bytes;
+
55 header->~Header();
+
56 }
+
+
57 };
+
+
58}
+
A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and dealloc...
+
virtual void * allocateImp(std::size_t bytes, std::size_t alignment) override
+ +
virtual void deallocateImp(void *address, std::size_t bytes, std::size_t alignment) override
+
StackMemoryResource(void *buffer, std::size_t capacity) noexcept
+ + + + +
std::size_t pointerDistance(const T *first, const U *last)
Calculate the distance from the first pointer to the last pointer in bytes.
+
Header * alignWithHeader(std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
Align the header + buffer to their corresponding alignments. If the capacity is not big enough to acc...
+ + +
+
+
+ + + + diff --git a/docs/flow__timer_8h.html b/docs/flow__timer_8h.html new file mode 100644 index 0000000..b089009 --- /dev/null +++ b/docs/flow__timer_8h.html @@ -0,0 +1,128 @@ + + + + + + + +Flow: flow_timer.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_timer.h File Reference
+
+
+
#include <chrono>
+#include <format>
+#include <vector>
+
+

Go to the source code of this file.

+ + + + +

+Classes

class  flow::Timer< ClockType >
 A simple timer to record timelapses. Uses chrono::steady_clock by default. More...
+ + +

+Namespaces

namespace  flow
+
+
+ +
+ + + + diff --git a/docs/flow__timer_8h.js b/docs/flow__timer_8h.js new file mode 100644 index 0000000..c9f2041 --- /dev/null +++ b/docs/flow__timer_8h.js @@ -0,0 +1,4 @@ +var flow__timer_8h = +[ + [ "flow::Timer< ClockType >", "classflow_1_1_timer.html", "classflow_1_1_timer" ] +]; \ No newline at end of file diff --git a/docs/flow__timer_8h_source.html b/docs/flow__timer_8h_source.html new file mode 100644 index 0000000..3ccd01f --- /dev/null +++ b/docs/flow__timer_8h_source.html @@ -0,0 +1,173 @@ + + + + + + + +Flow: flow_timer.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_timer.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2#include <chrono>
+
3#include <format>
+
4#include <vector>
+
5
+
6namespace flow {
+
10 template <typename ClockType = std::chrono::steady_clock>
+
+
11 class Timer {
+
12 using TimePoint = ClockType::time_point;
+ +
14 std::vector<TimePoint> timepoints_{};
+
15
+
16 public:
+
+
20 explicit constexpr Timer(std::size_t reserveSize = 8) {
+
21 timepoints_.reserve(reserveSize);
+
22 }
+
+
23
+
+
28 constexpr std::size_t size() const {
+
29 return timepoints_.size();
+
30 }
+
+
31
+
+
35 void reset() {
+
36 timepoints_.clear();
+
37 begin_ = ClockType::now();
+
38 }
+
+
39
+
+
43 void record() {
+
44 timepoints_.push_back(ClockType::now());
+
45 }
+
+
46
+
+
51 std::string toString() const {
+
52 std::string str = std::format("Total record entries: {}\n", timepoints_.size());
+
53 std::size_t i = 0;
+
54 for (const auto& timepoint : timepoints_) {
+
55 auto dur = timepoint - begin_;
+
56 str += std::format("\t[{}] {}, {}, {}\n",
+
57 i,
+
58 std::chrono::duration_cast<std::chrono::seconds>(dur),
+
59 std::chrono::duration_cast<std::chrono::milliseconds>(dur),
+
60 std::chrono::duration_cast<std::chrono::microseconds>(dur));
+
61 ++i;
+
62 }
+
63 return str;
+
64 }
+
+
65 };
+
+
66}
+
constexpr std::size_t size() const
Returns the number of recorded time points.
Definition flow_timer.h:28
+
void record()
Records the current time point relative to the last call to start().
Definition flow_timer.h:43
+
std::string toString() const
Formats and returns a string showing all recorded durations since the timer resets.
Definition flow_timer.h:51
+
std::vector< TimePoint > timepoints_
Definition flow_timer.h:14
+
void reset()
Clears all recorded time points and reset the starting time.
Definition flow_timer.h:35
+
constexpr Timer(std::size_t reserveSize=8)
Constructs a Timer and reserves space for a given number of time points.
Definition flow_timer.h:20
+
ClockType::time_point TimePoint
Definition flow_timer.h:12
+
TimePoint begin_
Definition flow_timer.h:13
+ +
+
+
+ + + + diff --git a/docs/flow__tuple_8h.html b/docs/flow__tuple_8h.html new file mode 100644 index 0000000..e64a8d5 --- /dev/null +++ b/docs/flow__tuple_8h.html @@ -0,0 +1,130 @@ + + + + + + + +Flow: flow_tuple.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_tuple.h File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  flow::Tuple< Ts >
class  flow::Tuple< T, Ts... >
+ + +

+Namespaces

namespace  flow
+ + + +

+Functions

template<typename T, typename ... Ts>
 flow::Tuple (T &&, Ts &&...) -> Tuple< T, Ts... >
+
+
+ +
+ + + + diff --git a/docs/flow__tuple_8h.js b/docs/flow__tuple_8h.js new file mode 100644 index 0000000..77a7716 --- /dev/null +++ b/docs/flow__tuple_8h.js @@ -0,0 +1,6 @@ +var flow__tuple_8h = +[ + [ "flow::Tuple< Ts >", "classflow_1_1_tuple.html", "classflow_1_1_tuple" ], + [ "flow::Tuple< T, Ts... >", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4" ], + [ "flow::Tuple", "namespaceflow.html#aaf246f21a7d66e18117ff22ba5c737fd", null ] +]; \ No newline at end of file diff --git a/docs/flow__tuple_8h_source.html b/docs/flow__tuple_8h_source.html new file mode 100644 index 0000000..7b673c6 --- /dev/null +++ b/docs/flow__tuple_8h_source.html @@ -0,0 +1,238 @@ + + + + + + + +Flow: flow_tuple.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_tuple.h
+
+
+Go to the documentation of this file.
1#pragma once
+
2
+
3namespace flow {
+
4 template <typename... Ts>
+
+
5 class Tuple {
+
6 public:
+
+
7 constexpr std::size_t size() const {
+
8 return 0;
+
9 }
+
+
10 };
+
+
11
+
12 template <typename T, typename... Ts>
+
+
13 class Tuple<T, Ts...> : Tuple<Ts...> {
+
14 using BaseType = Tuple<Ts...>;
+ +
16
+
17 public:
+
+
18 constexpr Tuple()
+
19 : BaseType{}, value_{} {
+
20 }
+
+
21
+
22 template <typename Arg1, typename ...Args2>
+
+
23 explicit constexpr Tuple(Arg1&& value, Args2&&... values)
+
24 : BaseType(std::forward<Args2>(values)...), value_(std::forward<Arg1>(value)) {
+
25 }
+
+
26
+
+
27 constexpr std::size_t size() const {
+
28 return sizeof...(Ts) + 1;
+
29 }
+
+
30
+
31 template <std::size_t N>
+
+
32 auto& get() {
+
33 if constexpr (N == 0) {
+
34 return value_;
+
35 } else {
+
36 return BaseType::get<N - 1>();
+
37 }
+
38 }
+
+
39
+
40 template <std::size_t N>
+
+
41 const auto& get() const {
+
42 if constexpr (N == 0) {
+
43 return value_;
+
44 } else {
+
45 return BaseType::get<N - 1>();
+
46 }
+
47 }
+
+
48 };
+
+
49
+
50 template <typename T, typename ...Ts>
+
51 Tuple(T&&, Ts&&...) -> Tuple<T, Ts...>;
+
52
+
53
+
54
+
56 //namespace detail {
+
57 // template <typename T>
+
58 // struct IsTuple : std::false_type {};
+
59
+
60 // template <typename ...Ts>
+
61 // struct IsTuple<Tuple<Ts...>> : std::true_type {};
+
62 //}
+
63
+
64 //template <typename T>
+
65 //constexpr bool is_tuple_v = detail::IsTuple<std::decay_t<T>>::value;
+
66
+
68 //namespace detail {
+
69 // template <typename T>
+
70 // struct TupleSize {};
+
71
+
72 // template <typename ...Ts>
+
73 // struct TupleSize<Tuple<Ts...>> {
+
74 // static constexpr std::size_t value = sizeof...(Ts);
+
75 // };
+
76 //}
+
77
+
78 //template <typename T>
+
79 //constexpr std::size_t tuple_size_v = detail::TupleSize<std::decay_t<T>>::value;
+
80
+
82 //namespace detail {
+
83 // template <typename T, typename ...Ts>
+
84 // struct MergedTuple {
+
85 // static_assert(is_tuple_v<T> && sizeof...(Ts) == 0, "concatenate non-tuple types");
+
86 // using type = T;
+
87 // };
+
88
+
89 // template <typename ...Ts1, typename ...Ts2, typename ...Tuples>
+
90 // struct MergedTuple<Tuple<Ts1...>, Tuple<Ts2...>, Tuples...> {
+
91 // using type = MergedTuple<Tuple<Ts1..., Ts2...>, Tuples...>::type;
+
92 // };
+
93 //}
+
94
+
95 //template <typename ...Ts>
+
96 //using merged_tuple_t = detail::MergedTuple<std::decay_t<Ts>...>::type;
+
97
+
99 //template<typename T1, typename T2>
+
100 //merged_tuple_t<T1, T2> merge_tuple(T1&& t1, T2&& t2) {
+
101 // return [&]<std::size_t ...INDEX1, std::size_t ...INDEX2>
+
102 // (std::index_sequence<INDEX1...>, std::index_sequence<INDEX2...>) {
+
103 // return merged_tuple_t<T1, T2>{
+
104 // std::move(t1).template get<INDEX1>()...,
+
105 // std::move(t2).template get<INDEX2>()...
+
106 // };
+
107 // }(std::make_index_sequence<tuple_size_v<T1>>(), std::make_index_sequence<tuple_size_v<T2>>());
+
108 //}
+
109}
+
Tuple< Ts... > BaseType
Definition flow_tuple.h:14
+ +
constexpr std::size_t size() const
Definition flow_tuple.h:27
+
constexpr Tuple(Arg1 &&value, Args2 &&... values)
Definition flow_tuple.h:23
+ +
const auto & get() const
Definition flow_tuple.h:41
+ + +
constexpr std::size_t size() const
Definition flow_tuple.h:7
+ +
Tuple(T &&, Ts &&...) -> Tuple< T, Ts... >
+
+
+
+ + + + diff --git a/docs/flow__vector_8h.html b/docs/flow__vector_8h.html new file mode 100644 index 0000000..0f1d402 --- /dev/null +++ b/docs/flow__vector_8h.html @@ -0,0 +1,222 @@ + + + + + + + +Flow: flow_vector.h File Reference + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_vector.h File Reference
+
+
+
#include "flow_counted_value_view_iterator.h"
+#include "flow_memory_algorithm.h"
+#include "flow_polymorphic_allocator.h"
+#include <cassert>
+#include <concepts>
+#include <initializer_list>
+#include <memory>
+#include <utility>
+
+

Go to the source code of this file.

+ + + + + + + +

+Classes

struct  flow::VectorGrowthStrategy
struct  flow::VectorGrowthStrategy::GoldenExpand
struct  flow::VectorGrowthStrategy::DoubleExpand
struct  flow::VectorGrowthStrategy::FibonacciExpand
class  flow::Vector< T, Allocator, Strategy >
+ + +

+Namespaces

namespace  flow
+ + +

+Concepts

concept  flow::GrowthStrategy
+ + + + + +

+Functions

template<typename T>
bool operator== (const flow::Vector< T > &lhs, const flow::Vector< T > &rhs) noexcept
template<typename T>
bool operator!= (const flow::Vector< T > &lhs, const flow::Vector< T > &rhs) noexcept
+

Function Documentation

+ +

◆ operator!=()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
bool operator!= (const flow::Vector< T > & lhs,
const flow::Vector< T > & rhs )
+
+noexcept
+
+ +

Definition at line 441 of file flow_vector.h.

+
441 {
+
442 return !(lhs == rhs);
+
443}
+
+
+
+ +

◆ operator==()

+ +
+
+
+template<typename T>
+ + + + + +
+ + + + + + + + + + + +
bool operator== (const flow::Vector< T > & lhs,
const flow::Vector< T > & rhs )
+
+noexcept
+
+ +

Definition at line 436 of file flow_vector.h.

+
436 {
+
437 return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
+
438}
+
iterator begin() noexcept
+
iterator end() noexcept
+
+
+
+
+
+ +
+ + + + diff --git a/docs/flow__vector_8h.js b/docs/flow__vector_8h.js new file mode 100644 index 0000000..16afc6a --- /dev/null +++ b/docs/flow__vector_8h.js @@ -0,0 +1,11 @@ +var flow__vector_8h = +[ + [ "flow::VectorGrowthStrategy", "structflow_1_1_vector_growth_strategy.html", "structflow_1_1_vector_growth_strategy" ], + [ "flow::VectorGrowthStrategy::GoldenExpand", "structflow_1_1_vector_growth_strategy_1_1_golden_expand.html", "structflow_1_1_vector_growth_strategy_1_1_golden_expand" ], + [ "flow::VectorGrowthStrategy::DoubleExpand", "structflow_1_1_vector_growth_strategy_1_1_double_expand.html", "structflow_1_1_vector_growth_strategy_1_1_double_expand" ], + [ "flow::VectorGrowthStrategy::FibonacciExpand", "structflow_1_1_vector_growth_strategy_1_1_fibonacci_expand.html", "structflow_1_1_vector_growth_strategy_1_1_fibonacci_expand" ], + [ "flow::Vector< T, Allocator, Strategy >", "classflow_1_1_vector.html", "classflow_1_1_vector" ], + [ "flow::GrowthStrategy", "conceptflow_1_1_growth_strategy.html", null ], + [ "operator!=", "flow__vector_8h.html#a74b1b9f01e1911a3186769679f74c377", null ], + [ "operator==", "flow__vector_8h.html#af06ef3cc2293dbd659cdeb3ef04b94ba", null ] +]; \ No newline at end of file diff --git a/docs/flow__vector_8h_source.html b/docs/flow__vector_8h_source.html new file mode 100644 index 0000000..47ac61f --- /dev/null +++ b/docs/flow__vector_8h_source.html @@ -0,0 +1,831 @@ + + + + + + + +Flow: flow_vector.h Source File + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flow_vector.h
+
+
+Go to the documentation of this file.
1#pragma once
+ + + +
5#include <cassert>
+
6#include <concepts>
+
7#include <initializer_list>
+
8#include <memory>
+
9#include <utility>
+
10
+
11namespace flow {
+
12
+
13 template <typename Strategy>
+
+
14 concept GrowthStrategy = requires(Strategy strategy, std::size_t num) {
+
15 { strategy(num) } -> std::same_as<std::size_t>;
+
16 };
+
+
17
+
+ +
+
19 struct GoldenExpand {
+
+
20 std::size_t operator()(std::size_t oldCapacity) const {
+
21 return oldCapacity + oldCapacity / 2 + 1;
+
22 }
+
+
23 };
+
+
24
+
+
25 struct DoubleExpand {
+
+
26 std::size_t operator()(std::size_t oldCapacity) const {
+
27 return oldCapacity * 2 + 1;
+
28 }
+
+
29 };
+
+
30
+
+ +
32 std::size_t n1 = 0;
+
33 std::size_t n2 = 1;
+
+
34 std::size_t operator()(std::size_t oldCapacity) {
+
35 do {
+
36 std::size_t n3 = n1 + n2;
+
37 n1 = n2;
+
38 n2 = n3;
+
39 } while (n2 <= oldCapacity);
+
40 return n2;
+
41 }
+
+
42 };
+
+
43 };
+
+
44
+
45
+
46 template <typename T, typename Allocator = PolymorphicAllocator<>, GrowthStrategy Strategy = VectorGrowthStrategy::GoldenExpand>
+
+
47 class Vector {
+
48 public:
+
49 using value_type = T;
+
50 using reference = T&;
+
51 using const_reference = const T&;
+
52 using pointer = T*;
+
53 using const_pointer = const T*;
+
54 using iterator = T*;
+
55 using const_iterator = const T*;
+
56 using size_type = std::size_t;
+
57 using difference_type = std::ptrdiff_t;
+
58 using allocator_type = std::allocator_traits<Allocator>::template rebind_alloc<T>;
+
59
+
60 private:
+
61 using allocator_trait = std::allocator_traits<Allocator>::template rebind_traits<T>;
+
62
+ + +
65 std::size_t size_;
+
66 std::size_t capacity_;
+ +
68
+
69 // Clean up the old buffer.
+
+
70 void updateBuffer(T* buffer, std::size_t capacity) {
+ +
72 buffer_ = buffer;
+ +
74 }
+
+
75
+
76 // Allocate a new buffer with the capacity, and relocate the elements to it.
+
77 // This update the buffer_ and capacity_ internally.
+
+
78 void relocateBuffer(std::size_t capacity) {
+
79 assert(capacity_ < capacity && "new capacity is no larger than the old capacity");
+
80
+
81 T* buffer = allocator_trait::allocate(allocator_, capacity);
+ +
83 updateBuffer(buffer, capacity);
+
84 }
+
+
85
+
86 // Allocate a new buffer with the capacity, and relocate the elements to it with a hole at pos.
+
+
87 void relocateBufferWithHoles(std::size_t capacity, iterator pos, std::size_t holeSize) {
+
88 assert(capacity_ < capacity && "new capacity is no larger than the old capacity");
+
89
+
90 T* buffer = allocator_trait::allocate(allocator_, capacity);
+
91 iterator leftHalf = uninitializedMove(allocator_, begin(), pos, buffer); // Move left half.
+
92 uninitializedMove(allocator_, pos, end(), leftHalf + holeSize); // Move right half.
+
93 updateBuffer(buffer, capacity);
+
94 }
+
+
95
+
96 template <typename ...U>
+
+
97 void resizeImp(std::size_t size, const U&... optionalValue) {
+
98 static_assert(sizeof...(optionalValue) <= 1, "no fill value or exactly one copy");
+
99 if (size_ < size) {
+
100 // Relocate if not enough capacity.
+
101 if (capacity_ < size) {
+ +
103 }
+
104 uninitializedEmplace(allocator_, buffer_ + size_, buffer_ + size, optionalValue...);
+
105
+
106 } else if (size < size_) {
+
107 // Shrink.
+ +
109 }
+
110 size_ = size;
+
111 }
+
+
112
+
113 public:
+
114 // Constructors
+
115 // Default construct should not be explicit.
+
+
116 constexpr Vector() noexcept
+ +
118 }
+
+
119
+
+
120 explicit constexpr Vector(const allocator_type& allocator)
+
121 : allocator_(allocator),
+ +
123 size_(0),
+
124 capacity_(0),
+
125 buffer_(nullptr) {
+
126 }
+
+
127
+
+
128 constexpr Vector(const Vector& rhs)
+
129 : Vector(rhs, rhs.get_allocator()) {
+
130 }
+
+
131
+
+
132 constexpr Vector(const Vector& rhs, const allocator_type& allocator)
+
133 : allocator_(allocator),
+ +
135 size_(rhs.size_),
+
136 capacity_(rhs.capacity_),
+ + +
139 }
+
+
140
+
141 // Move constructor must be noexcept
+
+
142 constexpr Vector(Vector&& rhs) noexcept
+
143 : Vector(std::move(rhs), rhs.get_allocator()) {
+
144 }
+
+
145
+
146 // Extended move constructor may through
+
+
147 constexpr Vector(Vector&& rhs, const allocator_type& allocator)
+
148 : Vector(allocator) {
+
149
+
150 if (rhs.get_allocator() == allocator) {
+
151 swap(*this, rhs);
+
152 } else {
+
153 // Create a copy with new allocator, then swap over.
+
154 Vector rhsCopy(rhs, allocator);
+
155 swap(*this, rhsCopy);
+
156 }
+
157 }
+
+
158
+
159 template <std::input_iterator It>
+
+
160 explicit constexpr Vector(It first, It last, const allocator_type& allocator = {})
+
161 : allocator_(allocator),
+ +
163 size_(std::distance(first, last)),
+ + + +
167 }
+
+
168
+
+
169 constexpr Vector(std::initializer_list<T> list, const allocator_type& allocator = {})
+
170 : Vector(list.begin(), list.end(), allocator) {
+
171 }
+
+
172
+
+
173 explicit constexpr Vector(std::size_t count, const allocator_type& allocator = {})
+
174 : allocator_(allocator),
+ +
176 size_(count),
+
177 capacity_(count),
+
178 buffer_(allocator_trait::allocate(allocator_, count)) {
+ +
180 }
+
+
181
+
+
182 explicit constexpr Vector(std::size_t count, const T& value, const allocator_type& allocator = {})
+
183 : allocator_(allocator),
+ +
185 size_(count),
+
186 capacity_(count),
+
187 buffer_(allocator_trait::allocate(allocator_, count)) {
+
188 uninitializedFillN(allocator_, buffer_, count, value);
+
189 }
+
+
190
+
191 // Destructor.
+ +
195
+
196 // Operator.
+
+
197 Vector& operator=(Vector rhs) noexcept {
+
198 swap(*this, rhs);
+
199 return *this;
+
200 }
+
+
201
+
+
202 T& operator[](std::size_t i) noexcept {
+
203 assert(i < size_ && "index out of bound");
+
204 return buffer_[i];
+
205 }
+
+
206
+
+
207 const T& operator[](std::size_t i) const noexcept {
+
208 assert(i < size_ && "index out of bound");
+
209 return buffer_[i];
+
210 }
+
+
211
+
212 // Allocator.
+
+
213 allocator_type get_allocator() const noexcept {
+
214 return allocator_;
+
215 }
+
+
216
+
217 // Iterators
+
+
218 iterator begin() noexcept {
+
219 return buffer_;
+
220 }
+
+
221
+
+
222 constexpr const_iterator begin() const noexcept {
+
223 return buffer_;
+
224 }
+
+
225
+
+
226 iterator end() noexcept {
+
227 return buffer_ + size_;
+
228 }
+
+
229
+
+
230 constexpr const_iterator end() const noexcept {
+
231 return buffer_ + size_;
+
232 }
+
+
233
+
234 // Accessers.
+
+
235 constexpr std::size_t size() const noexcept {
+
236 return size_;
+
237 }
+
+
238
+
+
239 constexpr std::size_t capacity() const noexcept {
+
240 return capacity_;
+
241 }
+
+
242
+
+
243 constexpr bool empty() const noexcept {
+
244 return size_ == 0;
+
245 }
+
+
246
+
+
247 T& front() noexcept {
+
248 assert(0 < size_ && "access empty Vector front");
+
249 return buffer_[0];
+
250 }
+
+
251
+
+
252 constexpr const T& front() const noexcept {
+
253 assert(0 < size_ && "access empty Vector front");
+
254 return buffer_[0];
+
255 }
+
+
256
+
+
257 T& back() noexcept {
+
258 assert(0 < size_ && "access empty Vector back");
+
259 return buffer_[size_ - 1];
+
260 }
+
+
261
+
+
262 constexpr const T& back() const noexcept {
+
263 assert(0 < size_ && "access empty Vector back");
+
264 return buffer_[size_ - 1];
+
265 }
+
+
266
+
267 // Mutators
+
+
268 void clear() noexcept {
+ +
270 size_ = 0;
+
271 }
+
+
272
+
+
273 void reserve(std::size_t capacity) {
+
274 if (capacity_ < capacity) {
+ +
276 }
+
277 }
+
+
278
+
+
279 void resize(std::size_t size) {
+ +
281 }
+
+
282
+
+
283 void resize(std::size_t size, const T& value) {
+
284 resizeImp(size, value);
+
285 }
+
+
286
+
287 // https://stackoverflow.com/questions/10890653/why-would-i-ever-use-push-back-instead-of-emplace-back
+
288 // TLDR: Consider emplace back an address when constructing unique_ptr.
+
+
289 void pushBack(const T& value) {
+
290 emplaceBack(value);
+
291 }
+
+
292
+
+
293 void pushBack(T&& value) {
+
294 emplaceBack(std::move(value));
+
295 }
+
+
296
+
297 template <typename ...Args>
+
+
298 void emplaceBack(Args&&... args) {
+
299 if (size_ == capacity_) {
+ +
301 }
+
302 allocator_trait::construct(allocator_, buffer_ + size_, std::forward<Args>(args)...);
+
303 ++size_;
+
304 }
+
+
305
+
+
306 void popBack() noexcept {
+
307 assert(0 < size_ && "can not pop back from an empty vector");
+
308 --size_;
+
309 allocator_trait::destroy(allocator_, buffer_ + size_);
+
310 }
+
+
311
+
+
317 iterator erase(iterator pos) noexcept {
+
318 assert(begin() <= pos && pos < end() && "can not erase before begin() or at the end()");
+
319 std::move(pos + 1, end(), pos);
+
320 popBack();
+
321 return pos;
+
322 }
+
+
323
+
+
330 iterator erase(iterator first, iterator last) noexcept {
+
331 assert(begin() <= first && last <= end() && "can not erase before begin() or past the end()");
+
332 assert(first <= last && "first must be before last");
+
333
+
334 iterator afterMoved = std::move(last, end(), first);
+
335 destroyElements(allocator_, afterMoved, end());
+
336 size_ -= last - first;
+
337 return first;
+
338 }
+
+
339
+
340 template <typename ...Args>
+
+
341 void emplace(iterator pos, Args&&... args) {
+
342 // Special case: append at the end.
+
343 if (pos == end()) {
+
344 emplaceBack(std::forward<Args>(args)...);
+
345 return;
+
346 }
+
347
+
348 if (size_ < capacity_) {
+
349 // Enough capacity, right shift the elements.
+
350 // Major optimization to use memcpy, copy_backward, or range move_backward instead of handroll loop. A 70% reduction in computation time.
+
351 allocator_trait::construct(allocator_, end(), std::move(back()));
+
352 std::move_backward(pos, end()-1, end());
+
353 *pos = T(std::forward<Args>(args)...);
+
354
+
355 } else {
+
356 // Not enough capacity, relocate all to a new buffer.
+
357 std::size_t index = pos - buffer_;
+ +
359 allocator_trait::construct(allocator_, buffer_ + index, std::forward<Args>(args)...);
+
360 }
+
361 ++size_;
+
362 }
+
+
363
+
+
364 void insert(iterator pos, const T& value) {
+
365 emplace(pos, value);
+
366 }
+
+
367
+
+
368 void insert(iterator pos, T&& value) {
+
369 emplace(pos, std::move(value));
+
370 }
+
+
371
+
+
372 void insert(iterator pos, std::size_t count, const T& value) {
+
373 insert(pos, CountedValueViewIterator(value, count), CountedValueViewIterator(value));
+
374 }
+
+
375
+
376 // Do not support self inserting.
+
377 template <std::input_iterator It>
+
+
378 void insert(iterator pos, It first, It last) {
+
379 const std::size_t insertedElementsSize = std::distance(first, last);
+
380 const std::size_t requiredSize = size_ + insertedElementsSize;
+
381
+
382 if (capacity_ < requiredSize) {
+
383 // Not enough capacity, relocate to a new buffer.
+
384 std::size_t index = pos - begin();
+
385 std::size_t newCapacity = growthStrategy_(requiredSize);
+
386 relocateBufferWithHoles(newCapacity, pos, insertedElementsSize);
+
387 uninitializedForward(allocator_, first, last, begin() + index);
+
388 } else {
+
389 // Enough capacity, shift elements.
+
390 // Inserted that are inbound = Shifted that are outbound.
+
391 const std::size_t shiftedElementSize = end() - pos;
+
392 const std::size_t conflictedRangeSize = std::min(insertedElementsSize, shiftedElementSize);
+
393 const std::size_t shiftedElementsInboundSize = shiftedElementSize - conflictedRangeSize;
+
394 const std::size_t insertedElementsOutboundSize = insertedElementsSize - conflictedRangeSize;
+
395
+
396 // Shifted elements that are on uninitialized buffer range.
+
397 // This range can be empty if insert at end().
+
398 uninitializedMove(allocator_, end() - conflictedRangeSize, end(), pos + insertedElementsSize + shiftedElementsInboundSize);
+
399
+
400 // Shifted elements that are on initialized buffer range.
+
401 // This range can be empty if all shifted elements must move to the uninitialized buffer from the previous step.
+
402 std::move_backward(pos, pos + shiftedElementsInboundSize, end());
+
403
+
404 // Inserted elements that are on initialized buffer range starting at pos.
+
405 // This range can be empty if insert at end().
+
406 for (std::size_t i = 0; i < conflictedRangeSize; ++i, ++first, ++pos) {
+
407 *pos = *first;
+
408 }
+
409
+
410 // Inserted elements that are on uninitialized buffer range.
+
411 // This range can be empty if insertedElementSize <= shiftedElementSize -> conflictedRangeSize = insertedElementSize.
+
412 // Such that there are enough space in the initialized buffer range.
+
413 uninitializedForwardN(allocator_, first, insertedElementsOutboundSize, pos);
+
414 }
+
415
+
416 size_ = requiredSize;
+
417 }
+
+
418
+
+
419 void insert(iterator pos, std::initializer_list<T> list) {
+
420 insert(pos, list.begin(), list.end());
+
421 }
+
+
422
+
423 // Friends.
+
+
424 friend void swap(Vector& lhs, Vector& rhs) noexcept {
+
425 using std::swap;
+
426 swap(lhs.allocator_, rhs.allocator_);
+
427 swap(lhs.growthStrategy_, rhs.growthStrategy_);
+
428 swap(lhs.size_, rhs.size_);
+
429 swap(lhs.capacity_, rhs.capacity_);
+
430 swap(lhs.buffer_, rhs.buffer_);
+
431 }
+
+
432 };
+
+
433}
+
434
+
435template <typename T>
+
+
436bool operator==(const flow::Vector<T>& lhs, const flow::Vector<T>& rhs) noexcept {
+
437 return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
+
438}
+
+
439
+
440template <typename T>
+
+
441bool operator!=(const flow::Vector<T>& lhs, const flow::Vector<T>& rhs) noexcept {
+
442 return !(lhs == rhs);
+
443}
+
+
444
+
445//namespace nope {
+
446// template <typename T>
+
447// class Vector {
+
448// template<typename MappingFn, template<typename> typename Alloc = Allocator>
+
449// Vector<std::invoke_result_t<MappingFn, const T&>, Alloc> map(const MappingFn& fn) const {
+
450// Vector<std::invoke_result_t<MappingFn, const T&>, Alloc> mapped;
+
451// mapped.relocate(size_);
+
452// for (const T& val : *this) {
+
453// mapped.push_back(fn(val));
+
454// }
+
455// return mapped;
+
456// }
+
457//
+
458// template <typename FilterFn, template<typename> typename Alloc = Allocator>
+
459// Vector<T, Alloc> filter(const FilterFn& fn) const {
+
460// static_assert(std::is_same_v<std::invoke_result_t<FilterFn, const T&>, bool>, "filter function must evaluate to bool");
+
461// Vector<T, Alloc> filtered;
+
462// for (const T& val : *this) {
+
463// if (fn(val)) {
+
464// filtered.push_back(val);
+
465// }
+
466// }
+
467// return filtered;
+
468// }
+
469//
+
470// template <typename CallbackFn>
+
471// void for_each(const CallbackFn& fn) const {
+
472// for (auto& val : *this) {
+
473// fn(val);
+
474// }
+
475// }
+
476//
+
477// friend class Vector;
+
478// };
+
479//
+
480//
+
481//
+
482// //TODO: support move semantics
+
483// template <typename ...Vec>
+
484// Vector<Tuple<typename Vec::value_type...>> zip(const Vec&... vec) {
+
485// using ZipType = Tuple<typename Vec::value_type...>;
+
486// std::size_t minSize = std::min({vec.size()...});
+
487// Vector<ZipType> zipped;
+
488// zipped.reserve(minSize);
+
489// for (std::size_t i = 0; i < minSize; ++i) {
+
490// zipped.push_back(ZipType{vec[i]...});
+
491// }
+
492// return zipped;
+
493// }
+
494//
+
495// Vector<std::string> split(const std::string& line, const std::string& delimiter) {
+
496// if (delimiter.empty()) {
+
497// return { line };
+
498// }
+
499//
+
500// Vector<std::string> tokens;
+
501// for (std::size_t pos = 0;;) {
+
502// std::size_t nextPos = line.find(delimiter, pos);
+
503// tokens.push_back(line.substr(pos, nextPos - pos));
+
504// if (nextPos == std::string::npos) {
+
505// break;
+
506// }
+
507// pos = nextPos + delimiter.size();
+
508// }
+
509// return tokens;
+
510// }
+
511//
+
512// std::string join(const Vector<std::string>& tokens, const std::string& separator) {
+
513// if (tokens.empty()) {
+
514// return "";
+
515// }
+
516//
+
517// std::size_t sz = (tokens.size() - 1) * separator.size();
+
518// for (auto& token : tokens) {
+
519// sz += token.size();
+
520// }
+
521//
+
522// std::string line;
+
523// line.reserve(sz);
+
524// for (std::size_t i = 0; i + 1 < tokens.size(); ++i) {
+
525// line += tokens[i] + separator;
+
526// }
+
527// line += tokens.back();
+
528// return line;
+
529// }
+
530//}
+
Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual ran...
+ +
void insert(iterator pos, It first, It last)
+
allocator_type get_allocator() const noexcept
+
void emplaceBack(Args &&... args)
+
constexpr std::size_t size() const noexcept
+
constexpr Vector(Vector &&rhs) noexcept
+
std::size_t size_type
Definition flow_vector.h:56
+
iterator erase(iterator first, iterator last) noexcept
Removes elements in the range [first, last).
+
constexpr const T & back() const noexcept
+ + +
constexpr Vector(Vector &&rhs, const allocator_type &allocator)
+
std::allocator_traits< Allocator >::template rebind_traits< T > allocator_trait
Definition flow_vector.h:61
+
void pushBack(const T &value)
+
iterator begin() noexcept
+
void relocateBufferWithHoles(std::size_t capacity, iterator pos, std::size_t holeSize)
Definition flow_vector.h:87
+ +
constexpr Vector(const Vector &rhs)
+
constexpr std::size_t capacity() const noexcept
+
Vector & operator=(Vector rhs) noexcept
+
Strategy growthStrategy_
Definition flow_vector.h:64
+
std::size_t size_
Definition flow_vector.h:65
+
void emplace(iterator pos, Args &&... args)
+
constexpr Vector(std::size_t count, const allocator_type &allocator={})
+
iterator erase(iterator pos) noexcept
Removes the element at the given position.
+
void pushBack(T &&value)
+
void insert(iterator pos, T &&value)
+
T & operator[](std::size_t i) noexcept
+
const T * const_pointer
Definition flow_vector.h:53
+
constexpr Vector(std::size_t count, const T &value, const allocator_type &allocator={})
+
void resize(std::size_t size, const T &value)
+
void resizeImp(std::size_t size, const U &... optionalValue)
Definition flow_vector.h:97
+
const T & operator[](std::size_t i) const noexcept
+
const T * const_iterator
Definition flow_vector.h:55
+
void relocateBuffer(std::size_t capacity)
Definition flow_vector.h:78
+
constexpr Vector(const allocator_type &allocator)
+
void updateBuffer(T *buffer, std::size_t capacity)
Definition flow_vector.h:70
+
constexpr const T & front() const noexcept
+
constexpr Vector(It first, It last, const allocator_type &allocator={})
+
T & front() noexcept
+ +
void resize(std::size_t size)
+
const T & const_reference
Definition flow_vector.h:51
+
std::size_t capacity_
Definition flow_vector.h:66
+
void insert(iterator pos, std::size_t count, const T &value)
+
void insert(iterator pos, std::initializer_list< T > list)
+
friend void swap(Vector &lhs, Vector &rhs) noexcept
+
T & back() noexcept
+
allocator_type allocator_
Definition flow_vector.h:63
+ +
constexpr bool empty() const noexcept
+
constexpr const_iterator end() const noexcept
+
std::ptrdiff_t difference_type
Definition flow_vector.h:57
+
std::allocator_traits< Allocator >::template rebind_alloc< T > allocator_type
Definition flow_vector.h:58
+
iterator end() noexcept
+ +
constexpr Vector(std::initializer_list< T > list, const allocator_type &allocator={})
+
void popBack() noexcept
+
void clear() noexcept
+
constexpr Vector(const Vector &rhs, const allocator_type &allocator)
+
constexpr Vector() noexcept
+
constexpr const_iterator begin() const noexcept
+
void reserve(std::size_t capacity)
+
void insert(iterator pos, const T &value)
+ + + + +
bool operator!=(const flow::Vector< T > &lhs, const flow::Vector< T > &rhs) noexcept
+
bool operator==(const flow::Vector< T > &lhs, const flow::Vector< T > &rhs) noexcept
+ +
OutputIt uninitializedEmplace(AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
Constructs objects in uninitialized memory by copying arguments to their constructor....
+
void destroyElements(AllocatorType &allocator, InputIt first, InputIt last) noexcept
Destroys a range of constructed objects in memory.
+
void destroyElementsN(AllocatorType &allocator, InputIt first, std::size_t count) noexcept
Destroys count objects in a range.
+
OutputIt uninitializedMove(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
Moves elements from a source range to uninitialized memory.
+
OutputIt uninitializedFillN(AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
Fills count elements in uninitialized memory with a value.
+
OutputIt uninitializedForwardN(AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
Forward count elements from a source range to uninitialized memory.
+
OutputIt uninitializedForward(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
Forward elements from a source range to uninitialized memory.
+
void deleteBuffer(AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is...
+
OutputIt uninitializedEmplaceN(AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
Constructs a specified number of objects in uninitialized memory by forwarding arguments to their con...
+ +
std::size_t operator()(std::size_t oldCapacity) const
Definition flow_vector.h:26
+ +
std::size_t operator()(std::size_t oldCapacity)
Definition flow_vector.h:34
+ + + +
std::size_t operator()(std::size_t oldCapacity) const
Definition flow_vector.h:20
+ +
+
+
+ + + + diff --git a/docs/functions.html b/docs/functions.html new file mode 100644 index 0000000..fbf4826 --- /dev/null +++ b/docs/functions.html @@ -0,0 +1,289 @@ + + + + + + + +Flow: Class Members + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+ + +

- ~ -

+
+
+
+ + + + diff --git a/docs/functions_func.html b/docs/functions_func.html new file mode 100644 index 0000000..626c997 --- /dev/null +++ b/docs/functions_func.html @@ -0,0 +1,227 @@ + + + + + + + +Flow: Class Members - Functions + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- u -

+ + +

- v -

+ + +

- w -

+ + +

- ~ -

+
+
+
+ + + + diff --git a/docs/functions_rela.html b/docs/functions_rela.html new file mode 100644 index 0000000..ecc3c88 --- /dev/null +++ b/docs/functions_rela.html @@ -0,0 +1,109 @@ + + + + + + + +Flow: Class Members - Related Symbols + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all related symbols with links to the classes they belong to:
+
+
+
+ + + + diff --git a/docs/functions_type.html b/docs/functions_type.html new file mode 100644 index 0000000..7c3ef2d --- /dev/null +++ b/docs/functions_type.html @@ -0,0 +1,118 @@ + + + + + + + +Flow: Class Members - Typedefs + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+ + + + diff --git a/docs/functions_vars.html b/docs/functions_vars.html new file mode 100644 index 0000000..ded737b --- /dev/null +++ b/docs/functions_vars.html @@ -0,0 +1,186 @@ + + + + + + + +Flow: Class Members - Variables + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- q -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+
+
+
+ + + + diff --git a/docs/globals.html b/docs/globals.html new file mode 100644 index 0000000..00a1263 --- /dev/null +++ b/docs/globals.html @@ -0,0 +1,106 @@ + + + + + + + +Flow: File Members + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all file members with links to the files they belong to:
+
+
+
+ + + + diff --git a/docs/globals_func.html b/docs/globals_func.html new file mode 100644 index 0000000..11c15a6 --- /dev/null +++ b/docs/globals_func.html @@ -0,0 +1,106 @@ + + + + + + + +Flow: File Members + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the files they belong to:
+
+
+
+ + + + diff --git a/docs/hierarchy.html b/docs/hierarchy.html new file mode 100644 index 0000000..7d842b9 --- /dev/null +++ b/docs/hierarchy.html @@ -0,0 +1,131 @@ + + + + + + + +Flow: Class Hierarchy + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Hierarchy
+
+
+
This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 12]
+ + + + + + + + + + + + + + + + + + + + + + +
 Cflow::ConcurrentFlexQueue< T >
 Cflow::ConcurrentQueue< T, Container >
 Cflow::CountedValueViewIterator< T >Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage
 Cflow::DebugClassDebug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on
 Cflow::VectorGrowthStrategy::DoubleExpand
 Cflow::VectorGrowthStrategy::FibonacciExpand
 Cflow::VectorGrowthStrategy::GoldenExpand
 Cflow::PoolMemoryResource::Header
 Cflow::StackMemoryResource::Header
 Cflow::MemoryResourceA memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory
 Cflow::ArenaMemoryResourceA linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation
 Cflow::DefaultMemoryResourceA default memory resource that wraps global ::operator new and ::operator delete
 Cflow::PoolMemoryResourceA pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory
 Cflow::StackMemoryResourceA stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation
 Cflow::ConcurrentFlexQueue< T >::Node
 Cflow::PolymorphicAllocator< T >A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation
 Cflow::Timer< ClockType >A simple timer to record timelapses. Uses chrono::steady_clock by default
 Cflow::Tuple< Ts >
 Cflow::Tuple< Ts... >
 Cflow::Tuple< T, Ts... >
 Cflow::Vector< T, Allocator, Strategy >
 Cflow::VectorGrowthStrategy
+
+
+
+
+ + + + diff --git a/docs/hierarchy.js b/docs/hierarchy.js new file mode 100644 index 0000000..b7e3e85 --- /dev/null +++ b/docs/hierarchy.js @@ -0,0 +1,27 @@ +var hierarchy = +[ + [ "flow::ConcurrentFlexQueue< T >", "classflow_1_1_concurrent_flex_queue.html", null ], + [ "flow::ConcurrentQueue< T, Container >", "classflow_1_1_concurrent_queue.html", null ], + [ "flow::CountedValueViewIterator< T >", "classflow_1_1_counted_value_view_iterator.html", null ], + [ "flow::DebugClass", "classflow_1_1_debug_class.html", null ], + [ "flow::VectorGrowthStrategy::DoubleExpand", "structflow_1_1_vector_growth_strategy_1_1_double_expand.html", null ], + [ "flow::VectorGrowthStrategy::FibonacciExpand", "structflow_1_1_vector_growth_strategy_1_1_fibonacci_expand.html", null ], + [ "flow::VectorGrowthStrategy::GoldenExpand", "structflow_1_1_vector_growth_strategy_1_1_golden_expand.html", null ], + [ "flow::PoolMemoryResource::Header", "structflow_1_1_pool_memory_resource_1_1_header.html", null ], + [ "flow::StackMemoryResource::Header", "structflow_1_1_stack_memory_resource_1_1_header.html", null ], + [ "flow::MemoryResource", "classflow_1_1_memory_resource.html", [ + [ "flow::ArenaMemoryResource", "classflow_1_1_arena_memory_resource.html", null ], + [ "flow::DefaultMemoryResource", "classflow_1_1_default_memory_resource.html", null ], + [ "flow::PoolMemoryResource", "classflow_1_1_pool_memory_resource.html", null ], + [ "flow::StackMemoryResource", "classflow_1_1_stack_memory_resource.html", null ] + ] ], + [ "flow::ConcurrentFlexQueue< T >::Node", "structflow_1_1_concurrent_flex_queue_1_1_node.html", null ], + [ "flow::PolymorphicAllocator< T >", "classflow_1_1_polymorphic_allocator.html", null ], + [ "flow::Timer< ClockType >", "classflow_1_1_timer.html", null ], + [ "flow::Tuple< Ts >", "classflow_1_1_tuple.html", null ], + [ "flow::Tuple< Ts... >", "classflow_1_1_tuple.html", [ + [ "flow::Tuple< T, Ts... >", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html", null ] + ] ], + [ "flow::Vector< T, Allocator, Strategy >", "classflow_1_1_vector.html", null ], + [ "flow::VectorGrowthStrategy", "structflow_1_1_vector_growth_strategy.html", null ] +]; \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..b5663f7 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,106 @@ + + + + + + + +Flow: Main Page + + + + + + + + + + + + + + +
+
+ + + + + + +
+
Flow +
+
Documentation for the Flow C++ Library
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Flow Documentation
+
+
+ +
+
+
+ + + + diff --git a/docs/jquery.js b/docs/jquery.js new file mode 100644 index 0000000..875ada7 --- /dev/null +++ b/docs/jquery.js @@ -0,0 +1,204 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e} +var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp( +"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType +}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c +)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){ +return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll( +":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id") +)&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push( +"\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test( +a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null, +null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne +).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for( +var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n; +return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0, +r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r] +,C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each( +function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r, +"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})} +),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each( +"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t +){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t +]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i}, +getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within, +s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})), +this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t +).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split( +","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add( +this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{ +width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(), +!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){ +this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height +,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e, +i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left +)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e +){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0), +i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth( +)-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e, +function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0 +]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){ +targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se", +"n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if( +session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)} +closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if( +session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE, +function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset); +tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList, +finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight())); +return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")} +function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(), +elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight, +viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b, +"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); +/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)), +mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend( +$.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy( +this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData( +"smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id" +).indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?( +this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for( +var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){ +return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if(( +!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&( +this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0 +]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass( +"highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){ +t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]" +)||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){ +t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"), +a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i, +downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2) +)&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t +)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0), +canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}}, +rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})} +return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1, +bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); diff --git a/docs/menu.js b/docs/menu.js new file mode 100644 index 0000000..15f9c52 --- /dev/null +++ b/docs/menu.js @@ -0,0 +1,131 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { + function makeTree(data,relPath) { + let result=''; + if ('children' in data) { + result+='
    '; + for (let i in data.children) { + let url; + const link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ + data.children[i].text+''+ + makeTree(data.children[i],relPath)+'
  • '; + } + result+='
'; + } + return result; + } + let searchBoxHtml; + if (searchEnabled) { + if (serverSide) { + searchBoxHtml='
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + searchBoxHtml='
'+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
'; + } + } + + $('#main-nav').before('
'+ + ''+ + ''+ + '
'); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + $('#main-menu').append('
  • '); + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; + if ($mainMenuState.length) { + const initResizableIfExists = function() { + if (typeof initResizable==='function') initResizable(treeview); + } + // animate mobile menu + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = () => $menu.css('display', 'block'); + $menu.hide().slideDown(options); + } else { + options['complete'] = () => $menu.css('display', 'none'); + $menu.show().slideUp(options); + } + }); + // set default menu visibility + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/docs/menudata.js b/docs/menudata.js new file mode 100644 index 0000000..45cc1b5 --- /dev/null +++ b/docs/menudata.js @@ -0,0 +1,99 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Namespaces",url:"namespaces.html",children:[ +{text:"Namespace List",url:"namespaces.html"}, +{text:"Namespace Members",url:"namespacemembers.html",children:[ +{text:"All",url:"namespacemembers.html"}, +{text:"Functions",url:"namespacemembers_func.html"}]}]}, +{text:"Concepts",url:"concepts.html"}, +{text:"Classes",url:"annotated.html",children:[ +{text:"Class List",url:"annotated.html"}, +{text:"Class Index",url:"classes.html"}, +{text:"Class Hierarchy",url:"hierarchy.html"}, +{text:"Class Members",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"a",url:"functions.html#index_a"}, +{text:"b",url:"functions.html#index_b"}, +{text:"c",url:"functions.html#index_c"}, +{text:"d",url:"functions.html#index_d"}, +{text:"e",url:"functions.html#index_e"}, +{text:"f",url:"functions.html#index_f"}, +{text:"g",url:"functions.html#index_g"}, +{text:"h",url:"functions.html#index_h"}, +{text:"i",url:"functions.html#index_i"}, +{text:"m",url:"functions.html#index_m"}, +{text:"n",url:"functions.html#index_n"}, +{text:"o",url:"functions.html#index_o"}, +{text:"p",url:"functions.html#index_p"}, +{text:"q",url:"functions.html#index_q"}, +{text:"r",url:"functions.html#index_r"}, +{text:"s",url:"functions.html#index_s"}, +{text:"t",url:"functions.html#index_t"}, +{text:"u",url:"functions.html#index_u"}, +{text:"v",url:"functions.html#index_v"}, +{text:"w",url:"functions.html#index_w"}, +{text:"~",url:"functions.html#index__7E"}]}, +{text:"Functions",url:"functions_func.html",children:[ +{text:"a",url:"functions_func.html#index_a"}, +{text:"b",url:"functions_func.html#index_b"}, +{text:"c",url:"functions_func.html#index_c"}, +{text:"d",url:"functions_func.html#index_d"}, +{text:"e",url:"functions_func.html#index_e"}, +{text:"f",url:"functions_func.html#index_f"}, +{text:"g",url:"functions_func.html#index_g"}, +{text:"i",url:"functions_func.html#index_i"}, +{text:"o",url:"functions_func.html#index_o"}, +{text:"p",url:"functions_func.html#index_p"}, +{text:"r",url:"functions_func.html#index_r"}, +{text:"s",url:"functions_func.html#index_s"}, +{text:"t",url:"functions_func.html#index_t"}, +{text:"u",url:"functions_func.html#index_u"}, +{text:"v",url:"functions_func.html#index_v"}, +{text:"w",url:"functions_func.html#index_w"}, +{text:"~",url:"functions_func.html#index__7E"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"a",url:"functions_vars.html#index_a"}, +{text:"b",url:"functions_vars.html#index_b"}, +{text:"c",url:"functions_vars.html#index_c"}, +{text:"g",url:"functions_vars.html#index_g"}, +{text:"h",url:"functions_vars.html#index_h"}, +{text:"i",url:"functions_vars.html#index_i"}, +{text:"m",url:"functions_vars.html#index_m"}, +{text:"n",url:"functions_vars.html#index_n"}, +{text:"o",url:"functions_vars.html#index_o"}, +{text:"q",url:"functions_vars.html#index_q"}, +{text:"r",url:"functions_vars.html#index_r"}, +{text:"s",url:"functions_vars.html#index_s"}, +{text:"t",url:"functions_vars.html#index_t"}, +{text:"v",url:"functions_vars.html#index_v"}]}, +{text:"Typedefs",url:"functions_type.html"}, +{text:"Related Symbols",url:"functions_rela.html"}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"File Members",url:"globals.html",children:[ +{text:"All",url:"globals.html"}, +{text:"Functions",url:"globals_func.html"}]}]}]} diff --git a/docs/namespaceflow.html b/docs/namespaceflow.html new file mode 100644 index 0000000..b94dc34 --- /dev/null +++ b/docs/namespaceflow.html @@ -0,0 +1,1168 @@ + + + + + + + +Flow: flow Namespace Reference + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Flow +
    +
    Documentation for the Flow C++ Library
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    flow Namespace Reference
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Classes

    class  ArenaMemoryResource
     A linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space for the requested allocation. More...
    class  ConcurrentFlexQueue
    class  ConcurrentQueue
    class  CountedValueViewIterator
     Iterator that returns a constant value for a fixed number of times. Useful for creating a virtual range of repeated values without storage. More...
    class  DebugClass
     Debug class that tracks object's copy/move opeartions. Note that some of the operations may get optimized away with optimization on. More...
    class  DefaultMemoryResource
     A default memory resource that wraps global ::operator new and ::operator delete. More...
    class  MemoryResource
     A memory resource holder interface for the PolymorphicAllocator. Responsible for allocate and deallocate raw memory. More...
    class  PolymorphicAllocator
     A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by memory resource's implementation. More...
    class  PoolMemoryResource
     A pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. The allocation size must be less or equal to the block size. The allocation alignment must be less or equal to the block alignment. Throws std::bad_alloc if the constraint is not met or run out of memory. More...
    class  StackMemoryResource
     A stack-based memory resource that allocates memory in a LIFO order from a fixed buffer. Deallocation must happen in reverse order of allocation. Throws std::bad_alloc if there is insufficient space for an allocation. More...
    class  Timer
     A simple timer to record timelapses. Uses chrono::steady_clock by default. More...
    class  Tuple
    class  Tuple< T, Ts... >
    class  Vector
    struct  VectorGrowthStrategy
    + + +

    +Concepts

    concept  GrowthStrategy
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    void enableMemoryGuard ()
     Enable MSVC native memory leak checker in debug mode. Not compatible with the address sanitizer.
    template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    OutputIt uninitializedForward (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
     Forward elements from a source range to uninitialized memory.
    template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    OutputIt uninitializedMove (AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest) noexcept
     Moves elements from a source range to uninitialized memory.
    template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
    OutputIt uninitializedEmplace (AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
     Constructs objects in uninitialized memory by copying arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.
    template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
    OutputIt uninitializedFill (AllocatorType &allocator, OutputIt first, OutputIt last, const T &value)
     Fills uninitialized memory with copies of a value.
    template<typename AllocatorType, std::forward_iterator InputIt>
    void destroyElements (AllocatorType &allocator, InputIt first, InputIt last) noexcept
     Destroys a range of constructed objects in memory.
    template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    OutputIt uninitializedForwardN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
     Forward count elements from a source range to uninitialized memory.
    template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    OutputIt uninitializedMoveN (AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest) noexcept
     Moves count elements from a source range to uninitialized memory.
    template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
    OutputIt uninitializedEmplaceN (AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
     Constructs a specified number of objects in uninitialized memory by forwarding arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.
    template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
    OutputIt uninitializedFillN (AllocatorType &allocator, OutputIt first, std::size_t count, const T &value)
     Fills count elements in uninitialized memory with a value.
    template<typename AllocatorType, std::forward_iterator InputIt>
    void destroyElementsN (AllocatorType &allocator, InputIt first, std::size_t count) noexcept
     Destroys count objects in a range.
    template<typename AllocatorType, typename T>
    void deleteBuffer (AllocatorType &allocator, T *buffer, std::size_t size, std::size_t capacity) noexcept
     Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is the buffer capacity.
    template<typename T, typename U>
    std::size_t pointerDistance (const T *first, const U *last)
     Calculate the distance from the first pointer to the last pointer in bytes.
    template<typename Header>
    Header * alignWithHeader (std::size_t alignment, std::size_t size, void *&buffer, std::size_t &capacity) noexcept
     Align the header + buffer to their corresponding alignments. If the capacity is not big enough to accommodate, then return nullptr. This function is similar to std::align, but it also aligns a header in the front.
    template<typename T>
    +requires std::integral<T> || std::floating_point<T>
    getRandomNumber (T lower, T upper)
     Produces a random number uniformly distributed on the closed interval [lower, upper].
    template<std::random_access_iterator It>
    void shuffle (It begin, It end)
     Randomly shuffle the elements in the range [begin, end).
    template<typename T, typename ... Ts>
     Tuple (T &&, Ts &&...) -> Tuple< T, Ts... >
    +

    Function Documentation

    + +

    ◆ alignWithHeader()

    + +
    +
    +
    +template<typename Header>
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    Header * flow::alignWithHeader (std::size_t alignment,
    std::size_t size,
    void *& buffer,
    std::size_t & capacity )
    +
    +noexcept
    +
    + +

    Align the header + buffer to their corresponding alignments. If the capacity is not big enough to accommodate, then return nullptr. This function is similar to std::align, but it also aligns a header in the front.

    +
    Template Parameters
    + + +
    Header
    +
    +
    +
    Parameters
    + + + + + +
    alignment
    size
    buffer
    capacity
    +
    +
    +
    Returns
    Aligned header pointer followed by the aligned buffer.
    + +

    Definition at line 220 of file flow_memory_algorithm.h.

    +
    220 {
    +
    221
    +
    222 // https://stackoverflow.com/questions/46457449/is-it-always-the-case-that-sizeoft-alignoft-for-all-object-types-t
    +
    223 assert(size >= alignment && "size is smaller than its alignment");
    +
    224 if (capacity < sizeof(Header) + size) {
    +
    225 return nullptr;
    +
    226 }
    +
    227
    +
    228 // Set the block alignment to be at least as big as the header alignment.
    +
    229 // If the allocated block is aligned, then its header is aligned.
    +
    230 alignment = std::max(alignment, alignof(Header));
    +
    231
    +
    232 // Reserve at least sizeof(Header) before the allocated block.
    +
    233 void* allocatedBlock = reinterpret_cast<Header*>(buffer) + 1;
    +
    234 std::size_t capacityAfterHeader = capacity - sizeof(Header);
    +
    235 if (!std::align(alignment, size, allocatedBlock, capacityAfterHeader)) {
    +
    236 return nullptr;
    +
    237 }
    +
    238
    +
    239 // Calculate the address of the header.
    +
    240 Header* header = reinterpret_cast<Header*>(allocatedBlock) - 1;
    +
    241 assert(reinterpret_cast<std::uintptr_t>(header) % alignof(Header) == 0 && "allocated buffer is not aligned with the header");
    +
    242
    +
    243 capacity -= pointerDistance(buffer, header);
    +
    244 buffer = header;
    +
    245 return header;
    +
    246 }
    +
    std::size_t pointerDistance(const T *first, const U *last)
    Calculate the distance from the first pointer to the last pointer in bytes.
    +
    +

    References pointerDistance().

    + +

    Referenced by flow::StackMemoryResource::allocateImp(), and flow::PoolMemoryResource::PoolMemoryResource().

    + +
    +
    + +

    ◆ deleteBuffer()

    + +
    +
    +
    +template<typename AllocatorType, typename T>
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    void flow::deleteBuffer (AllocatorType & allocator,
    T * buffer,
    std::size_t size,
    std::size_t capacity )
    +
    +noexcept
    +
    + +

    Destroys and deallocates the buffer, where size is the number of constructed elements and capacity is the buffer capacity.

    +
    Template Parameters
    + + + +
    AllocatorTypeAllocator type.
    TType of buffer elements.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for destruction and deallocation.
    bufferPointer to the buffer.
    sizeNumber of constructed elements.
    capacityTotal buffer capacity.
    +
    +
    + +

    Definition at line 191 of file flow_memory_algorithm.h.

    +
    191 {
    +
    192 destroyElementsN(allocator, buffer, size);
    +
    193 std::allocator_traits<AllocatorType>::deallocate(allocator, buffer, capacity);
    +
    194 }
    +
    void destroyElementsN(AllocatorType &allocator, InputIt first, std::size_t count) noexcept
    Destroys count objects in a range.
    +
    +

    References destroyElementsN().

    + +

    Referenced by flow::Vector< T, Allocator, Strategy >::updateBuffer(), and flow::Vector< T, Allocator, Strategy >::~Vector().

    + +
    +
    + +

    ◆ destroyElements()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator InputIt>
    + + + + + +
    + + + + + + + + + + + + + + + + +
    void flow::destroyElements (AllocatorType & allocator,
    InputIt first,
    InputIt last )
    +
    +noexcept
    +
    + +

    Destroys a range of constructed objects in memory.

    +
    Template Parameters
    + + + +
    AllocatorTypeAllocator type.
    InputItForward iterator for range.
    +
    +
    +
    Parameters
    + + + + +
    allocatorAllocator for destruction.
    firstStart of range.
    lastEnd of range.
    +
    +
    + +

    Definition at line 88 of file flow_memory_algorithm.h.

    +
    88 {
    +
    89 for (; first != last; ++first) {
    +
    90 std::allocator_traits<AllocatorType>::destroy(allocator, std::addressof(*first));
    +
    91 }
    +
    92 }
    +
    +

    Referenced by flow::Vector< T, Allocator, Strategy >::erase(), and flow::Vector< T, Allocator, Strategy >::resizeImp().

    + +
    +
    + +

    ◆ destroyElementsN()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator InputIt>
    + + + + + +
    + + + + + + + + + + + + + + + + +
    void flow::destroyElementsN (AllocatorType & allocator,
    InputIt first,
    std::size_t count )
    +
    +noexcept
    +
    + +

    Destroys count objects in a range.

    +
    Template Parameters
    + + + +
    AllocatorTypeAllocator type.
    InputItForward iterator for range.
    +
    +
    +
    Parameters
    + + + + +
    allocatorAllocator for destruction.
    firstStart of range.
    countNumber of elements to destroy.
    +
    +
    + +

    Definition at line 174 of file flow_memory_algorithm.h.

    +
    174 {
    +
    175 for (std::size_t i = 0; i < count; ++i, ++first) {
    +
    176 std::allocator_traits<AllocatorType>::destroy(allocator, std::addressof(*first));
    +
    177 }
    +
    178 }
    +
    +

    Referenced by flow::Vector< T, Allocator, Strategy >::clear(), and deleteBuffer().

    + +
    +
    + +

    ◆ enableMemoryGuard()

    + +
    +
    + + + + + +
    + + + + + + + +
    void flow::enableMemoryGuard ()
    +
    +inline
    +
    + +

    Enable MSVC native memory leak checker in debug mode. Not compatible with the address sanitizer.

    + +

    Definition at line 17 of file flow_debug_memory.h.

    +
    17 {
    +
    18 #ifdef _CRTDBG_MAP_ALLOC
    +
    19 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
    +
    20 #endif
    +
    21 }
    +
    +
    +
    + +

    ◆ getRandomNumber()

    + +
    +
    +
    +template<typename T>
    +requires std::integral<T> || std::floating_point<T>
    + + + + + + + + + + + +
    T flow::getRandomNumber (T lower,
    T upper )
    +
    + +

    Produces a random number uniformly distributed on the closed interval [lower, upper].

    +
    Returns
    A random number in the closed interval.
    + +

    Definition at line 14 of file flow_random_algorithm.h.

    +
    14 {
    +
    15 static std::random_device device{};
    +
    16 static std::mt19937_64 engine(device());
    +
    17 if constexpr (std::integral<T>) {
    +
    18 return std::uniform_int_distribution<T>(lower, upper)(engine);
    +
    19 } else {
    +
    20 return std::uniform_real_distribution<T>(lower, upper)(engine);
    +
    21 }
    +
    22 }
    +
    +
    +
    + +

    ◆ pointerDistance()

    + +
    +
    +
    +template<typename T, typename U>
    + + + + + + + + + + + +
    std::size_t flow::pointerDistance (const T * first,
    const U * last )
    +
    + +

    Calculate the distance from the first pointer to the last pointer in bytes.

    +
    Parameters
    + + + +
    first
    last
    +
    +
    +
    Returns
    The address distance in bytes.
    + +

    Definition at line 203 of file flow_memory_algorithm.h.

    +
    203 {
    +
    204 assert(first <= last && "first pointer address must be smaller than the last pointer address");
    +
    205 return reinterpret_cast<const std::byte*>(last) - reinterpret_cast<const std::byte*>(first);
    +
    206 }
    +
    +

    Referenced by alignWithHeader(), and flow::StackMemoryResource::deallocateImp().

    + +
    +
    + +

    ◆ shuffle()

    + +
    +
    +
    +template<std::random_access_iterator It>
    + + + + + + + + + + + +
    void flow::shuffle (It begin,
    It end )
    +
    + +

    Randomly shuffle the elements in the range [begin, end).

    + +

    Definition at line 28 of file flow_random_algorithm.h.

    +
    28 {
    +
    29 static std::random_device device{};
    +
    30 static std::mt19937_64 engine(device());
    +
    31 std::shuffle(begin, end, engine);
    +
    32 }
    +
    +
    +
    + +

    ◆ Tuple()

    + +
    +
    +
    +template<typename T, typename ... Ts>
    + + + + + + + + + + + +
    flow::Tuple (T && ,
    Ts && ... ) -> Tuple< T, Ts... >
    +
    + +
    +
    + +

    ◆ uninitializedEmplace()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedEmplace (AllocatorType & allocator,
    OutputIt first,
    OutputIt last,
    const Args &... args )
    +
    + +

    Constructs objects in uninitialized memory by copying arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type for memory management.
    OutputItForward iterator for the destination range.
    ArgsTypes of arguments copied to the constructor.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for memory management.
    firstStart of the destination range.
    lastEnd of the destination range.
    argsConstructor arguments.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 56 of file flow_memory_algorithm.h.

    +
    56 {
    +
    57 for (; first != last; ++first) {
    +
    58 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*first), args...);
    +
    59 }
    +
    60 return first;
    +
    61 }
    +
    +

    Referenced by flow::Vector< T, Allocator, Strategy >::resizeImp(), and uninitializedFill().

    + +
    +
    + +

    ◆ uninitializedEmplaceN()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator OutputIt, typename ... Args>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedEmplaceN (AllocatorType & allocator,
    OutputIt first,
    std::size_t count,
    const Args &... args )
    +
    + +

    Constructs a specified number of objects in uninitialized memory by forwarding arguments to their constructor. Is is intentional that the arguments are copied instead of forwarded to prevent reuse moved objects.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type for memory management.
    OutputItForward iterator for the destination range.
    ArgsTypes of arguments copied to the constructor.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for memory management.
    firstStart of the destination range.
    countNumber of objects to construct.
    argsConstructor arguments.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 142 of file flow_memory_algorithm.h.

    +
    142 {
    +
    143 for (std::size_t i = 0; i < count; ++i, ++first) {
    +
    144 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*first), args...);
    +
    145 }
    +
    146 return first;
    +
    147 }
    +
    +

    Referenced by uninitializedFillN().

    + +
    +
    + +

    ◆ uninitializedFill()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedFill (AllocatorType & allocator,
    OutputIt first,
    OutputIt last,
    const T & value )
    +
    + +

    Fills uninitialized memory with copies of a value.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    OutputItForward iterator for destination range.
    TType of value.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of destination range.
    lastEnd of destination range.
    valueValue to fill with.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 75 of file flow_memory_algorithm.h.

    +
    75 {
    +
    76 return uninitializedEmplace(allocator, first, last, value);
    +
    77 }
    +
    OutputIt uninitializedEmplace(AllocatorType &allocator, OutputIt first, OutputIt last, const Args &... args)
    Constructs objects in uninitialized memory by copying arguments to their constructor....
    +
    +

    References uninitializedEmplace().

    + +
    +
    + +

    ◆ uninitializedFillN()

    + +
    +
    +
    +template<typename AllocatorType, std::forward_iterator OutputIt, typename T>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedFillN (AllocatorType & allocator,
    OutputIt first,
    std::size_t count,
    const T & value )
    +
    + +

    Fills count elements in uninitialized memory with a value.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    OutputItForward iterator for destination range.
    TType of value.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of destination range.
    countNumber of elements to fill.
    valueValue to fill with.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 161 of file flow_memory_algorithm.h.

    +
    161 {
    +
    162 return uninitializedEmplaceN(allocator, first, count, value);
    +
    163 }
    +
    OutputIt uninitializedEmplaceN(AllocatorType &allocator, OutputIt first, std::size_t count, const Args &... args)
    Constructs a specified number of objects in uninitialized memory by forwarding arguments to their con...
    +
    +

    References uninitializedEmplaceN().

    + +
    +
    + +

    ◆ uninitializedForward()

    + +
    +
    +
    +template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedForward (AllocatorType & allocator,
    InputIt first,
    InputIt last,
    OutputIt dest )
    +
    + +

    Forward elements from a source range to uninitialized memory.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    InputItInput iterator for source range.
    OutputItForward iterator for destination range.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of source range.
    lastEnd of source range.
    destStart of destination range.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 20 of file flow_memory_algorithm.h.

    +
    20 {
    +
    21 for (; first != last; ++first, ++dest) {
    +
    22 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*dest), *first);
    +
    23 }
    +
    24 return dest;
    +
    25 }
    +
    +

    Referenced by flow::Vector< T, Allocator, Strategy >::insert(), uninitializedMove(), and flow::Vector< T, Allocator, Strategy >::Vector().

    + +
    +
    + +

    ◆ uninitializedForwardN()

    + +
    +
    +
    +template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedForwardN (AllocatorType & allocator,
    InputIt first,
    std::size_t count,
    OutputIt dest )
    +
    + +

    Forward count elements from a source range to uninitialized memory.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    InputItInput iterator for source range.
    OutputItForward iterator for destination range.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of source range.
    countNumber of elements to copy.
    destStart of destination range.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 106 of file flow_memory_algorithm.h.

    +
    106 {
    +
    107 for (std::size_t i = 0; i < count; ++i, ++first, ++dest) {
    +
    108 std::allocator_traits<AllocatorType>::construct(allocator, std::addressof(*dest), *first);
    +
    109 }
    +
    110 return dest;
    +
    111 }
    +
    +

    Referenced by flow::Vector< T, Allocator, Strategy >::insert(), and uninitializedMoveN().

    + +
    +
    + +

    ◆ uninitializedMove()

    + +
    +
    +
    +template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedMove (AllocatorType & allocator,
    InputIt first,
    InputIt last,
    OutputIt dest )
    +
    +noexcept
    +
    + +

    Moves elements from a source range to uninitialized memory.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    InputItInput iterator for source range.
    OutputItForward iterator for destination range.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of source range.
    lastEnd of source range.
    destStart of destination range.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 39 of file flow_memory_algorithm.h.

    +
    39 {
    +
    40 return uninitializedForward(allocator, std::move_iterator(first), std::move_iterator(last), dest);
    +
    41 }
    +
    OutputIt uninitializedForward(AllocatorType &allocator, InputIt first, InputIt last, OutputIt dest)
    Forward elements from a source range to uninitialized memory.
    +
    +

    References uninitializedForward().

    + +

    Referenced by flow::Vector< T, Allocator, Strategy >::insert(), flow::Vector< T, Allocator, Strategy >::relocateBuffer(), and flow::Vector< T, Allocator, Strategy >::relocateBufferWithHoles().

    + +
    +
    + +

    ◆ uninitializedMoveN()

    + +
    +
    +
    +template<typename AllocatorType, std::input_iterator InputIt, std::forward_iterator OutputIt>
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    OutputIt flow::uninitializedMoveN (AllocatorType & allocator,
    InputIt first,
    std::size_t count,
    OutputIt dest )
    +
    +noexcept
    +
    + +

    Moves count elements from a source range to uninitialized memory.

    +
    Template Parameters
    + + + + +
    AllocatorTypeAllocator type.
    InputItInput iterator for source range.
    OutputItForward iterator for destination range.
    +
    +
    +
    Parameters
    + + + + + +
    allocatorAllocator for construction.
    firstStart of source range.
    countNumber of elements to move.
    destStart of destination range.
    +
    +
    +
    Returns
    One past the last constructed element.
    + +

    Definition at line 125 of file flow_memory_algorithm.h.

    +
    125 {
    +
    126 return uninitializedForwardN(allocator, std::move_iterator(first), count, dest);
    +
    127 }
    +
    OutputIt uninitializedForwardN(AllocatorType &allocator, InputIt first, std::size_t count, OutputIt dest)
    Forward count elements from a source range to uninitialized memory.
    +
    +

    References uninitializedForwardN().

    + +
    +
    +
    +
    + +
    + + + + diff --git a/docs/namespaceflow.js b/docs/namespaceflow.js new file mode 100644 index 0000000..9ad9f29 --- /dev/null +++ b/docs/namespaceflow.js @@ -0,0 +1,36 @@ +var namespaceflow = +[ + [ "ArenaMemoryResource", "classflow_1_1_arena_memory_resource.html", "classflow_1_1_arena_memory_resource" ], + [ "ConcurrentFlexQueue", "classflow_1_1_concurrent_flex_queue.html", "classflow_1_1_concurrent_flex_queue" ], + [ "ConcurrentQueue", "classflow_1_1_concurrent_queue.html", "classflow_1_1_concurrent_queue" ], + [ "CountedValueViewIterator", "classflow_1_1_counted_value_view_iterator.html", "classflow_1_1_counted_value_view_iterator" ], + [ "DebugClass", "classflow_1_1_debug_class.html", "classflow_1_1_debug_class" ], + [ "DefaultMemoryResource", "classflow_1_1_default_memory_resource.html", "classflow_1_1_default_memory_resource" ], + [ "MemoryResource", "classflow_1_1_memory_resource.html", "classflow_1_1_memory_resource" ], + [ "PolymorphicAllocator", "classflow_1_1_polymorphic_allocator.html", "classflow_1_1_polymorphic_allocator" ], + [ "PoolMemoryResource", "classflow_1_1_pool_memory_resource.html", "classflow_1_1_pool_memory_resource" ], + [ "StackMemoryResource", "classflow_1_1_stack_memory_resource.html", "classflow_1_1_stack_memory_resource" ], + [ "Timer", "classflow_1_1_timer.html", "classflow_1_1_timer" ], + [ "Tuple", "classflow_1_1_tuple.html", "classflow_1_1_tuple" ], + [ "Tuple< T, Ts... >", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4.html", "classflow_1_1_tuple_3_01_t_00_01_ts_8_8_8_01_4" ], + [ "Vector", "classflow_1_1_vector.html", "classflow_1_1_vector" ], + [ "VectorGrowthStrategy", "structflow_1_1_vector_growth_strategy.html", "structflow_1_1_vector_growth_strategy" ], + [ "GrowthStrategy", "conceptflow_1_1_growth_strategy.html", null ], + [ "alignWithHeader", "namespaceflow.html#ad508020eec40eabb44ecd17a0ea944a1", null ], + [ "deleteBuffer", "namespaceflow.html#a95a53e967634035ab7b02a7a0fd8d41a", null ], + [ "destroyElements", "namespaceflow.html#a0917ae92fc9372994be63e2b07d7da43", null ], + [ "destroyElementsN", "namespaceflow.html#a2097cda5f5388d27f3c92804fdea2917", null ], + [ "enableMemoryGuard", "namespaceflow.html#a66db7e81436bb94ac54e68f4f13be960", null ], + [ "getRandomNumber", "namespaceflow.html#ab90fae79ddd51259bfc55e73b295fcd9", null ], + [ "pointerDistance", "namespaceflow.html#a4cdb6701097d19bfe56dc9b98d0ab18d", null ], + [ "shuffle", "namespaceflow.html#a69464bd65a1f1f8786cf92a34e4d9497", null ], + [ "Tuple", "namespaceflow.html#aaf246f21a7d66e18117ff22ba5c737fd", null ], + [ "uninitializedEmplace", "namespaceflow.html#a003a0f5de60743211f4a12ad692ea545", null ], + [ "uninitializedEmplaceN", "namespaceflow.html#ae91210e00bd937af8781ad61d96bb7af", null ], + [ "uninitializedFill", "namespaceflow.html#ac44af902cb4c10b49fa9f5992daa6c92", null ], + [ "uninitializedFillN", "namespaceflow.html#a5991193d2c2c3220704b7ffe43284798", null ], + [ "uninitializedForward", "namespaceflow.html#a7cbf79d9d81ea0bf923173bf94d18282", null ], + [ "uninitializedForwardN", "namespaceflow.html#a5f5545b19674be10035741dc55ab7805", null ], + [ "uninitializedMove", "namespaceflow.html#a51e3de912b53f5b8d08f6167efae5d43", null ], + [ "uninitializedMoveN", "namespaceflow.html#a1110956ca4c95ee5c42c1e988dab6ecd", null ] +]; \ No newline at end of file diff --git a/docs/namespacemembers.html b/docs/namespacemembers.html new file mode 100644 index 0000000..1092672 --- /dev/null +++ b/docs/namespacemembers.html @@ -0,0 +1,121 @@ + + + + + + + +Flow: Namespace Members + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Flow +
    +
    Documentation for the Flow C++ Library
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
      +
    • alignWithHeader() : flow
    • +
    • deleteBuffer() : flow
    • +
    • destroyElements() : flow
    • +
    • destroyElementsN() : flow
    • +
    • enableMemoryGuard() : flow
    • +
    • getRandomNumber() : flow
    • +
    • pointerDistance() : flow
    • +
    • shuffle() : flow
    • +
    • Tuple() : flow
    • +
    • uninitializedEmplace() : flow
    • +
    • uninitializedEmplaceN() : flow
    • +
    • uninitializedFill() : flow
    • +
    • uninitializedFillN() : flow
    • +
    • uninitializedForward() : flow
    • +
    • uninitializedForwardN() : flow
    • +
    • uninitializedMove() : flow
    • +
    • uninitializedMoveN() : flow
    • +
    +
    +
    +
    + + + + diff --git a/docs/namespacemembers_func.html b/docs/namespacemembers_func.html new file mode 100644 index 0000000..c84b861 --- /dev/null +++ b/docs/namespacemembers_func.html @@ -0,0 +1,121 @@ + + + + + + + +Flow: Namespace Members + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Flow +
    +
    Documentation for the Flow C++ Library
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
      +
    • alignWithHeader() : flow
    • +
    • deleteBuffer() : flow
    • +
    • destroyElements() : flow
    • +
    • destroyElementsN() : flow
    • +
    • enableMemoryGuard() : flow
    • +
    • getRandomNumber() : flow
    • +
    • pointerDistance() : flow
    • +
    • shuffle() : flow
    • +
    • Tuple() : flow
    • +
    • uninitializedEmplace() : flow
    • +
    • uninitializedEmplaceN() : flow
    • +
    • uninitializedFill() : flow
    • +
    • uninitializedFillN() : flow
    • +
    • uninitializedForward() : flow
    • +
    • uninitializedForwardN() : flow
    • +
    • uninitializedMove() : flow
    • +
    • uninitializedMoveN() : flow
    • +
    +
    +
    +
    + + + + diff --git a/docs/namespaces.html b/docs/namespaces.html new file mode 100644 index 0000000..f54c86f --- /dev/null +++ b/docs/namespaces.html @@ -0,0 +1,110 @@ + + + + + + + +Flow: Namespace List + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    Flow +
    +
    Documentation for the Flow C++ Library
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Namespace List
    +
    +
    +
    Here is a list of all namespaces with brief descriptions:
    + + +
     Nflow
    +
    +
    +
    +
    + + + + diff --git a/docs/namespaces_dup.js b/docs/namespaces_dup.js new file mode 100644 index 0000000..2367743 --- /dev/null +++ b/docs/namespaces_dup.js @@ -0,0 +1,4 @@ +var namespaces_dup = +[ + [ "flow", "namespaceflow.html", "namespaceflow" ] +]; \ No newline at end of file diff --git a/docs/navtree.css b/docs/navtree.css new file mode 100644 index 0000000..0ea3a07 --- /dev/null +++ b/docs/navtree.css @@ -0,0 +1,327 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0; + padding:0; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + position: relative; + background-color: var(--nav-menu-active-bg); + border-radius: 0 6px 6px 0; + /*margin-right: 5px;*/ +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px var(--font-family-nav); + line-height: 22px; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:var(--page-link-color); +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin: 0 6px 0 -5px; + padding: 0 0 0 5px; + height: 22px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + transition: opacity 0.5s ease; + background-color: var(--nav-splitbar-bg-color); + opacity:0; + cursor:col-resize; + height:100%; + right:0; + top:0; + width:6px; + position: relative; +} + +.ui-resizable-e:after { + content: ''; + display: block; + top: 50%; + left: 1px; + width: 2px; + height: 15px; + border-left: 1px solid var(--nav-splitbar-handle-color); + border-right: 1px solid var(--nav-splitbar-handle-color); + position: absolute; +} + +.ui-resizable-e:hover { + opacity: 1; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-color: var(--nav-background-color); + -webkit-overflow-scrolling : touch; /* iOS 5+ */ + scrollbar-width: thin; + border-right: 1px solid var(--nav-border-color); + padding-left: 5px; +} + +#nav-sync { + position:absolute; + top:0px; + right:0px; + z-index:1; +} + +#nav-sync img { + opacity:0.3; +} + +div.nav-sync-icon { + position: relative; + width: 24px; + height: 17px; + left: -6px; + top: -1px; + opacity: 0.7; + display: inline-block; + background-color: var(--sync-icon-background-color); + border: 1px solid var(--sync-icon-border-color); + box-sizing: content-box; +} + +div.nav-sync-icon:hover { + background-color: var(--sync-icon-selected-background-color); + opacity: 1.0; +} + +div.nav-sync-icon.active:after { + content: ''; + background-color: var(--sync-icon-background-color); + border-top: 2px solid var(--sync-icon-color); + position: absolute; + width: 16px; + height: 0px; + top: 7px; + left: 4px; +} + +div.nav-sync-icon.active:hover:after { + border-top: 2px solid var(--sync-icon-selected-color); +} + +span.sync-icon-left { + position: absolute; + padding: 0; + margin: 0; + top: 3px; + left: 4px; + display: inline-block; + width: 8px; + height: 8px; + border-left: 2px solid var(--sync-icon-color); + border-top: 2px solid var(--sync-icon-color); + transform: rotate(-45deg); +} + +span.sync-icon-right { + position: absolute; + padding: 0; + margin: 0; + top: 3px; + left: 10px; + display: inline-block; + width: 8px; + height: 8px; + border-right: 2px solid var(--sync-icon-color); + border-bottom: 2px solid var(--sync-icon-color); + transform: rotate(-45deg); +} + +div.nav-sync-icon:hover span.sync-icon-left { + border-left: 2px solid var(--sync-icon-selected-color); + border-top: 2px solid var(--sync-icon-selected-color); +} + +div.nav-sync-icon:hover span.sync-icon-right { + border-right: 2px solid var(--sync-icon-selected-color); + border-bottom: 2px solid var(--sync-icon-selected-color); +} + +#nav-path ul { + border-top: 1px solid var(--nav-breadcrumb-separator-color); +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + +/*---------------------------*/ +#container { + display: grid; + grid-template-columns: auto auto; + overflow: hidden; +} + +#page-nav { + background: var(--nav-background-color); + display: block; + width: 250px; + box-sizing: content-box; + position: relative; + border-left: 1px solid var(--nav-border-color); +} + +#page-nav-tree { + display: inline-block; +} + +#page-nav-resize-handle { + transition: opacity 0.5s ease; + background-color: var(--nav-splitbar-bg-color); + opacity:0; + cursor:col-resize; + height:100%; + right:0; + top:0; + width:6px; + position: relative; + z-index: 1; + user-select: none; +} + +#page-nav-resize-handle:after { + content: ''; + display: block; + top: 50%; + left: 1px; + width: 2px; + height: 15px; + border-left: 1px solid var(--nav-splitbar-handle-color); + border-right: 1px solid var(--nav-splitbar-handle-color); + position: absolute; +} + +#page-nav-resize-handle.dragging, +#page-nav-resize-handle:hover { + opacity: 1; +} + +#page-nav-contents { + padding: 0; + margin: 0; + display: block; + top: 0; + left: 0; + height: 100%; + width: 100%; + position: absolute; + overflow: auto; + scrollbar-width: thin; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +ul.page-outline, +ul.page-outline ul { + text-indent: 0; + list-style: none outside none; + padding: 0 0 0 4px; +} + +ul.page-outline { + margin: 0 4px 4px 6px; +} + +ul.page-outline div.item { + font: 12px var(--font-family-nav); + line-height: 22px; +} + +ul.page-outline li { + white-space: nowrap; +} + +ul.page-outline li.vis { + background-color: var(--nav-breadcrumb-active-bg); +} + +#container.resizing { + cursor: col-resize; + user-select: none; +} diff --git a/docs/navtree.js b/docs/navtree.js new file mode 100644 index 0000000..4fcf6e3 --- /dev/null +++ b/docs/navtree.js @@ -0,0 +1,899 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function initNavTree(toroot,relpath,allMembersFile) { + let navTreeSubIndices = []; + const ARROW_DOWN = ''; + const ARROW_RIGHT = ''; + const NAVPATH_COOKIE_NAME = ''+'navpath'; + const fullSidebar = typeof page_layout!=='undefined' && page_layout==1; + + function getScrollBarWidth () { + let outer = $('
    ').css({visibility: 'hidden', width: 100, overflow: 'scroll', scrollbarWidth: 'thin'}).appendTo('body'); + let widthWithScroll = $('
    ').css({width: '100%'}).appendTo(outer).outerWidth(); + outer.remove(); + return 100 - widthWithScroll; + } + const scrollbarWidth = getScrollBarWidth(); + + function adjustSyncIconPosition() { + if (!fullSidebar) { + const nt = document.getElementById("nav-tree"); + const hasVerticalScrollbar = nt.scrollHeight > nt.clientHeight; + $("#nav-sync").css({right:parseInt(hasVerticalScrollbar?scrollbarWidth:0)}); + } + } + + const getData = function(varName) { + const i = varName.lastIndexOf('/'); + const n = i>=0 ? varName.substring(i+1) : varName; + const e = n.replace(/-/g,'_'); + return window[e]; + } + + const stripPath = function(uri) { + return uri.substring(uri.lastIndexOf('/')+1); + } + + const stripPath2 = function(uri) { + const i = uri.lastIndexOf('/'); + const s = uri.substring(i+1); + const m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; + } + + const hashValue = function() { + return $(location).attr('hash').substring(1).replace(/[^\w-]/g,''); + } + + const hashUrl = function() { + return '#'+hashValue(); + } + + const pathName = function() { + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]/g, ''); + } + + const storeLink = function(link) { + if (!$("#nav-sync").hasClass('sync')) { + Cookie.writeSetting(NAVPATH_COOKIE_NAME,link,0); + } + } + + const deleteLink = function() { + Cookie.eraseSetting(NAVPATH_COOKIE_NAME); + } + + const cachedLink = function() { + return Cookie.readSetting(NAVPATH_COOKIE_NAME,''); + } + + const getScript = function(scriptName,func) { + const head = document.getElementsByTagName("head")[0]; + const script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = function() { func(); adjustSyncIconPosition(); } + script.src = scriptName+'.js'; + head.appendChild(script); + } + + const createIndent = function(o,domNode,node) { + let level=-1; + let n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + const imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=ARROW_RIGHT; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast",adjustSyncIconPosition); + $(node.plus_img.childNodes[0]).removeClass('opened').addClass('closed'); + node.expanded = false; + } else { + expandNode(o, node, false, true); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + let span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } + } + + let animationInProgress = false; + + const gotoAnchor = function(anchor,aname) { + let pos, docContent = $('#doc-content'); + let ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || ancParent.hasClass('fieldtype') || + ancParent.is(':header')) { + pos = ancParent.offset().top; + } else if (anchor.position()) { + pos = anchor.offset().top; + } + if (pos) { + const dcOffset = docContent.offset().top; + const dcHeight = docContent.height(); + const dcScrHeight = docContent[0].scrollHeight + const dcScrTop = docContent.scrollTop(); + let dist = Math.abs(Math.min(pos-dcOffset,dcScrHeight-dcHeight-dcScrTop)); + animationInProgress = true; + docContent.animate({ + scrollTop: pos + dcScrTop - dcOffset + },Math.max(50,Math.min(500,dist)),function() { + animationInProgress=false; + if (anchor.parent().attr('class')=='memItemLeft') { + let rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname') { + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype') { + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } + }); + } + } + + function htmlToNode(html) { + const template = document.createElement('template'); + template.innerHTML = html; + const nNodes = template.content.childNodes.length; + if (nNodes !== 1) { + throw new Error(`html parameter must represent a single node; got ${nNodes}. `); + } + return template.content.firstChild; + } + + const newNode = function(o, po, text, link, childrenData, lastNode) { + const node = { + children : [], + childrenData : childrenData, + depth : po.depth + 1, + relpath : po.relpath, + isLast : lastNode, + li : document.createElement("li"), + parentNode : po, + itemDiv : document.createElement("div"), + labelSpan : document.createElement("span"), + expanded : false, + childrenUL : null, + getChildrenUL : function() { + if (!this.childrenUL) { + this.childrenUL = document.createElement("ul"); + this.childrenUL.className = "children_ul"; + this.childrenUL.style.display = "none"; + this.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }, + }; + + node.itemDiv.className = "item"; + node.labelSpan.className = "label"; + createIndent(o,node.itemDiv,node); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + const a = document.createElement("a"); + node.labelSpan.appendChild(a); + po.getChildrenUL().appendChild(node.li); + a.appendChild(htmlToNode(''+text+'')); + if (link) { + let url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + const aname = '#'+link.split('#')[1]; + const srcPage = stripPath(pathName()); + const targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : aname; + a.onclick = function() { + storeLink(link); + aPPar = $(a).parent().parent(); + if (!aPPar.hasClass('selected')) { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + aPPar.addClass('selected'); + aPPar.attr('id','selected'); + } + const anchor = $(aname); + gotoAnchor(anchor,aname); + }; + } else { + a.href = url; + a.onclick = () => storeLink(link); + } + } else if (childrenData != null) { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + return node; + } + + const showRoot = function() { + const headerHeight = $("#top").height(); + const footerHeight = $("#nav-path").height(); + const windowHeight = $(window).height() - headerHeight - footerHeight; + (function() { // retry until we can scroll to the selected item + try { + const navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); + } + + const expandNode = function(o, node, imm, setFocus) { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast",adjustSyncIconPosition); + $(node.plus_img.childNodes[0]).addClass('opened').removeClass('closed'); + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } + } + } + } + + const glowEffect = function(n,duration) { + n.addClass('glow').delay(duration).queue(function(next) { + $(this).removeClass('glow');next(); + }); + } + + const highlightAnchor = function() { + const aname = hashUrl(); + const anchor = $(aname); + gotoAnchor(anchor,aname); + } + + const selectAndHighlight = function(hash,n) { + let a; + if (hash) { + const link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + let topOffset=5; + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + showRoot(); + } + + const showNode = function(o, node, index, hash) { + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + showNode(o,node,index,hash); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + $(node.plus_img.childNodes[0]).removeClass('closed').addClass('opened'); + node.expanded = true; + const n = node.children[o.breadcrumbs[index]]; + if (index+10) { // try root page without hash as fallback + gotoUrl(o,root,'',relpath); + } else { + o.breadcrumbs = $.extend(true, [], nti); + if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index + navTo(o,NAVTREE[0][1],"",relpath); + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + } + if (o.breadcrumbs) { + o.breadcrumbs.unshift(0); // add 0 for root node + showNode(o, o.node, 0, hash); + } + } + } + + const gotoUrl = function(o,root,hash,relpath) { + const url=root+hash; + let i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function() { + navTreeSubIndices[i] = window['NAVTREEINDEX'+i]; + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } + } + + const navTo = function(o,root,hash,relpath) { + const link = cachedLink(); + if (link) { + const parts = link.split('#'); + root = parts[0]; + hash = parts.length>1 ? '#'+parts[1].replace(/[^\w-]/g,'') : ''; + } + if (hash.match(/^#l\d+$/)) { + const anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + gotoUrl(o,root,hash,relpath); + } + + const showSyncOff = function(n,relpath) { + n.html(''); + } + + const showSyncOn = function(n,relpath) { + n.html(''); + } + + const o = { + toroot : toroot, + node : { + childrenData : NAVTREE, + children : [], + childrenUL : document.createElement("ul"), + getChildrenUL : function() { return this.childrenUL }, + li : document.getElementById("nav-tree-contents"), + depth : 0, + relpath : relpath, + expanded : false, + isLast : true, + plus_img : document.createElement("span"), + }, + }; + o.node.li.appendChild(o.node.childrenUL); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = ARROW_RIGHT; + + const navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + + navSync.click(() => { + const navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } + }); + + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + + $(window).bind('hashchange', () => { + if (!animationInProgress) { + if (window.location.hash && window.location.hash.length>1) { + let a; + if ($(location).attr('hash')) { + const clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ try to keep right panel width + const shrinkLeft = Math.min(deficit, leftPanelWidth-minPanelWidth); + leftPanelWidth -= shrinkLeft; + const remainingDeficit = deficit - shrinkLeft; + const shrinkRight = Math.min(remainingDeficit, rightPanelWidth-minPanelWidth); + rightPanelWidth -= shrinkRight; + } else { // dragging right handle -> try to keep left panel width + const shrinkRight = Math.min(deficit, rightPanelWidth-minPanelWidth); + rightPanelWidth -= shrinkRight; + const remainingDeficit = deficit - shrinkRight; + const shrinkLeft = Math.min(remainingDeficit, leftPanelWidth-minPanelWidth); + leftPanelWidth -= shrinkLeft; + } + } else { + rightPanelWidth = pagenav.length ? Math.max(minPanelWidth,rightPanelWidth) : 0; + leftPanelWidth = Math.max(minPanelWidth,leftPanelWidth); + } + return { leftPanelWidth, rightPanelWidth } + } + + function updateWidths(sidenavWidth,pagenavWidth,dragLeft) + { + const widths = constrainPanelWidths(sidenavWidth,pagenavWidth,dragLeft); + const widthStr = parseInt(widths.leftPanelWidth)+"px"; + content.css({marginLeft:widthStr}); + if (fullSidebar) { + footer.css({marginLeft:widthStr}); + if (mainnav) { + mainnav.css({marginLeft:widthStr}); + } + } + sidenav.css({width:widthStr}); + if (pagenav.length) { + container.css({gridTemplateColumns:'auto '+parseInt(widths.rightPanelWidth)+'px'}); + pagenav.css({width:parseInt(widths.rightPanelWidth-1)+'px'}); + } + return widths; + } + + function resizeWidth(dragLeft) { + const sidenavWidth = $(sidenav).outerWidth()-barWidth; + const pagenavWidth = pagenav.length ? $(pagenav).outerWidth() : 0; + const widths = updateWidths(sidenavWidth,pagenavWidth,dragLeft); + Cookie.writeSetting(RESIZE_COOKIE_NAME,widths.leftPanelWidth-barWidth); + if (pagenav.length) { + Cookie.writeSetting(PAGENAV_COOKIE_NAME,widths.rightPanelWidth); + } + } + + function restoreWidth(sidenavWidth,pagenavWidth) { + updateWidths(sidenavWidth,pagenavWidth,false); + showHideNavBar(); + } + + function resizeHeight() { + const headerHeight = header.outerHeight(); + const windowHeight = $(window).height(); + let contentHeight; + const footerHeight = footer.outerHeight(); + let navtreeHeight,sideNavHeight; + if (!fullSidebar) { + contentHeight = windowHeight - headerHeight - footerHeight - 1; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (fullSidebar) { + contentHeight = windowHeight - footerHeight - 1; + navtreeHeight = windowHeight - headerHeight - 1; + sideNavHeight = windowHeight - 1; + if (mainnav) { + contentHeight -= mainnav.outerHeight(); + } + } + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); + content.css({height:contentHeight + "px"}); + resizeWidth(false); + showHideNavBar(); + if (location.hash.slice(1)) { + (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); + } + } + + header = $("#top"); + content = $("#doc-content"); + footer = $("#nav-path"); + sidenav = $("#side-nav"); + if (document.getElementById('main-nav')) { + mainnav = $("#main-nav"); + } + navtree = $("#nav-tree"); + pagenav = $("#page-nav"); + container = $("#container"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(true); } }); + $(sidenav).resizable({ minWidth: 0 }); + if (pagenav.length) { + pagehandle = $("#page-nav-resize-handle"); + pagehandle.on('mousedown touchstart',function(e) { + $('body').addClass('resizing'); + pagehandle.addClass('dragging'); + $(document).on('mousemove touchmove',function(e) { + const clientX = e.clientX || e.originalEvent.touches[0].clientX; + let pagenavWidth = container[0].offsetWidth-clientX+barWidth/2; + const sidenavWidth = sidenav.width(); + const widths = constrainPanelWidths(sidenavWidth,pagenavWidth,false); + container.css({gridTemplateColumns:'auto '+parseInt(widths.rightPanelWidth)+'px'}); + pagenav.css({width:parseInt(widths.rightPanelWidth-1)+'px'}); + content.css({marginLeft:parseInt(widths.leftPanelWidth)+'px'}); + Cookie.writeSetting(PAGENAV_COOKIE_NAME,pagenavWidth); + }); + $(document).on('mouseup touchend', function(e) { + $('body').removeClass('resizing'); + pagehandle.removeClass('dragging'); + $(document).off('mousemove mouseup touchmove touchend'); + }); + }); + } else { + container.css({gridTemplateColumns:'auto'}); + } + const width = parseInt(Cookie.readSetting(RESIZE_COOKIE_NAME,250)); + const pagenavWidth = parseInt(Cookie.readSetting(PAGENAV_COOKIE_NAME,250)); + if (width) { restoreWidth(width+barWidth,pagenavWidth); } else { resizeWidth(); } + const url = location.href; + const i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + const _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(window).ready(function() { + let lastWidth = -1; + let lastHeight = -1; + $(window).resize(function() { + const newWidth = $(this).width(), newHeight = $(this).height(); + if (newWidth!=lastWidth || newHeight!=lastHeight) { + resizeHeight(); + navtree_trampoline.updateContentTop(); + lastWidth = newWidth; + lastHeight = newHeight; + } + }); + resizeHeight(); + lastWidth = $(window).width(); + lastHeight = $(window).height(); + content.scroll(function() { + navtree_trampoline.updateContentTop(); + }); + }); + } + + + function initPageToc() { + const topMapping = []; + const toc_contents = $('#page-nav-contents'); + const content=$('