Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::PortSet Class Reference

#include <port_set.h>

Classes

class  audio_iterator
 
class  iterator_base
 

Public Types

typedef iterator_base< PortSet, Portiterator
 
typedef iterator_base< const PortSet, const Portconst_iterator
 

Public Member Functions

 PortSet ()
 
size_t num_ports () const
 
size_t num_ports (DataType type) const
 
void add (std::shared_ptr< Port > port)
 
bool remove (std::shared_ptr< Port > port)
 
std::shared_ptr< Portport (size_t index) const
 
std::shared_ptr< Portport (DataType t, size_t index) const
 
std::shared_ptr< AudioPortnth_audio_port (size_t n) const
 
std::shared_ptr< MidiPortnth_midi_port (size_t n) const
 
bool contains (std::shared_ptr< const Port > port) const
 
void clear ()
 
const ChanCountcount () const
 
bool empty () const
 
iterator begin (DataType type=DataType::NIL)
 
iterator end (DataType type=DataType::NIL)
 
const_iterator begin (DataType type=DataType::NIL) const
 
const_iterator end (DataType type=DataType::NIL) const
 
audio_iterator audio_begin ()
 
audio_iterator audio_end ()
 

Private Types

typedef std::vector< std::shared_ptr< Port > > PortVec
 

Private Attributes

std::vector< PortVec_ports
 
PortVec _all_ports
 
ChanCount _count
 

Detailed Description

An ordered list of Ports, possibly of various types.

This allows access to all the ports as a list, ignoring type, or accessing the nth port of a given type. Note that port(n) and nth_audio_port(n) may NOT return the same port.

Each port is held twice; once in a per-type vector of vectors (_ports) and once in a vector of all port (_all_ports). This is to speed up the fairly common case of iterating over all ports.

Definition at line 41 of file port_set.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 102 of file port_set.h.

◆ iterator

Definition at line 101 of file port_set.h.

◆ PortVec

typedef std::vector<std::shared_ptr<Port> > ARDOUR::PortSet::PortVec
private

Definition at line 143 of file port_set.h.

Constructor & Destructor Documentation

◆ PortSet()

ARDOUR::PortSet::PortSet ( )

Member Function Documentation

◆ add()

void ARDOUR::PortSet::add ( std::shared_ptr< Port port)

◆ audio_begin()

audio_iterator ARDOUR::PortSet::audio_begin ( )
inline

Definition at line 139 of file port_set.h.

◆ audio_end()

audio_iterator ARDOUR::PortSet::audio_end ( )
inline

Definition at line 140 of file port_set.h.

◆ begin() [1/2]

iterator ARDOUR::PortSet::begin ( DataType  type = DataType::NIL)
inline

Definition at line 104 of file port_set.h.

◆ begin() [2/2]

const_iterator ARDOUR::PortSet::begin ( DataType  type = DataType::NIL) const
inline

Definition at line 113 of file port_set.h.

◆ clear()

void ARDOUR::PortSet::clear ( )

Remove all ports from the PortSet. Ports are not deregistered with the engine, it's the caller's responsibility to not leak here!

◆ contains()

bool ARDOUR::PortSet::contains ( std::shared_ptr< const Port port) const

◆ count()

const ChanCount& ARDOUR::PortSet::count ( ) const
inline

Definition at line 73 of file port_set.h.

◆ empty()

bool ARDOUR::PortSet::empty ( ) const
inline

Definition at line 75 of file port_set.h.

◆ end() [1/2]

iterator ARDOUR::PortSet::end ( DataType  type = DataType::NIL)
inline

Definition at line 108 of file port_set.h.

◆ end() [2/2]

const_iterator ARDOUR::PortSet::end ( DataType  type = DataType::NIL) const
inline

Definition at line 117 of file port_set.h.

◆ nth_audio_port()

std::shared_ptr<AudioPort> ARDOUR::PortSet::nth_audio_port ( size_t  n) const

◆ nth_midi_port()

std::shared_ptr<MidiPort> ARDOUR::PortSet::nth_midi_port ( size_t  n) const

◆ num_ports() [1/2]

size_t ARDOUR::PortSet::num_ports ( ) const

◆ num_ports() [2/2]

size_t ARDOUR::PortSet::num_ports ( DataType  type) const
inline

Definition at line 46 of file port_set.h.

◆ port() [1/2]

std::shared_ptr<Port> ARDOUR::PortSet::port ( DataType  t,
size_t  index 
) const

nth port of type t, or nth port if t = NIL

Parameters
tdata type
indexport index

◆ port() [2/2]

std::shared_ptr<Port> ARDOUR::PortSet::port ( size_t  index) const

nth port

Parameters
indexport index

◆ remove()

bool ARDOUR::PortSet::remove ( std::shared_ptr< Port port)

Member Data Documentation

◆ _all_ports

PortVec ARDOUR::PortSet::_all_ports
private

Definition at line 148 of file port_set.h.

◆ _count

ChanCount ARDOUR::PortSet::_count
private

Definition at line 150 of file port_set.h.

◆ _ports

std::vector<PortVec> ARDOUR::PortSet::_ports
private

Definition at line 146 of file port_set.h.


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