//
//  Copyright © 2003, 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:   7kSharedMemoryInterface.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#if !defined(AFX_7KSHAREDMEMORYINTERFACE_H__079BFBB6_0330_425C_9D5D_1369531531CB__INCLUDED_)
#define AFX_7KSHAREDMEMORYINTERFACE_H__079BFBB6_0330_425C_9D5D_1369531531CB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "7kSonarInterface.h"
#include "7kInBoundMemory.h"
#include "7kOutBoundMemory.h"

class C7kSharedMemoryInterface : public C7kSonarInterface
{
public:

    ///////////////
    // Services.

                    C7kSharedMemoryInterface(   void );
    virtual        ~C7kSharedMemoryInterface(   void );

    virtual bool    Connect                 (   void );

    virtual bool    Disconnect              (   void );

    virtual bool    Write7kRecord           (   const BYTE          *pby7kRecord,
                                                const unsigned long &rulBytes );

                    operator HANDLE         (   void ) const;


protected:

    ///////////////
    // Services.

    bool            HandleDataFromSonar     (   BYTE                       *pby7kRecord,
                                                unsigned long              &rulRecordBytes,
                                                const unsigned long        &rulMaxBufferSize,
                                                const bool                 &rbResetEvent       = false );

private:

    ///////////////
    // Attributes.

    // Inbound and outbound (relative to the sonar) shared memory areas for data exchange with the sonar.

    std::auto_ptr<C7kInBoundMemory>         m_pToSonar;                 // Interface for commands etc to the sonar.
    std::auto_ptr<C7kOutBoundMemory>        m_pFromSonar;               // Interface for data from the sonar.

};

#endif // !defined(AFX_7KSHAREDMEMORYINTERFACE_H__079BFBB6_0330_425C_9D5D_1369531531CB__INCLUDED_)

