NAP
Public Member Functions | Static Public Member Functions | List of all members
EntityPtr Class Reference

#include <entityptr.h>

Public Member Functions

 EntityPtr ()=default
 
 EntityPtr (Entity *entity)
 
const std::string & getInstancePath () const
 
std::string toString () const
 
void assign (const std::string &targetID, rtti::Object &targetObject)
 
const Entityoperator* () const
 
Entityoperator* ()
 
const Entityoperator-> () const
 
Entityoperator-> ()
 
bool operator== (const EntityPtr &other) const
 
bool operator== (std::nullptr_t) const
 
bool operator!= (const EntityPtr &other) const
 
bool operator!= (std::nullptr_t) const
 
bool operator< (const EntityPtr &other) const
 
bool operator> (const EntityPtr &other) const
 
bool operator<= (const EntityPtr &other) const
 
bool operator>= (const EntityPtr &other) const
 
Entityget () const
 
Entityget ()
 

Static Public Member Functions

static std::string translateTargetID (const std::string &targetID)
 

Constructor & Destructor Documentation

◆ EntityPtr() [1/2]

EntityPtr ( )
default

◆ EntityPtr() [2/2]

EntityPtr ( Entity entity)

Member Function Documentation

◆ assign()

void assign ( const std::string &  targetID,
rtti::Object targetObject 
)

Assign the target ID & object to this pointer. Used for pointer resolving by the ResourceManager, should not be called manually (is only public so that we can register it in RTTI)

Parameters
targetIDThe ID of the target
targetObjectThe pointer to be assigned

◆ get() [1/2]

Entity* get ( )

◆ get() [2/2]

Entity* get ( ) const

◆ getInstancePath()

const std::string& getInstancePath ( ) const

◆ operator!=() [1/2]

bool operator!= ( const EntityPtr other) const

◆ operator!=() [2/2]

bool operator!= ( std::nullptr_t  ) const

◆ operator*() [1/2]

Entity& operator* ( )

◆ operator*() [2/2]

const Entity& operator* ( ) const

◆ operator->() [1/2]

Entity* operator-> ( )

◆ operator->() [2/2]

const Entity* operator-> ( ) const

◆ operator<()

bool operator< ( const EntityPtr other) const

◆ operator<=()

bool operator<= ( const EntityPtr other) const

◆ operator==() [1/2]

bool operator== ( const EntityPtr other) const

◆ operator==() [2/2]

bool operator== ( std::nullptr_t  ) const

◆ operator>()

bool operator> ( const EntityPtr other) const

◆ operator>=()

bool operator>= ( const EntityPtr other) const

◆ toString()

std::string toString ( ) const

Convert the pointer to a string for serialization

Returns
The string representation of this object

◆ translateTargetID()

static std::string translateTargetID ( const std::string &  targetID)
static

Convert the full target ID as specified to an ID that can be resolved to an object

Parameters
targetIDThe target ID to translate
Returns
The translated ID