ardour
Classes | Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
ARDOUR::PortSet Class Reference

#include <port_set.h>

Inheritance diagram for ARDOUR::PortSet:

Classes

class  audio_iterator
 
class  iterator_base
 

Public Types

typedef iterator_base< PortSet,
Port
iterator
 
typedef iterator_base< const
PortSet, const Port
const_iterator
 

Public Member Functions

 PortSet ()
 
size_t num_ports () const
 
size_t num_ports (DataType type) const
 
void add (boost::shared_ptr< Port > port)
 
bool remove (boost::shared_ptr< Port > port)
 
boost::shared_ptr< Portport (size_t index) const
 
boost::shared_ptr< Portport (DataType t, size_t index) const
 
boost::shared_ptr< AudioPortnth_audio_port (size_t n) const
 
boost::shared_ptr< MidiPortnth_midi_port (size_t n) const
 
bool contains (boost::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
< boost::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 42 of file port_set.h.

Member Typedef Documentation

Definition at line 94 of file port_set.h.

Definition at line 93 of file port_set.h.

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

Definition at line 135 of file port_set.h.

Constructor & Destructor Documentation

ARDOUR::PortSet::PortSet ( )

Definition at line 30 of file port_set.cc.

Member Function Documentation

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

Definition at line 86 of file port_set.cc.

audio_iterator ARDOUR::PortSet::audio_begin ( )
inline

Definition at line 131 of file port_set.h.

audio_iterator ARDOUR::PortSet::audio_end ( )
inline

Definition at line 132 of file port_set.h.

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

Definition at line 96 of file port_set.h.

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

Definition at line 105 of file port_set.h.

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!

Definition at line 168 of file port_set.cc.

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

Definition at line 129 of file port_set.cc.

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

Definition at line 69 of file port_set.h.

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

Definition at line 71 of file port_set.h.

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

Definition at line 100 of file port_set.h.

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

Definition at line 109 of file port_set.h.

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

Definition at line 156 of file port_set.cc.

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

Definition at line 162 of file port_set.cc.

size_t ARDOUR::PortSet::num_ports ( ) const

Get the total number of ports (of all types) in the PortSet

Definition at line 123 of file port_set.cc.

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

Definition at line 47 of file port_set.h.

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

nth port

Definition at line 135 of file port_set.cc.

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

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

Definition at line 142 of file port_set.cc.

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

Definition at line 101 of file port_set.cc.

Member Data Documentation

PortVec ARDOUR::PortSet::_all_ports
private

Definition at line 140 of file port_set.h.

ChanCount ARDOUR::PortSet::_count
private

Definition at line 142 of file port_set.h.

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

Definition at line 138 of file port_set.h.


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