quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a #include <Constant.h> Constant(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION); Constant(const Constant& arg); boolean assign(const Constant& arg); boolean setAlgorithm(ALGORITHM type); boolean setDataType(AlgorithmData::DATA_TYPE type);
description:Constant cons; Vector <CircularBuffer <AlgorithmData>> in; Vector <AlgorithmData> out; cons.apply(output, input);
static const String CLASS_NAME = L"Constant";
enum ALGORITHM { DATA = 0, DEF_ALGORITHM = DATA };
enum IMPLEMENTATION { READ = 0, WRITE, DEF_IMPLEMENTATION = READ };
static const NameMap ALGO_MAP(L"DATA");
static const NameMap IMPL_MAP(L"READ, WRITE");
static const String DEF_PARAM = L"";
static const String DEF_FILENAME = L"diagnose_file.sof";
static const String PARAM_ALGORITHM = L"algorithm";
static const String PARAM_IMPLEMENTATION = L"implementation";
static const String PARAM_DATATYPE = L"datatype";
static const String PARAM_FILENAME = L"filename";
static const String PARAM_CHANNEL = L"channels";
static const String PARAM_CHANNELINDEX = L"channelindex";
static const boolean DEF_DATA_EXIST = false;
static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::SEF_CTYPE;
static const long ERR = 70500;
ALGORITHM algorithm_d;
IMPLEMENTATION implementation_d;
String file_name_d;
Long channels_d;
Vector <Long> channel_index_d;
AlgorithmData::DATA_TYPE data_type_d;
Vector <AlgorithmData> data_d;
boolean data_exist_d;
static MemoryManager mgr_d;
static HashTablehash_files_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Constant();
Constant(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
Constant(const Constant& arg);
boolean assign(const Constant& arg);
Constant& operator= (const Constant& 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 readData(Sof& sof, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean writeData(Sof& sof) const;
boolean eq(const Constant& 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();
boolean setAlgorithm(ALGORITHM algorithm);
boolean setImplementation(IMPLEMENTATION implementation);
boolean setChannel(long channels);
boolean setDataType(AlgorithmData::DATA_TYPE type);
boolean setFilename(String filename);
boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION);
ALGORITHM getAlgorithm() const;
IMPLEMENTATION getImplementation() const;
long getChannel() const;
boolean getFilename(String& filename) const;
boolean getInputFilename(String& filename) const;
boolean getOutputFilename(String& filename) const;
AlgorithmData::DATA_TYPE getDataType() const;
boolean get (ALGORITHM& algorithm, IMPLEMENTATION& implementationconst) const;
boolean assign(const AlgorithmBase& arg);
boolean eq(const AlgorithmBase& arg) const;
boolean apply(Vector<AlgorithmData>& output, const Vector<CircularBuffer<AlgorithmData> >& input);
const String& className() const;
boolean init();
boolean setParser(SofParser* parser);
boolean readDataConstant(Sof& sof, const String& pname, long size, boolean param, boolean nested);
boolean writeDataConstant(Sof& sof, const String& pname);
boolean computeRead(Vector<AlgorithmData>& output_a, const Vector< CircularBuffer<AlgorithmData> >& input_a);
boolean computeWrite(Vector<AlgorithmData>& output_a, const Vector< CircularBuffer<AlgorithmData> >& input_a);
boolean getFromHash();
// declare a Constant // Constant c1; // set the source constant file // c1.setFilename(L"diagnose_file.sof"); // set implementation to write mode // c1.setImplementation(WRITE); // set data type // c1.setDataType(AlgorithmData::VECTOR_FLOAT); // set channels // c1.setChannel(4); // define some variables // Vector <CircularBuffer <AlgorithmData>> in; Vector <AlgorithmData> out; // initiate data // long N = 4; in.setLength(N); for (long i = 0; i < N; i++) { in(i)(0).makeVectorFloat(); in(i)(0).getVectorFloat().assign(result(i)); in(i)(0).setCoefType(AlgorithmData::SIGNAL); } // call apply method // c1.apply(out, in);