//
//  Copyright © 2002, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   FrameQueue.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#if !defined(AFX_FRAMEQUEUE_H__2FFF7A34_1348_4EDA_BF12_225C63734358__INCLUDED_)
#define AFX_FRAMEQUEUE_H__2FFF7A34_1348_4EDA_BF12_225C63734358__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\..\..\Utils\NetUtils\DynamicBuffer.h"

class CFrameQueue
{
public:

    enum EFRAMETYPE
    {
        frameTypeUnknown            = -1,
        frameTypeNavigation,
        frameTypeEnvironment
    };

                            CFrameQueue             (   void );
    virtual                ~CFrameQueue             (   void );

    void                    ConfigureFrame          (   const unsigned long &rulFramesPerSecond,
                                                        const unsigned long &rulFrameSize,
                                                        const EFRAMETYPE    &reFrameType );

    bool                    AddFrame                (   const BYTE          *pbyData,
                                                        const unsigned long &rulNumBytes,
                                                        const unsigned long &rulTimestamp );

    void                    Reset                   (   void );

    bool                    IsComplete              (   void )  const;

    unsigned long           NumberOfFrames          (   void )  const;

    unsigned long           FrameSize               (   void )  const;

    EFRAMETYPE              FrameType               (   void )  const;

    unsigned long           Timestamp               (   void )  const;

                            operator unsigned long  (   void )  const;

                            operator BYTE *  const  (   void )  const;

private:

    const unsigned long     m_ulMaxFramePeriod;

    bool                    m_bFrameComplete;

    unsigned long           m_ulTimeStamp;
    unsigned long           m_ulFrameSizeInBytes;
    unsigned long           m_ulFrameCount;
    unsigned long           m_ulMaxFrameCount;

    CDynamicBuffer<BYTE>    m_FrameQueue;

    EFRAMETYPE              m_eFrameType;

};

#endif // !defined(AFX_FRAMEQUEUE_H__2FFF7A34_1348_4EDA_BF12_225C63734358__INCLUDED_)
