/* 
 * File:   cKlinkDataBuffer.h
 * Author: john
 *
 * Created on 04 April 2011, 10:57 AM
 */

#ifndef CKLINKDATABUFFER_H
#define	CKLINKDATABUFFER_H

#include <stdint.h>
#include <klog.h>
#include <cKlinkDebug.h>

class cKlinkDataBuffer : public cKlog
{
public:
    cKlinkDataBuffer();
    cKlinkDataBuffer(int);
    cKlinkDataBuffer(const cKlinkDataBuffer& orig);
    virtual ~cKlinkDataBuffer();
    
    void setData(int b_num,uint8_t);
    uint8_t getDataByte(int b_num);
    void setData(int b_num,uint16_t);
    uint16_t getDataUInt16(int b_num);
    void setData(int b_num,uint32_t);
    uint32_t getDataUInt32(int b_num);
    uint8_t * getBuffer() const;
    uint8_t * getBuffer(int idx);
    uint8_t * getBuffer(int idx,int len);
    void setData(uint8_t * buf,int idx,int len);    
    int getLength();
    void setLength(int);
    void dumpFrame();
private:
    uint8_t * mData;
    int mDataLength;
    int mCurrIdx;

};

#endif	/* CKLINKDATABUFFER_H */

