14 #ifndef _ENTITY_ENTITY_H_INCLUDED_
15 #define _ENTITY_ENTITY_H_INCLUDED_
17 #include <boost/operators.hpp>
22 #include "entity/config.hpp"
31 class entity : boost::totally_ordered<entity>
42 return index() == rhs.index();
47 return index() < rhs.index();
85 return get() == rhs.
get();
90 return get() < rhs.
get();
104 typedef std::unique_ptr<
106 std::function<void(entity_index_t const*)>
109 typedef std::unique_ptr<
111 std::function<void(entity_index_t const*)>
115 : ref_(
std::move(ref))
119 : ref_(
std::move(ref))
138 : ref_(
std::move(ref.ref_))
148 return get() == rhs.
get();
153 return get() < rhs.
get();
167 typedef std::shared_ptr<const entity_index_t> const_ref_type;
168 typedef std::shared_ptr<entity_index_t> ref_type;
171 : ref_(
std::move(ref))
175 : ref_(
std::move(ref))
203 return ref_.lock() == rhs.ref_.lock();
208 return ref_.lock() < rhs.ref_.lock();
214 std::weak_ptr<const entity_index_t> ref_;
218 #endif // _ENTITY_ENTITY_H_INCLUDED_
friend void swap(unique_entity &, unique_entity &)
shared_entity(unique_entity &&ref)
bool operator==(entity const &rhs) const
bool operator<(weak_entity const &rhs) const
bool operator==(unique_entity const &rhs) const
void swap(shared_entity &a, shared_entity &b)
friend void swap(shared_entity &, shared_entity &)
bool operator<(unique_entity const &rhs) const
weak_entity(shared_entity const &ref)
void swap(unique_entity &a, unique_entity &b)
bool operator==(weak_entity const &rhs) const
entity_index_t index() const
std::size_t entity_index_t
bool operator<(shared_entity const &rhs) const
entity make_entity(entity_index_t idx) BOOST_NOEXCEPT_OR_NOTHROW
bool operator==(shared_entity const &rhs) const
bool operator<(entity const &rhs) const
shared_entity lock() const