CLAM-Development  1.4.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions
CLAM::Network Class Reference

#include <Network.hxx>

List of all members.

Classes

struct  Connection
struct  Geometry
struct  ProcessingAndGeometry

Public Types

typedef std::list< std::string > NamesList
typedef std::map< std::string,
Processing * > 
ProcessingsMap
typedef std::list< InPortBase * > InPortsList
typedef std::vector< Processing * > Processings
typedef std::vector
< ControlSource * > 
ControlSources
typedef std::vector
< ControlSink * > 
ControlSinks
typedef std::vector
< InformationText * > 
InformationTexts
typedef std::map< std::string,
Geometry
ProcessingsGeometriesMap
typedef std::list< ConnectionConnectionsList
typedef std::set< std::string > NamesSet
typedef std::pair< bool,
std::string > 
ConnectionState
 Has true if ports have the old name AudioIn or AudioOut and which connections are broken.

Public Member Functions

 Network ()
virtual ~Network ()
const std::string & GetName () const
void SetName (const std::string &name)
const TextGetDescription () const
void SetDescription (const Text &description)
virtual const char * GetClassName () const
 Return the class name.
bool IsStopped () const
bool IsPlaying () const
bool IsPaused () const
bool IsRealTime () const
void Start ()
void Stop ()
void Pause ()
void Do ()
void AddFlowControl (FlowControl *)
 Gets the ownership of the FlowControl passed.
void Clear ()
void SetPlayer (NetworkPlayer *player)
 Set the object in charge of managing the processing thread.
unsigned BackendBufferSize ()
unsigned BackendSampleRate ()
virtual void StoreOn (Storage &storage) const
 serialization methods
virtual void LoadFrom (Storage &storage)
 Loads component's subitems from the given Storage.
bool UpdateSelections (const NamesList &processingsNamesList)
 methods related to copy&paste processings from canvas
void setPasteMode ()
bool SetProcessingsGeometries (const ProcessingsGeometriesMap &processingsGeometries)
 canvas related geometries
const ProcessingsGeometriesMap GetAndClearGeometries ()
const Geometry findProcessingGeometry (Processing *) const
 audio sources and sinks and control sources and sinks order
const Processings getOrderedProcessings (const std::string &type, bool horizontalOrder) const
const Processings getOrderedProcessingsByAttribute (const std::string &attribute, bool horizontalOrder=false) const
const ControlSinks getOrderedControlSinks () const
const ControlSources getOrderedControlSources () const
bool ConnectPorts (const std::string &, const std::string &)
 methods related to connect/disconnect interface
bool ConnectControls (const std::string &, const std::string &)
bool DisconnectPorts (const std::string &, const std::string &)
bool DisconnectControls (const std::string &, const std::string &)
ProcessingGetProcessing (const std::string &name) const
 methods used to create processings and get them
void AddProcessing (const std::string &name, Processing *processing, const ProcessingConfig *config=0)
 add method using a pointer to a new processing
ProcessingAddProcessing (const std::string &name, const std::string &key)
 add method using a key to get the new processing from factory
std::string AddProcessing (const std::string &key)
std::string GetUnusedName (const std::string &prefix, const bool cutOnLastSeparator=false, const std::string separator="_") const
void RemoveProcessing (const std::string &)
bool HasProcessing (const std::string &name) const
bool ConfigureProcessing (const std::string &, const ProcessingConfig &)
 It configures the processing with the given processing id and config object and notifies this to the network.
void ReconfigureAllProcessings ()
 Calls Configure() for each processing with its current configuration.
