PrevUpHomeNext

Class mixin_collection

boost::mixin::mixin_collection

Synopsis

// In header: <boost/mixin/mixin_collection.hpp>


class mixin_collection : public boost::mixin::internal::noncopyable {
public:
  // construct/copy/destruct
  mixin_collection();
  mixin_collection(const internal::mixin_type_info_vector &);

  // public member functions
  template<typename Mixin> bool has() const;
  bool has(mixin_id) const;
  template<typename Mixin> void add();
  void add(mixin_id);
  template<typename Mixin> void remove();
  void remove(mixin_id);
  template<typename Feature> bool implements(const Feature *) const;
  template<typename Feature> void clear_all_implementing(const Feature *);
  void rebuild_from_compact_mixins();
  void check_valid_mixin(const internal::mixin_type_info &);
  void clear();
  bool empty() const;

  // public data members
  internal::available_mixins_bitset _mixins;
  internal::mixin_type_info_vector _compact_mixins;
};

Description

A mixin collection is a class that allows the user to represent a number of mixins

mixin_collection public construct/copy/destruct

  1. mixin_collection();
  2. mixin_collection(const internal::mixin_type_info_vector & mixins);

mixin_collection public member functions

  1. template<typename Mixin> bool has() const;
    Checks if a mixin type is present in the collection.
  2. bool has(mixin_id id) const;
  3. template<typename Mixin> void add();
    Adds a mixin type is to the collection.
  4. void add(mixin_id id);
  5. template<typename Mixin> void remove();
    Removes a mixin type from the collection.
  6. void remove(mixin_id id);
  7. template<typename Feature> bool implements(const Feature * f) const;
    Checks if a feature is implemented by any mixin in the collection.
  8. template<typename Feature> void clear_all_implementing(const Feature * f);
    Clears all mixins implementing a feature from the collection.
  9. void rebuild_from_compact_mixins();
  10. void check_valid_mixin(const internal::mixin_type_info & mixin_info);
  11. void clear();
    Removes all elements from the collection.
  12. bool empty() const;
    Checks if a collection is empty.

PrevUpHomeNext