quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <Connection.h> Connection(); Connection(const Connection& arg); boolean eq(const Connection& arg); boolean setAlgorithm(ALGORITHM algorithm);
description:Connection conn; conn.setAlgorithm(Connection::INPUTS); conn.setImplementation(Connection::CONCATENATION); AlgorithmData in; in.makeCombination().setLength(2); in.getCombination()(0).makeVector().assign(L"0, 1, 2, 3"); in.getCombination()(1).makeVector().assign(L"5, 6, 7, 8"); VectorFloat out; conn.computeInputs(out, in);
static const String CLASS_NAME = L"Connection";
enum ALGORITHM { CHANNEL = 0, STREAM, DEF_ALGORITHM = CHANNEL };
enum IMPLEMENTATION { CONCATENATE = 0, INTERLEAVE, SELECT, DEF_IMPLEMENTATION = CONCATENATE };
static const NameMap ALGO_MAP(L"CHANNEL, STREAM");
static const NameMap IMPL_MAP(L"CONCATENATE, INTERLEAVE, SELECT, SPLIT");
static const String DEF_PARAM = L"";
static const String PARAM_ALGORITHM = L"algorithm";
static const String PARAM_IMPLEMENTATION = L"implementation";
static const String PARAM_CHANNEL = L"channel";
static const long ERR = 72100;
static const long ERR_LENGTH = 72101;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
Long channel_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Connection();
Connection(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
Connection(const Connection& arg);
boolean assign(const Connection& arg);
Connection& operator= (const Connection& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean eq(const Connection& arg) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setChannel(long chan);
boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
ALGORITHM getAlgorithm() const;
IMPLEMENTATION getImplementation() const;
long getChannel() const;
boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation) const;
boolean assign(const AlgorithmBase& arg);
boolean eq(const AlgorithmBase& arg) const;
const String& className() const;
boolean apply(Vector<AlgorithmData>& output, const Vector<AlgorithmData>& input);
boolean setParser(SofParser* parser);
boolean computeChannelConcatenate(VectorFloat& output, const Vector<AlgorithmData>& input);
boolean computeChannelInterleave(VectorFloat& output, const Vector<AlgorithmData>& input);
boolean computeStreamConcatenate(AlgorithmData& output, const AlgorithmData& input);
boolean computeStreamSelect(ALgorithmData& output, const Vector<AlgorithmData>& input);
// declare variables // Vector< CircularBuffer<AlgorithmData> > input(1); Vector< AlgorithmData> output; AlgorithmData tmp; // create a signal with four channels // tmp.makeCombination().setLength(4); tmp.getCombination()(0).makeVectorFloat().assign(L"0, 1, 2, 3"); tmp.getCombination()(1).makeVectorFloat().assign(L"4, 5, 6, 7"); tmp.getCombination()(2).makeVectorFloat().assign(L"8, 9, 10, 11"); tmp.getCombination()(3).makeVectorFloat().assign(L"12, 13, 14, 15"); input(0).append(tmp); // initialize the connection block and process the data // Connection conn; conn.setAlgorithm(Connection::CHANNEL); conn.setImplementation(Connection::CONCATENATE); conn.apply(output, input);The corresponding output is shown in the first row in the table above.
// declare variables // Vector< CircularBuffer<AlgorithmData> > input(2); Vector<AlgorithmData> output; AlgorithmData tmp1; AlgorithmData tmp2; // create two signals with two channels each // tmp1.makeCombination().setLength(2); tmp1.getCombination()(0).makeVectorFloat().assign(L"0, 1, 0"); tmp1.getCombination()(1).makeVectorFloat().assign(L"1, 0, 1"); tmp2.makeCombination().setLength(2); tmp2.getCombination()(0).makeVectorFloat().assign(L"2, 3, 2"); tmp2.getCombination()(1).makeVectorFloat().assign(L"3, 2, 3"); input(0).append(tmp1); input(1).append(tmp2); // initialize the connection block and process the data // Connection conn; conn.setAlgorithm(Connection::STREAM); conn.setImplementation(Connection::CONCATENATE); conn.apply(output, input);The corresponding output is shown in the third row in the table above.