name: DisplayData : public AlgorithmBase
synopsis:

>     g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_algo.a

>     #include <DisplayData.h>

>     DisplayData();
>     DisplayData(const DisplayData& arg);
>     boolean eq(const DisplayData& arg);
>     boolean setAlgorithm(ALGORITHM algorithm);

quick start:

>     DisplayData lab;
>     lab.setNumber((long)3);
>     lab.setLabel(L"My Data");

description:
This class is used by isip_transform to implement a primitive debugging capability. A DisplayData component can be introduced anywhere in a signal flow graph to display data to the console (or file) as a signal is being processed through the graph. The display format can be customized using building blocks such as strings, prefixes, and suffixes.
A list of options are given below:
The class currently supports output via the Console class. Most of the standard algorithm interface parameters are not relevant (e.g., Mode). The main option under user control is the frequency with which information is printed, implemented via the selection of the algorithm.
dependencies:

- AlgorithmBase
- MemoryManager

public constants:

- define the class name:

      static const String CLASS_NAME = L"DisplayData";

- define the algorithm choices:

      enum ALGORITHM { EVERY = 0, FIRST, LAST, ONCE, DEF_ALGORITHM = EVERY };

- define the implementation choices:

      enum IMPLEMENTATION { CONSOLE = 0, DEF_IMPLEMENTATION = CONSOLE };

- define the static NameMap objects

      static const NameMap ALGO_MAP(L"FIRST, LAST, ONCE, EVERY");

      static const NameMap IMPL_MAP(L"CONSOLE");

- define constants used for producing the display output

      static const String ELEMENT_HEADER_00 = L"element ";

      static const String ELEMENT_HEADER_01 = L":\n";

      static const String LABEL_DELIM = L" = ";

      static const String EMPTY_MATRIX = L"[ ]";

      static const String MATRIX_START = L"[";

      static const String MATRIX_DELIM = L" ";

      static const String MATRIX_END = L"]";

- define i/o related constants:

      static const String DEF_PARAM = L"";

      static const String PARAM_ALGORITHM = L"algorithm";

      static const String PARAM_IMPLEMENTATION = L"implementation";

      static const String PARAM_NUMBER = L"number";

      static const String PARAM_LABEL = L"label";

      static const String PARAM_PREFIX = L"number";

      static const String PARAM_SUFFIX = L"number";

- define default value(s) of the class data:

      static const long DEF_NUMBER = 0;

      static const Integral::DEBUG DEF_DEBUG_LEVEL = Integral::BRIEF;

      static const String DEF_LABEL = L"";

      static const String DEF_PREFIX = L"";

      static const String DEF_SUFFIX = L"";

- define default argument(s):

error codes:

- error code indicating DisplayData class general error:

      static const long ERR = 73100;

protected data:

- algorithm name:

      ALGORITHM algorithm_d;

- implementation name

      IMPLEMENTATION implementation_d;

- the number

      Long number_d;

- strings that define the output formatting

      String label_d;

      String prefix_d;

      String suffix_d;

- static memory manager:

      static MemoryManager mgr_d;

required public methods:

- static methods:

      static const String& name();

      static boolean diagnose(Integral::DEBUG debug_level);

- debug methods: setDebug method is inherited from base class

      boolean debug(const unichar* message) const;

- destructor/constructor(s):

      ~DisplayData();

      DisplayData(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, Long number = DEF_NUMBER, Integral::DEBUG debug_level = DEF_DEBUG_LEVEL);

      DisplayData(const DisplayData& arg);

- assign methods:

      boolean assign(const DisplayData& arg);

- operator= methods:

      DisplayData& operator= (const DisplayData& arg);

- i/o methods:

      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;

- equality methods:

      boolean eq(const DisplayData& arg) const;

- memory management methods:

      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);

class-specific public methods:

- set methods:

      boolean setAlgorithm(ALGORITHM algorithm);

      boolean setImplementation(IMPLEMENTATION implementation);

      boolean setNumber(long arg);

      boolean setLabel(const String& arg);

      boolean setPrefix(const String& arg);

      boolean setSuffix(const String& arg);

      boolean set(ALGORITHM algorithm = DEF_ALGORITHM, IMPLEMENTATION implementation = DEF_IMPLEMENTATION, Long number = DEF_NUMBER, Integral::DEBUG debug_level = DEF_DEBUG_LEVEL);

- get methods:

      ALGORITHM getAlgorithm() const;

      IMPLEMENTATION getImplementation() const;

      long getNumber() const;

      const String& getLabel() const;

      const String& getPrefix() const;

      const String& getSuffix() const;

      boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation, long& number, Integral::DEBUG& debug_level) const;

- computational methods:

      boolean compute(AlgorithmData& output, const AlgorithmData& input);

- AlgorithmBase interface contract methods:

      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);

private methods:

- method to determine if this frame's data should be displayed:

      boolean shouldDisplayFrame();

- method to create a nice display for anything but a combination:

      boolean displayObject();

examples:

- none.

notes:

- The only place this class is typically used is within isip_transform to supply debugging output. Users will not typically need to invoke this class in a program because they can use the debug method for the class directly.