bool RenameProcessing (const std::string &oldName, const std::string &newName)
const std::string & GetNetworkId (const Processing *proc) const
ProcessingsMap::iterator BeginProcessings ()
ProcessingsMap::iterator EndProcessings ()
ProcessingsMap::const_iterator BeginProcessings () const
ProcessingsMap::const_iterator EndProcessings () const
void addInformationText (InformationText *informationText)
void removeInformationText (InformationText *informationText)
InformationTexts::iterator BeginInformationTexts ()
InformationTexts::iterator EndInformationTexts ()
InformationTexts::const_iterator BeginInformationTexts () const
InformationTexts::const_iterator EndInformationTexts () const
InPortBaseGetInPortByCompleteName (const std::string &) const
OutPortBaseGetOutPortByCompleteName (const std::string &) const
InControlBaseGetInControlByCompleteName (const std::string &) const
OutControlBaseGetOutControlByCompleteName (const std::string &) const
NamesList GetInPortsConnectedTo (const std::string &) const
NamesList GetInControlsConnectedTo (const std::string &) const
InPortsList GetInPortsConnectedTo (OutPortBase &) const
std::string GetConnectorIdentifier (const std::string &) const
std::string GetProcessingIdentifier (const std::string &) const
bool IsReady () const
 Tells whether the network is ready to rock.
bool IsEmpty () const
 Returns true when it has no processings.
bool HasMisconfiguredProcessings () const
 Returns true when some processing is misconfigured.
bool HasUnconnectedInPorts () const
 Returns true when a processing has an inport that is not connected.
bool HasSyncSource () const
 Tell whether the network contains any processing which limits the cpu usage such as file or device interfaces.
bool SupportsVariableAudioSize () const
 This method reports whether the network supports dynamic buffer-size host.
std::string GetConfigurationErrors () const
 Returns an string containing configuration errors.
std::string GetUnconnectedInPorts () const
 Returns an string the full name of the unconnected inports.
ConnectionState GetConnectionReport () const
void ResetConnectionReport ()
- Public Member Functions inherited from CLAM::Component
virtual ~Component ()
virtual ComponentShallowCopy () const
virtual ComponentDeepCopy () const

Static Public Member Functions

static const bool compareGeometriesUpperYThan (ProcessingAndGeometry &, ProcessingAndGeometry &)
static const bool compareGeometriesUpperXThan (ProcessingAndGeometry &, ProcessingAndGeometry &)

Static Protected Member Functions

static std::size_t PositionOfLastIdentifier (const std::string &str)
static std::size_t PositionOfProcessingIdentifier (const std::string &str)
static char NamesIdentifiersSeparator ()

Detailed Description

Definition at line 54 of file Network.hxx.


Member Typedef Documentation

Definition at line 73 of file Network.hxx.

typedef std::pair<bool, std::string> CLAM::Network::ConnectionState

Has true if ports have the old name AudioIn or AudioOut and which connections are broken.

Definition at line 226 of file Network.hxx.

Definition at line 65 of file Network.hxx.

Definition at line 64 of file Network.hxx.

Definition at line 67 of file Network.hxx.

typedef std::list<InPortBase *> CLAM::Network::InPortsList

Definition at line 61 of file Network.hxx.

typedef std::list<std::string> CLAM::Network::NamesList

Definition at line 59 of file Network.hxx.

typedef std::set<std::string> CLAM::Network::NamesSet

Definition at line 75 of file Network.hxx.

typedef std::vector<Processing*> CLAM::Network::Processings

Definition at line 63 of file Network.hxx.

typedef std::map<std::string, Geometry> CLAM::Network::ProcessingsGeometriesMap

Definition at line 71 of file Network.hxx.

typedef std::map<std::string, Processing* > CLAM::Network::ProcessingsMap

Definition at line 60 of file Network.hxx.


Constructor & Destructor Documentation

CLAM::Network::Network ( )

Definition at line 46 of file Network.cxx.

CLAM::Network::~Network ( )
virtual

Definition at line 53 of file Network.cxx.

References Clear().


Member Function Documentation

void CLAM::Network::AddFlowControl ( FlowControl flowControl)

Gets the ownership of the FlowControl passed.

So it will be deleted by the destructor

Definition at line 467 of file Network.cxx.

References CLAM::FlowControl::AttachToNetwork().

void CLAM::Network::addInformationText ( InformationText informationText)

Definition at line 807 of file Network.cxx.

void CLAM::Network::AddProcessing ( const std::string &  name,
Processing processing,
const ProcessingConfig config = 0 
)
Processing & CLAM::Network::AddProcessing ( const std::string &  name,
const std::string &  key 
)

