Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TREPETITION_GUARD
Toshihiro Shimizu 890ddd
#define TREPETITION_GUARD
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZQT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class DVAPI TRepetitionGuard {
Shinya Kitaoka 120a6e
  static int m_counter;
Shinya Kitaoka 120a6e
  bool m_counterCheck;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TRepetitionGuard() : m_counterCheck(m_counter == 0) { ++m_counter; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  ~TRepetitionGuard() { --m_counter; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool hasLock() { return m_counterCheck; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // TREPETITION_GUARD