noncopyable.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* ScummVM Tools
  2. *
  3. * ScummVM Tools is the legal property of its developers, whose
  4. * names are too numerous to list here. Please refer to the
  5. * COPYRIGHT file distributed with this source distribution.
  6. *
  7. * Additionally this file is based on the ScummVM source code.
  8. * Copyright information for the ScummVM source code is
  9. * available in the COPYRIGHT file of the ScummVM source
  10. * distribution.
  11. *
  12. * This program is free software; you can redistribute it and/or
  13. * modify it under the terms of the GNU General Public License
  14. * as published by the Free Software Foundation; either version 2
  15. * of the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. */
  26. #ifndef COMMON_NONCOPYABLE_H
  27. #define COMMON_NONCOPYABLE_H
  28. namespace Common {
  29. /**
  30. * Subclass of NonCopyable can not be copied due to the fact that
  31. * we made the copy constructor and assigment operator private.
  32. */
  33. class NonCopyable {
  34. public:
  35. NonCopyable() {}
  36. private:
  37. // Prevent copying instances by accident
  38. NonCopyable(const NonCopyable&);
  39. NonCopyable& operator=(const NonCopyable&);
  40. };
  41. } // End of namespace Common
  42. #endif