add method using a key to get the new processing from factory

Definition at line 512 of file Network.cxx.

References AddProcessing(), CLAM::Factory< AbstractProductType >::CreateSafe(), and CLAM::ProcessingFactory::GetInstance().

std::string CLAM::Network::AddProcessing ( const std::string &  key)

Definition at line 520 of file Network.cxx.

References AddProcessing(), and GetUnusedName().

unsigned CLAM::Network::BackendBufferSize ( )
unsigned CLAM::Network::BackendSampleRate ( )
Network::InformationTexts::iterator CLAM::Network::BeginInformationTexts ( )

Definition at line 822 of file Network.cxx.

Referenced by removeInformationText(), and StoreOn().

Network::InformationTexts::const_iterator CLAM::Network::BeginInformationTexts ( ) const

Definition at line 832 of file Network.cxx.

Network::ProcessingsMap::iterator CLAM::Network::BeginProcessings ( )
Network::ProcessingsMap::const_iterator CLAM::Network::BeginProcessings ( ) const

Definition at line 795 of file Network.cxx.

void CLAM::Network::Clear ( )

Definition at line 770 of file Network.cxx.

References IsStopped(), removeInformationText(), RemoveProcessing(), and Stop().

Referenced by LoadFrom(), and ~Network().

const bool CLAM::Network::compareGeometriesUpperXThan ( ProcessingAndGeometry arg1,
ProcessingAndGeometry arg2 
)
static
const bool CLAM::Network::compareGeometriesUpperYThan ( ProcessingAndGeometry arg1,
ProcessingAndGeometry arg2 
)
static
bool CLAM::Network::ConfigureProcessing ( const std::string &  name,
const ProcessingConfig newConfig 
)

It configures the processing with the given processing id and config object and notifies this to the network.

So use this method instead of getting the processing with GetProcessing and calling Configure on it.

Definition at line 575 of file Network.cxx.

References CLAM_ASSERT, IsStopped(), CLAM::FlowControl::ProcessingConfigured(), and Stop().

bool CLAM::Network::ConnectControls ( const std::string &  producer,
const std::string &  consumer 
)
bool CLAM::Network::ConnectPorts ( const std::string &  producer,
const std::string &  consumer 
)
bool CLAM::Network::DisconnectControls ( const std::string &  producer,
const std::string &  consumer 
)
bool CLAM::Network::DisconnectPorts ( const std::string &  producer,
const std::string &  consumer 
)
void CLAM::Network::Do ( void  )
Network::InformationTexts::iterator CLAM::Network::EndInformationTexts ( )

Definition at line 827 of file Network.cxx.

Referenced by removeInformationText(), and StoreOn().

Network::InformationTexts::const_iterator CLAM::Network::EndInformationTexts ( ) const

Definition at line 837 of file Network.cxx.

Network::ProcessingsMap::iterator CLAM::Network::EndProcessings ( )
Network::ProcessingsMap::const_iterator CLAM::Network::EndProcessings ( ) const

Definition at line 800 of file Network.cxx.

const Network::Geometry CLAM::Network::findProcessingGeometry ( Processing processing) const

audio sources and sinks and control sources and sinks order

Definition at line 292 of file Network.cxx.

References GetProcessing().

Referenced by getOrderedControlSinks(), getOrderedControlSources(), getOrderedProcessings(), and getOrderedProcessingsByAttribute().

const Network::ProcessingsGeometriesMap CLAM::Network::GetAndClearGeometries ( )

Definition at line 421 of file Network.cxx.

virtual const char* CLAM::Network::GetClassName ( ) const
inlinevirtual

Return the class name.

Implements CLAM::Component.

Definition at line 88 of file Network.hxx.

std::string CLAM::Network::GetConfigurationErrors ( ) const

Returns an string containing configuration errors.

Don't rely on the format because is subject to change.

Definition at line 985 of file Network.cxx.

References BeginProcessings(), and EndProcessings().

