PrevUpHomeNext

Class object

boost::mixin::object — The main object class.

Synopsis

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


class object : public boost::mixin::internal::noncopyable {
public:
  // construct/copy/destruct
  object();
  explicit object(const object_type_template &);
  object(object &&);
  ~object();

  // public member functions
  template<typename Mixin> bool has() const;
  template<typename Mixin> Mixin * get();
  template<typename Mixin> const Mixin * get() const;
  template<typename Feature> bool implements(const Feature *) const;
  void clear();
  bool empty() const;
  void get_message_names(std::vector< const char * > &) const;
  void get_mixin_names(std::vector< const char * > &) const;
  const void * internal_get_mixin(mixin_id) const;
  bool internal_has_mixin(mixin_id) const;
  void change_type(const internal::object_type_info *, bool);
  void construct_mixin(mixin_id);
  void destroy_mixin(mixin_id);
  bool internal_implements(feature_id, const internal::message_feature_tag &) const;
  bool implements_message(feature_id) const;

  // public data members
  boost_mixin_internal __pad0__;
  const internal::object_type_info * _type_info;
  internal::mixin_data_in_object * _mixin_data;
};

Description

object public construct/copy/destruct

  1. object();
    Constructs an empty object - no mixins.
  2. explicit object(const object_type_template & type_template);
    Constructs an object from a specific type template.
  3. object(object && o);
    Move constructor from an existing object.
  4. ~object();

object public member functions

  1. template<typename Mixin> bool has() const;
    Checks if the object has a specific mixin.
  2. template<typename Mixin> Mixin * get();

    Gets a specific mixin from the object. Returns nullptr if the mixin isn't available.

  3. template<typename Mixin> const Mixin * get() const;

    Gets a specific mixin from the object. Returns nullptr if the mixin isn't available.

  4. template<typename Feature> bool implements(const Feature *) const;
    Checks if the mixin implements a feature.
  5. void clear();
    Destroys all mixins within an object and resets its type info.
  6. bool empty() const;
    Returns true if the object is empty - has no mixins.
  7. void get_message_names(std::vector< const char * > & out_message_names) const;
    Adds the names of the messages implemented by the object to the vector.
  8. void get_mixin_names(std::vector< const char * > & out_mixin_names) const;
    Adds the names of the object's mixins to the vector.
  9. const void * internal_get_mixin(mixin_id id) const;
  10. bool internal_has_mixin(mixin_id id) const;
  11. void change_type(const internal::object_type_info * new_type, 
                     bool manage_mixins);
  12. void construct_mixin(mixin_id id);
  13. void destroy_mixin(mixin_id id);
  14. bool internal_implements(feature_id id, const internal::message_feature_tag &) const;
  15. bool implements_message(feature_id id) const;

PrevUpHomeNext