/*
   HARK Library
   Copyright (C) 2021 Honda Research Institute Japan Inc.
 */

#if !defined(_HARKLIB_INTERNAL_LOCK_H_INCLUDED_)
#define _HARKLIB_INTERNAL_LOCK_H_INCLUDED_ 1

#include "hark-lib/object.h"

#include <mutex>

namespace hark
{
    // class UniqueLockBaseImpl: public object
    // {
    // public:
    //     UniqueLockBaseImpl(Mutex &mutex);
    // };

    // class UniqueMutexLock: public object
    // {
    // public:
    //     UniqueMutexLock(Mutex &mutex);
    //     UniqueMutexLock(Mutex *mutex);

    // public:
    //     std::unique_ptr<UniqueLockBaseImpl> _impl;

    // };

    // template<typename T>
    // class UniqueLock: public UniqueMutexLock
    // {
    // public:
    //     UniqueLock(T &mutex): UniqueMutexLock(mutex) {}
    //     UniqueLock(T *mutex): UniqueMutexLock(mutex) {}

    // };

    class UniqueLock: public object
    {
    public:
        UniqueLock(Mutex &mutex);
        UniqueLock(Mutex *mutex);

    private:
        std::unique_lock<std::mutex> _impl;

        friend class ConditionVariable;
    };

}

#endif /* #if !defined(_HARKLIB_INTERNAL_LOCK_H_INCLUDED_) */

/* end of file */
