Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template basic_string_base

boost::container::dtl::basic_string_base

Synopsis

// In header: <boost/container/string.hpp>

template<typename Allocator> 
class basic_string_base {
public:
  // types
  typedef Allocator                                     allocator_type;       
  typedef allocator_type                                stored_allocator_type;
  typedef allocator_traits_type::pointer                pointer;              
  typedef allocator_traits_type::value_type             value_type;           
  typedef allocator_traits_type::size_type              size_type;            
  typedef ::boost::intrusive::pointer_traits< pointer > pointer_traits;       

  // member classes/structs/unions

  struct long_t {
    // construct/copy/destruct
    long_t();
    long_t(const long_t &);
    long_t & operator=(const long_t &);

    // public data members
    size_type is_short;
    size_type length;
    size_type storage;
    pointer start;
  };

  struct members_holder : public Allocator {
    // construct/copy/destruct
    members_holder();
    template<typename AllocatorConvertible> 
      explicit members_holder(BOOST_FWD_REF(AllocatorConvertible));

    // public data members
    repr_t m_repr;
  };

  union repr_t {

    // public member functions
    const short_t & short_repr() const;
    const long_t & long_repr() const;
    short_t & short_repr();
    long_t & long_repr();

    // public data members
    long_raw_t r;
    short_t s;
  };

  struct short_header {

    // public data members
    unsigned char is_short;
    unsigned char length;
  };

  struct short_t {

    // public data members
    short_header h;
    value_type data;
  };

  // construct/copy/destruct
  basic_string_base(const basic_string_base &);
  basic_string_base();
  explicit basic_string_base(const allocator_type &);
  explicit basic_string_base(BOOST_RV_REF(allocator_type));
  basic_string_base(const allocator_type &, size_type);
  explicit basic_string_base(size_type);
  basic_string_base & operator=(const basic_string_base &);
  ~basic_string_base();

  // private member functions
  void init();

  // protected member functions
  const Allocator & alloc() const;
  Allocator & alloc();
  bool is_short() const;
  void is_short(bool);
  pointer allocation_command(allocation_type, size_type, size_type &, 
                             pointer &);
  size_type next_capacity(size_type) const;
  void deallocate(pointer, size_type);
  void construct(pointer, const value_type & = value_type());
  void destroy(pointer, size_type);
  void destroy(pointer);
  void allocate_initial_block(size_type);
  void deallocate_block();
  size_type max_size() const;
  size_type priv_capacity() const;
  pointer priv_short_addr() const;
  pointer priv_long_addr() const;
  pointer priv_addr() const;
  pointer priv_end_addr() const;
  void priv_long_addr(pointer);
  size_type priv_storage() const;
  size_type priv_short_storage() const;
  size_type priv_long_storage() const;
  void priv_storage(size_type);
  void priv_long_storage(size_type);
  size_type priv_size() const;
  size_type priv_short_size() const;
  size_type priv_long_size() const;
  void priv_size(size_type);
  void priv_short_size(size_type);
  void priv_long_size(size_type);
  void swap_data(basic_string_base &);
};

Description

basic_string_base public construct/copy/destruct

  1. basic_string_base(const basic_string_base &);
  2. basic_string_base();
  3. explicit basic_string_base(const allocator_type & a);
  4. explicit basic_string_base(BOOST_RV_REF(allocator_type) a);
  5. basic_string_base(const allocator_type & a, size_type n);
  6. explicit basic_string_base(size_type n);
  7. basic_string_base & operator=(const basic_string_base &);
  8. ~basic_string_base();

basic_string_base private member functions

  1. void init();

basic_string_base protected member functions

  1. const Allocator & alloc() const;
  2. Allocator & alloc();
  3. bool is_short() const;
  4. void is_short(bool yes);
  5. pointer allocation_command(allocation_type command, size_type limit_size, 
                               size_type & prefer_in_recvd_out_size, 
                               pointer & reuse);
  6. size_type next_capacity(size_type additional_objects) const;
  7. void deallocate(pointer p, size_type n);
  8. void construct(pointer p, const value_type & value = value_type());
  9. void destroy(pointer p, size_type n);
  10. void destroy(pointer p);
  11. void allocate_initial_block(size_type n);
  12. void deallocate_block();
  13. size_type max_size() const;
  14. size_type priv_capacity() const;
  15. pointer priv_short_addr() const;
  16. pointer priv_long_addr() const;
  17. pointer priv_addr() const;
  18. pointer priv_end_addr() const;
  19. void priv_long_addr(pointer addr);
  20. size_type priv_storage() const;
  21. size_type priv_short_storage() const;
  22. size_type priv_long_storage() const;
  23. void priv_storage(size_type storage);
  24. void priv_long_storage(size_type storage);
  25. size_type priv_size() const;
  26. size_type priv_short_size() const;
  27. size_type priv_long_size() const;
  28. void priv_size(size_type sz);
  29. void priv_short_size(size_type sz);
  30. void priv_long_size(size_type sz);
  31. void swap_data(basic_string_base & other);

PrevUpHomeNext