//
//  Copyright © 2001 - 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:   CTimer.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    Defines a wrapper class to use a waitable timer.
//
//  Notes:      1)  Clients may use the handle to wait for the kernel object,
//                  install a timer callback or both.
//

#if !defined(AFX_TIMER_H__C8A70001_75D8_4530_B18A_9D99199B804C__INCLUDED_)
#define AFX_TIMER_H__C8A70001_75D8_4530_B18A_9D99199B804C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class EXPORT_DLL CTimer
{
public:

    ///////////////
    // Services.

                    CTimer                  (   const bool             &rbManualReset       = false,
                                                LPCTSTR                 lpszName            = NULL );

    virtual        ~CTimer                  (   void );
                                        
    bool            Set                     (   const long              &rlTimeFromNowInMilliseconds,
                                                const long              &rlPeriodMilliseconds );
                                        
    bool            Cancel                  (   void );

                    operator HANDLE         (   void ) const;

protected:

    ///////////////
    // Attributes.

    HANDLE          m_hTimer;

    ///////////////
    // Services.

    CTimer &        operator =              (   const CTimer       &rRhs );                            // Not implemented.
                    CTimer                  (   const CTimer       &rRhs );                            // Not implemented.

};

#endif // !defined(AFX_TIMER_H__C8A70001_75D8_4530_B18A_9D99199B804C__INCLUDED_)
