// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/OverallDiagnosticRecordBuffer.h 1146 2019-01-22 17:45:37Z depa $
#pragma once

#include "tiptilt_ctrl/bcu/Interface/Sharknir/Bcu/OverallDiagnosticRecord.h"
#include "util/SharedPtr.h"

#include <Basda/Microgate/Mgp/ByteBuffer.h>

#include <boost/shared_ptr.hpp>

namespace Nice
{
class Time;
}

namespace Sharknir { namespace Bcu {

class OverallDiagnosticRecordBuffer
{
public:
    virtual size_t getCapacity()= 0;
    virtual size_t getSize()= 0;

    virtual size_t getNumOfDuplicatedSlopeRecords()= 0;
    virtual size_t getNumOfDuplicatedCcdRecords()= 0;
    virtual size_t getNumOfDuplicatedAsmRecords()= 0;
    virtual size_t getNumOfInsertedSlopeRecords()= 0;
    virtual size_t getNumOfInsertedCcdRecords()= 0;
    virtual size_t getNumOfInsertedAsmRecords()= 0;

    virtual FrameCounter getHighestReceivedFrameCounter()= 0;
    virtual size_t getNumOfLateSlopeRecords()= 0;
    virtual size_t getNumOfLateCcdRecords()= 0;
    virtual size_t getNumOfLateAsmRecords()= 0;

    virtual void clear()= 0;

    virtual void insertSlopeRecord(const FrameCounter frameCounter,
            const Basda::Microgate::ByteBufferPtr& buffer)= 0;
    virtual void insertCcdRecord(const FrameCounter frameCounter,
            const Basda::Microgate::ByteBufferPtr& buffer)= 0;
    virtual void insertAsmRecord(const FrameCounter frameCounter,
            const Basda::Microgate::ByteBufferPtr& buffer)= 0;
    virtual SeqOverallDiagnosticRecordPtr getPastOverallDiagnosticRecords(
            const size_t nMaxRecords)= 0;
    virtual SeqOverallDiagnosticRecordPtr getFutureOverallDiagnosticRecords(
            const size_t nRecords, const Nice::Time& timeout)= 0;
    virtual SeqOverallDiagnosticRecordPtr getPastCcdOverallDiagnosticRecords(
            const size_t nMaxRecords)= 0;
    virtual SeqOverallDiagnosticRecordPtr getPastSlopeOverallDiagnosticRecords(
            const size_t nMaxRecords)= 0;
    virtual SeqOverallDiagnosticRecordPtr getFutureCcdOverallDiagnosticRecords(
            const size_t nMaxRecords, const Nice::Time& timeout)= 0;
    virtual SeqOverallDiagnosticRecordPtr getFutureSlopeOverallDiagnosticRecords(
            const size_t nMaxRecords, const Nice::Time& timeout)= 0;

    virtual ~OverallDiagnosticRecordBuffer()= 0;
};

SHARKNIR_DECLARE_BOOST_SP(OverallDiagnosticRecordBuffer);

// typedef boost::shared_ptr<OverallDiagnosticRecordBuffer>
//     OverallDiagnosticRecordBufferPtr;

}
}
