simple_seq_fit.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_SIMPLE_SEQ_FIT_HPP
  11. #define BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_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. #include <boost/interprocess/interprocess_fwd.hpp>
  22. #include <boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp>
  23. #include <boost/interprocess/offset_ptr.hpp>
  24. //!\file
  25. //!Describes sequential fit algorithm used to allocate objects in shared memory.
  26. namespace boost {
  27. namespace interprocess {
  28. //!This class implements the simple sequential fit algorithm with a simply
  29. //!linked list of free buffers.
  30. template<class MutexFamily, class VoidPointer>
  31. class simple_seq_fit
  32. : public ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer>
  33. {
  34. #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
  35. typedef ipcdetail::simple_seq_fit_impl<MutexFamily, VoidPointer> base_t;
  36. #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
  37. public:
  38. typedef typename base_t::size_type size_type;
  39. //!Constructor. "size" is the total size of the managed memory segment,
  40. //!"extra_hdr_bytes" indicates the extra bytes beginning in the sizeof(simple_seq_fit)
  41. //!offset that the allocator should not use at all.*/
  42. simple_seq_fit(size_type segment_size, size_type extra_hdr_bytes)
  43. : base_t(segment_size, extra_hdr_bytes){}
  44. };
  45. } //namespace interprocess {
  46. } //namespace boost {
  47. #include <boost/interprocess/detail/config_end.hpp>
  48. #endif //#ifndef BOOST_INTERPROCESS_SIMPLE_SEQ_FIT_HPP