creation_tags.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_INTERPROCESS_CREATION_TAGS_HPP
  11. #define BOOST_INTERPROCESS_CREATION_TAGS_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. #include <boost/interprocess/detail/config_begin.hpp>
  20. #include <boost/interprocess/detail/workaround.hpp>
  21. namespace boost {
  22. namespace interprocess {
  23. //!Tag to indicate that the resource must
  24. //!be only created
  25. struct create_only_t {};
  26. //!Tag to indicate that the resource must
  27. //!be only opened
  28. struct open_only_t {};
  29. //!Tag to indicate that the resource must
  30. //!be only opened for reading
  31. struct open_read_only_t {};
  32. //!Tag to indicate that the resource must
  33. //!be only opened privately for reading
  34. struct open_read_private_t {};
  35. //!Tag to indicate that the resource must
  36. //!be only opened for reading
  37. struct open_copy_on_write_t {};
  38. //!Tag to indicate that the resource must
  39. //!be created. If already created, it must be opened.
  40. struct open_or_create_t {};
  41. //!Value to indicate that the resource must
  42. //!be only created
  43. static const create_only_t create_only = create_only_t();
  44. //!Value to indicate that the resource must
  45. //!be only opened
  46. static const open_only_t open_only = open_only_t();
  47. //!Value to indicate that the resource must
  48. //!be only opened for reading
  49. static const open_read_only_t open_read_only = open_read_only_t();
  50. //!Value to indicate that the resource must
  51. //!be created. If already created, it must be opened.
  52. static const open_or_create_t open_or_create = open_or_create_t();
  53. //!Value to indicate that the resource must
  54. //!be only opened for reading
  55. static const open_copy_on_write_t open_copy_on_write = open_copy_on_write_t();
  56. namespace ipcdetail {
  57. enum create_enum_t
  58. { DoCreate, DoOpen, DoOpenOrCreate };
  59. } //namespace ipcdetail {
  60. } //namespace interprocess {
  61. } //namespace boost {
  62. #include <boost/interprocess/detail/config_end.hpp>
  63. #endif //#ifndef BOOST_INTERPROCESS_CREATION_TAGS_HPP