Network::ConnectionState CLAM::Network::GetConnectionReport ( ) const

Definition at line 1018 of file Network.cxx.

std::string CLAM::Network::GetConnectorIdentifier ( const std::string &  str) const
const Text& CLAM::Network::GetDescription ( ) const
inline

Definition at line 85 of file Network.hxx.

InControlBase & CLAM::Network::GetInControlByCompleteName ( const std::string &  name) const
Network::NamesList CLAM::Network::GetInControlsConnectedTo ( const std::string &  producer) const
InPortBase & CLAM::Network::GetInPortByCompleteName ( const std::string &  name) const
Network::NamesList CLAM::Network::GetInPortsConnectedTo ( const std::string &  producer) const
Network::InPortsList CLAM::Network::GetInPortsConnectedTo ( OutPortBase producer) const
const std::string& CLAM::Network::GetName ( ) const
inline

Definition at line 82 of file Network.hxx.

const std::string & CLAM::Network::GetNetworkId ( const Processing proc) const
const Network::ControlSinks CLAM::Network::getOrderedControlSinks ( ) const
const Network::ControlSources CLAM::Network::getOrderedControlSources ( ) const
const Network::Processings CLAM::Network::getOrderedProcessings ( const std::string &  type,
bool  horizontalOrder 
) const
const Network::Processings CLAM::Network::getOrderedProcessingsByAttribute ( const std::string &  attribute,
bool  horizontalOrder = false 
) const
OutControlBase & CLAM::Network::GetOutControlByCompleteName ( const std::string &  name) const
OutPortBase & CLAM::Network::GetOutPortByCompleteName ( const std::string &  name) const
Processing & CLAM::Network::GetProcessing ( const std::string &  name) const

methods used to create processings and get them

Definition at line 492 of file Network.cxx.

References CLAM_ASSERT, and HasProcessing().

Referenced by findProcessingGeometry(), GetInControlByCompleteName(), GetInPortByCompleteName(), GetOutControlByCompleteName(), and GetOutPortByCompleteName().

std::string CLAM::Network::GetProcessingIdentifier ( const std::string &  str) const
std::string CLAM::Network::GetUnconnectedInPorts ( ) const

Returns an string the full name of the unconnected inports.

Don't rely on the format because is subject to change.

Definition at line 949 of file Network.cxx.

References BeginProcessings(), EndProcessings(), CLAM::Processing::GetInPort(), CLAM::InPortBase::GetName(), CLAM::Processing::GetNInPorts(), and CLAM::InPortBase::GetVisuallyConnectedOutPort().

std::string CLAM::Network::GetUnusedName ( const std::string &  prefix,
const bool  cutOnLastSeparator = false,
const std::string  separator = "_" 
) const

Definition at line 527 of file Network.cxx.

References CLAM_ASSERT, and HasProcessing().

Referenced by AddProcessing(), and LoadFrom().

bool CLAM::Network::HasMisconfiguredProcessings ( ) const

Returns true when some processing is misconfigured.

Definition at line 925 of file Network.cxx.

References BeginProcessings(), and EndProcessings().

Referenced by IsReady().

bool CLAM::Network::HasProcessing ( const std::string &  name) const

Definition at line 569 of file Network.cxx.

Referenced by GetProcessing(), and GetUnusedName().

bool CLAM::Network::HasSyncSource ( ) const

Tell whether the network contains any processing which limits the cpu usage such as file or device interfaces.

This is needed when executing a network in a real time process.

Definition at line 966 of file Network.cxx.

References BeginProcessings(), and EndProcessings().

bool CLAM::Network::HasUnconnectedInPorts ( ) const

Returns true when a processing has an inport that is not connected.

Definition at line 934 of file Network.cxx.

References BeginProcessings(), EndProcessings(), CLAM::Processing::GetInPort(), CLAM::Processing::GetNInPorts(), and CLAM::InPortBase::GetVisuallyConnectedOutPort().

Referenced by IsReady().

bool CLAM::Network::IsEmpty ( ) const

Returns true when it has no processings.

Definition at line 920 of file Network.cxx.

