Audacity 3.2.0
Public Types | Public Member Functions | Protected Attributes | List of all members
Composite::Base< Component, ComponentPointer, ComponentArgs > Class Template Reference

#include <Composite.h>

Inheritance diagram for Composite::Base< Component, ComponentPointer, ComponentArgs >:
[legend]
Collaboration diagram for Composite::Base< Component, ComponentPointer, ComponentArgs >:
[legend]

Public Types

using value_type = ComponentPointer
 
using Items = std::vector< value_type >
 

Public Member Functions

 Base (ComponentArgs... args)
 
 Base (const Base &)=delete
 
Baseoperator= (const Base &)=delete
 
auto begin () const
 
auto end () const
 
auto cbegin () const
 
auto cend () const
 
auto rbegin () const
 
auto rend () const
 
auto crbegin () const
 
auto crend () const
 
void push_back (value_type ptr)
 
auto size () const noexcept
 
bool empty () const
 

Protected Attributes

Items items
 

Detailed Description

template<typename Component, typename ComponentPointer, typename... ComponentArgs>
class Composite::Base< Component, ComponentPointer, ComponentArgs >

Generates a base class for internal nodes of tree structures, which acts like a standard container (including compatibility with range-for and back_inserter)

Template Parameters
Componentcommon base class of nodes and leaves (and of Base itself), which must have a virtual destructor
ComponentPointertype of pointer to Components to be stored
ComponentArgs...passed to constructor of Component

Definition at line 38 of file Composite.h.

Member Typedef Documentation

◆ Items

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
using Composite::Base< Component, ComponentPointer, ComponentArgs >::Items = std::vector<value_type>

Definition at line 42 of file Composite.h.

◆ value_type

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
using Composite::Base< Component, ComponentPointer, ComponentArgs >::value_type = ComponentPointer

Definition at line 41 of file Composite.h.

Constructor & Destructor Documentation

◆ Base() [1/2]

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
Composite::Base< Component, ComponentPointer, ComponentArgs >::Base ( ComponentArgs...  args)
inlineexplicit

Definition at line 44 of file Composite.h.

45 : Component{ std::forward<ComponentArgs>(args)... }
46 {
47 static_assert(std::has_virtual_destructor_v<Component>);
48 }

References forward.

◆ Base() [2/2]

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
Composite::Base< Component, ComponentPointer, ComponentArgs >::Base ( const Base< Component, ComponentPointer, ComponentArgs > &  )
delete

Member Function Documentation

◆ begin()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::begin ( ) const
inline

Definition at line 53 of file Composite.h.

53{ return items.begin(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ cbegin()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::cbegin ( ) const
inline

Definition at line 55 of file Composite.h.

55{ return items.cbegin(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ cend()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::cend ( ) const
inline

Definition at line 56 of file Composite.h.

56{ return items.cend(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ crbegin()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::crbegin ( ) const
inline

Definition at line 59 of file Composite.h.

59{ return items.crbegin(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ crend()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::crend ( ) const
inline

Definition at line 60 of file Composite.h.

60{ return items.crend(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ empty()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
bool Composite::Base< Component, ComponentPointer, ComponentArgs >::empty ( ) const
inline

Definition at line 65 of file Composite.h.

65{ return items.empty(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ end()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::end ( ) const
inline

Definition at line 54 of file Composite.h.

54{ return items.end(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ operator=()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
Base & Composite::Base< Component, ComponentPointer, ComponentArgs >::operator= ( const Base< Component, ComponentPointer, ComponentArgs > &  )
delete

◆ push_back()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
void Composite::Base< Component, ComponentPointer, ComponentArgs >::push_back ( value_type  ptr)
inline

Definition at line 62 of file Composite.h.

62{ items.push_back(move(ptr)); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

Referenced by Composite::Builder< Base, Derived, BaseArgs >::push_back().

Here is the caller graph for this function:

◆ rbegin()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::rbegin ( ) const
inline

Definition at line 57 of file Composite.h.

57{ return items.rbegin(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ rend()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::rend ( ) const
inline

Definition at line 58 of file Composite.h.

58{ return items.rend(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

◆ size()

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
auto Composite::Base< Component, ComponentPointer, ComponentArgs >::size ( ) const
inlinenoexcept

Definition at line 63 of file Composite.h.

63{ return items.size(); }

References Composite::Base< Component, ComponentPointer, ComponentArgs >::items.

Member Data Documentation

◆ items

template<typename Component , typename ComponentPointer , typename... ComponentArgs>
Items Composite::Base< Component, ComponentPointer, ComponentArgs >::items
protected

The documentation for this class was generated from the following file: