//
//  Copyright © 2004, 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:   7kOutBoundMemory.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      1)  6046 is note permitted to write to the 7k sonar's outbound MMF
//                  so the Write() method below is private to enforce the policy.
//                  Moreover, THIS ROUTINE IS PRESENTLY UNTESTED,
//

#if !defined(AFX_7KOUTBOUNDMEMORY_H__24BF130D_1343_40BD_8278_ED83F3752907__INCLUDED_)
#define AFX_7KOUTBOUNDMEMORY_H__24BF130D_1343_40BD_8278_ED83F3752907__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "7kSharedMemory.h"

class C7kOutBoundMemory : protected C7kSharedMemory  
{
public:

    ///////////////
    // Services.

                        C7kOutBoundMemory   (   void );
    virtual            ~C7kOutBoundMemory   (   void );

    bool                Open                (   void );

                        operator HANDLE     (   void ) const;

    bool                IsDataAvailable     (   void ) const;

    bool                Retrieve7kRecord    (   BYTE                       *pbyRecordData,
                                                unsigned long              &rulBytesRead,
                                                unsigned long              &rulTimeStamp,
                                                const unsigned long        &rulMaxBufferSize );

    bool                ResetEvent          (   void )  const;

    static bool         DoesExist           (   void );

private:


    ///////////////
    // Attributes.

    mutable DWORD       m_dwLastReadPoint;
    unsigned __int64    m_ui64TotalRead;

    ///////////////
    // Services.

    bool                Write               (   const BYTE                 *pbyData,
                                                const DWORD                &rdwSize );  // Private to enforce the non-use policy; this routine is untested.


                        C7kOutBoundMemory   (   const C7kOutBoundMemory    &rRhs );     // Not implemented.
    C7kOutBoundMemory & operator =          (   const C7kOutBoundMemory    &rRhs );     // Not implemented.
};

#endif // !defined(AFX_7KOUTBOUNDMEMORY_H__24BF130D_1343_40BD_8278_ED83F3752907__INCLUDED_)