Referenced by IsReady().

bool CLAM::Network::IsPaused ( ) const

Definition at line 715 of file Network.cxx.

References CLAM::NetworkPlayer::IsPaused().

bool CLAM::Network::IsPlaying ( ) const

Definition at line 708 of file Network.cxx.

References CLAM::NetworkPlayer::IsPlaying().

bool CLAM::Network::IsReady ( ) const

Tells whether the network is ready to rock.

A network is ready when:

  • it contains any processing,
  • all processings are properly configured, and
  • all in ports are connected,

Definition at line 912 of file Network.cxx.

References HasMisconfiguredProcessings(), HasUnconnectedInPorts(), and IsEmpty().

bool CLAM::Network::IsRealTime ( ) const

Definition at line 722 of file Network.cxx.

References CLAM::NetworkPlayer::IsRealTime().

bool CLAM::Network::IsStopped ( ) const
void CLAM::Network::LoadFrom ( Storage storage)
virtual
static char CLAM::Network::NamesIdentifiersSeparator ( )
inlinestaticprotected

Definition at line 263 of file Network.hxx.

Referenced by PositionOfLastIdentifier(), and PositionOfProcessingIdentifier().

void CLAM::Network::Pause ( )

Definition at line 760 of file Network.cxx.

References CLAM::NetworkPlayer::Pause().

static std::size_t CLAM::Network::PositionOfLastIdentifier ( const std::string &  str)
inlinestaticprotected
static std::size_t CLAM::Network::PositionOfProcessingIdentifier ( const std::string &  str)
inlinestaticprotected

Definition at line 257 of file Network.hxx.

References NamesIdentifiersSeparator(), and PositionOfLastIdentifier().

Referenced by GetProcessingIdentifier().

void CLAM::Network::ReconfigureAllProcessings ( )

Calls Configure() for each processing with its current configuration.

Definition at line 586 of file Network.cxx.

References CLAM::Processing::Configure(), and CLAM::Processing::GetConfig().

void CLAM::Network::removeInformationText ( InformationText informationText)

Definition at line 812 of file Network.cxx.

References BeginInformationTexts(), and EndInformationTexts().

Referenced by Clear().

void CLAM::Network::RemoveProcessing ( const std::string &  name)

Definition at line 549 of file Network.cxx.

References CLAM_ASSERT, IsStopped(), CLAM::FlowControl::ProcessingRemovedFromNetwork(), and Stop().

Referenced by Clear().

bool CLAM::Network::RenameProcessing ( const std::string &  oldName,
const std::string &  newName 
)

Definition at line 900 of file Network.cxx.

void CLAM::Network::ResetConnectionReport ( )

Definition at line 1027 of file Network.cxx.

void CLAM::Network::SetDescription ( const Text description)
inline

Definition at line 86 of file Network.hxx.

void CLAM::Network::SetName ( const std::string &  name)
inline

Definition at line 83 of file Network.hxx.

void CLAM::Network::setPasteMode ( )
inline

Definition at line 116 of file Network.hxx.

void CLAM::Network::SetPlayer ( NetworkPlayer player)

Set the object in charge of managing the processing thread.

Receives property of the player.

Definition at line 473 of file Network.cxx.

References CLAM::NetworkPlayer::Init(), and CLAM::NetworkPlayer::SetNetworkBackLink().

bool CLAM::Network::SetProcessingsGeometries ( const ProcessingsGeometriesMap processingsGeometries)

canvas related geometries

Definition at line 412 of file Network.cxx.

void CLAM::Network::Start ( )
void CLAM::Network::Stop ( )
void CLAM::Network::StoreOn ( Storage storage) const
virtual
bool CLAM::Network::SupportsVariableAudioSize ( ) const

This method reports whether the network supports dynamic buffer-size host.

Definition at line 975 of file Network.cxx.

References BeginProcessings(), and EndProcessings().

bool CLAM::Network::UpdateSelections ( const NamesList processingsNamesList)

methods related to copy&paste processings from canvas

Definition at line 270 of file Network.cxx.


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