LogicObject

class rlogic::LogicObject

A base class for all rlogic API objects

Subclassed by rlogic::DataArray, rlogic::LogicNode, rlogic::LuaModule

Public Functions

std::string_view getName() const

Returns the name of this object.

Return

the name of this object

void setName(std::string_view name)

Sets the name of this object.

Parameters
  • name: new name of the object

uint64_t getId() const

Returns the id of this object. Every object gets a unique, immutable id assigned on object creation. The id is serialized and thus persisted on load.

Return

the id of this object

template<typename T>
const T *as() const

Casts this object to given type. Has same behavior as dynamic_cast, will return nullptr (without error) if given type does not match this object.

Return

logic object cast to given type or nullptr if wrong type provided

template<typename T>
T *as()

Casts this object to given type. Has same behavior as dynamic_cast, will return nullptr (without error) if given type does not match this object.

Return

logic object cast to given type or nullptr if wrong type provided

LogicObject(const LogicObject&) = delete

Deleted copy constructor

LogicObject &operator=(const LogicObject&) = delete

Deleted assignment operator

~LogicObject() noexcept

Destructor of LogicObject