#ifndef INCLUDED_BOBCAT_SHAREDBLOCK_
#define INCLUDED_BOBCAT_SHAREDBLOCK_

#include <bobcat/sharedmutex>

namespace FBB
{

class SharedBlock
{
    SharedMutex d_mutex;
    int         d_id = -1;

    public:
        int id() const;
        void lock();
        void setID(int id);
        void unlock();
};

inline int SharedBlock::id() const
{
    return d_id;
}
inline void SharedBlock::setID(int id)
{
    d_id = id;
}
inline void SharedBlock::lock()
{
    d_mutex.lock();
}
inline void SharedBlock::unlock()
{
    d_mutex.unlock();
}

} // FBB
#endif
