tb_codec.h
// INCLUDE THE BASE CLASS DECLARATION

#include "codec.h"

// INCLUDE CLASSES USED IN THE INTERFACE/IMPLEMENTATION

#include "tb_values.h"

class TB_Codec:
    public Codec
{
public:
    // CONSTRUCTOR
    //
    // ARGUMENT: name
    //   SMI instance name.
    //
    // ARGUMENT: adc, dac
    //   Storage objects for read and write channel data respectively.

    TB_Codec(const string& name, TB_Values& adc, TB_Values& dac);

    // DESTRUCTOR

    virtual ~TB_Codec();

    // METHOD: adcData()
    //
    // RETURNS:
    //   Value of the next read channel word.
    //
    // DESCRIPTION:
    //   This method generates the sequence of read channel data words,
    //   returning one data word each call. Data is read from the "adc" storage
    //   object.

    unsigned long adcData();

    // METHOD: dacData(data)
    //
    // ARGUMENT: data
    //   Value of the next write channel word.
    //
    // DESCRIPTION:
    //   The method accepts the sequence of write channel data words, accepting
    //   one data word each call. Data is written to the "dac" storage object.

    void dacData(unsigned long data);

private:

    // DATA: STORAGE OBJECT FOR READ CHANNEL DATA

    TB_Values& d_adc;

    // DATA: STORAGE OBJECT FOR WRITE CHANNEL DATA

    TB_Values& d_dac;

    // DISABLE DEFAULT CONSTRUCTORS

    TB_Codec();
    TB_Codec(const TB_Codec&);
};
© Copyright 2000-2001 Adrian Lewis