entity
Entity/Component System for C++
entity::shared_entity Class Reference

Description

Definition at line 130 of file entity.hpp.

+ Inheritance diagram for entity::shared_entity:

Friends

class entity_pool
 
void swap (shared_entity &, shared_entity &)
 
class weak_entity
 

Public Member Functions

void clear ()
 
entity get () const
 
bool operator< (shared_entity const &rhs) const
 
bool operator== (shared_entity const &rhs) const
 
 shared_entity ()
 
 shared_entity (unique_entity &&ref)
 

Methods

friend class entity_pool
friend

Definition at line 163 of file entity.hpp.

void swap ( shared_entity a,
shared_entity b 
)
friend

Definition at line 181 of file entity.hpp.

182  {
183  std::swap(a.ref_, b.ref_);
184  }
void swap(shared_entity &a, shared_entity &b)
Definition: entity.hpp:181
friend class weak_entity
friend

Definition at line 164 of file entity.hpp.

Member Function Documentation

void entity::shared_entity::clear ( )

Definition at line 156 of file entity.hpp.

157  {
158  ref_ = nullptr;
159  }
entity entity::shared_entity::get ( ) const

Definition at line 141 of file entity.hpp.

References entity::make_entity().

Referenced by operator<(), and operator==().

142  {
143  return make_entity(*ref_);
144  }
entity make_entity(entity_index_t idx) BOOST_NOEXCEPT_OR_NOTHROW
Definition: entity.hpp:64
bool entity::shared_entity::operator< ( shared_entity const &  rhs) const

Definition at line 151 of file entity.hpp.

References get().

152  {
153  return get() < rhs.get();
154  }
bool entity::shared_entity::operator== ( shared_entity const &  rhs) const

Definition at line 146 of file entity.hpp.

References get().

147  {
148  return get() == rhs.get();
149  }

Constructor & Destructor Documentation

entity::shared_entity::shared_entity ( )

Definition at line 134 of file entity.hpp.

135  {}
entity::shared_entity::shared_entity ( unique_entity &&  ref)

Definition at line 137 of file entity.hpp.

138  : ref_(std::move(ref.ref_))
139  {}