SF_Network

Sonic Flow libsf Reference Guide

SF_Network (const char* name = 0);

Construct an empty network.

virtual ~SF_Network ();

Destruct a network

virtual void print (ostream& stream) const;

Print a textual description of the contents of the network. The printout contains general information on the network as well as a detailed printout of each block.

virtual bool is_functional () const;

Inspect whether the network is functional as whole and return true if it is.

virtual void finish ();

Clean up the network after simulation. This function must be called at the end of a simulation run in order to ensure that all resources allocated for the simulation get freed.

virtual void execute ();

Execute one epoch/round of simulation. In the course of one simulation round the amount of data which passes around is equal to the duration of one frame. This means that each call to execute () produces one frame's duration of output signal(s). Note that the network must have been initialized via a call to initialize () prior to execution.

virtual void initialize ();

Initialize the network prior to simulation. This function must be called at the beginning of a simulation run in order to be able to simulate the network. a list which can simply be traversed repeatedly in the execution phase. The sample rates are also initialized; every source block is asked for its output sample rates and the rates are propagated according to the wires. Every block is initialized. Note that the sample rates, input and output frame pointers have all been initialized and the frames have all been cleared at the time of calling the initialize () function of blocks.

void add_block (SF_Block& block);

Add an existing block to the network.

void remove_block (SF_Block& block);

Remove an existing block from the network. Throws an exception if the block is not in the network.

void check ();

Check the sanity of the connections and sample rates in the network and throw an exception on insane cases. This function call partitions the network, initializes sample rates and reallocates frames as a side effect.

inline SF_Time get_simulation_duration () const;
inline void set_simulation_duration (SF_Time duration);

Get and set the amount of time the next simulation run is supposed to last.

void start_simulation ();

Start an asynchronous simulation run of the whole network: the duration of this run is set with set_simulation_duration (). This call returns after starting the simulation process. NOTE that there is currently no way of getting data (nor error information) back from the asynchronous simulation process.

NOTE: the asynchronous simulation functionality is currently inadequately implemented, untested and unsupported.

void stop_simulation ();

Stop the asynchronous simulation process.

NOTE: the asynchronous simulation functionality is currently inadequately implemented, untested and unsupported.

inline bool is_running () const;

Return true if the asynchronous simulation process is currently running.

NOTE: the asynchronous simulation functionality is currently inadequately implemented, untested and unsupported.

inline bool is_error () const;

Return true if there has been an error (exception actually) in the asynchronous simulation process.

NOTE: the asynchronous simulation functionality is currently inadequately implemented, untested and unsupported.

inline SF_Exception* get_simulation_exception () const;

Return the exception which has occurred in the asynchronous simulation process.

NOTE: the asynchronous simulation functionality is currently inadequately implemented, untested and unsupported.


Last modified: Thu Dec 10 14:18:29 1998
jarno.seppanen@cs.tut.fi
Audio Research Group