Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
Loading...
Searching...
No Matches
Fiea::Engine::Content::Attributed Class Reference

#include <Attributed.h>

Inheritance diagram for Fiea::Engine::Content::Attributed:
[legend]
Collaboration diagram for Fiea::Engine::Content::Attributed:
[legend]

Public Member Functions

 Attributed ()=delete
 Attributed (std::function< ClassDefinition()> defGenerator, const RTTI::IdType &idType)
 Constructor that initializes class attributes based on the provided class definition generator.
 Attributed (const Attributed &other)
 Copy constructor for Attributed.
 Attributed (Attributed &&other) noexcept
 Move constructor for Attributed.
Attributedoperator= (const Attributed &rhs)
 Copy assignment operator.
Attributedoperator= (Attributed &&rhs) noexcept
 Move assignment operator.
virtual ~Attributed ()=default
AttributedClone () const override
 Creates a deep copy of this Attributed object.
bool IsAttribute (const string &key)
 Checks if a given key is an attribute.
bool IsClassAttribute (const string &key)
 Checks if a given key is a class attribute.
bool IsInstanceAttribute (const string &key)
 Checks if a given key is an instance attribute.
DatumAppendInstanceAttribute (const string &key)
 Appends a new instance attribute.
std::vector< stringAttributes ()
 Retrieves all attribute names.
std::vector< stringClassAttributes ()
 Retrieves all class attribute names.
std::vector< stringInstanceAttributes ()
 Retrieves all instance attribute names.
Public Member Functions inherited from Fiea::Engine::Content::Scope
 Scope ()=default
 Scope (const Scope &rhs)
 Copy constructor.
 Scope (Scope &&rhs) noexcept
 Move constructor.
Scopeoperator= (const Scope &rhs)
 Copy assignment operator.
Scopeoperator= (Scope &&rhs) noexcept
 Move assignment operator.
virtual ~Scope ()
 Destructor. Clears the Scope.
bool operator== (const Scope &rhs) const
 Equality operator.
bool operator!= (const Scope &rhs) const
 Inequality operator.
DatumFind (const string &key)
 Finds a Datum by key.
const DatumFind (const string &key) const
 Finds a Datum by key (const version).
DatumAppend (const string &key)
 Appends a new Datum with the given key.
void RemoveDatum (const string &key)
DatumSearch (const string &key)
Datumoperator[] (const string &key)
 Overloads operator[] for accessing a Datum by key. If the key does not exist in the Scope, it is appended.
Datumoperator[] (size_t idx)
 Overloads operator[] for accessing a Datum by index. Retrieves the Datum corresponding to the given index in the ordered list.
size_t Size () const
 Returns the number of key-value pairs in the Scope.
void Clear ()
 Clears all data in the Scope.
ScopeAppendScope (const string &key, Scope *scope=nullptr)
 Appends a new Scope as a child under the specified key.
void Adopt (const string &key, Scope &child)
 Adopts an existing Scope as a child under the specified key.
ScopeGetParent () const
void SetParent (Scope &parent)
ScopeOrphan ()
 Removes this Scope from its parent.
DatumFindContainedScope (const Scope &child, size_t &idx)
 Finds the Datum that contains the specified child Scope.
const DatumFindContainedScope (const Scope &child, size_t &idx) const
 Finds the Datum that contains the specified child Scope (const version).
bool IsAncestorOf (const Scope &descendent) const
 Checks if this Scope is an ancestor of the specified descendent Scope.
bool IsDescendentOf (const Scope &ancestor) const
 Checks if this Scope is a descendent of the specified ancestor Scope.
Public Member Functions inherited from Fiea::Engine::RTTI
 RTTI ()=default
 RTTI (const RTTI &)=default
RTTIoperator= (const RTTI &)=default
 RTTI (RTTI &&) noexcept=default
RTTIoperator= (RTTI &&) noexcept=default
virtual ~RTTI ()=default
virtual IdType TypeIdInstance () const =0
virtual bool Is (IdType) const
template<typename T>
T * As ()
template<typename T>
const T * As () const
virtual std::string ToString () const
virtual bool Equals (const RTTI *rhs) const

Additional Inherited Members

Public Types inherited from Fiea::Engine::RTTI
using IdType = std::size_t
Protected Member Functions inherited from Fiea::Engine::Content::Scope
std::vector< const string * > GetOrderedDatums ()

Constructor & Destructor Documentation

◆ Attributed() [1/4]

Fiea::Engine::Content::Attributed::Attributed ( )
delete
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Attributed() [2/4]

Fiea::Engine::Content::Attributed::Attributed ( std::function< ClassDefinition()> defGenerator,
const RTTI::IdType & idType )
explicit

Constructor that initializes class attributes based on the provided class definition generator.

Parameters
defGeneratorA function that generates a class definition.
idTypeThe RTTI IdType of the class.
Here is the call graph for this function:

◆ Attributed() [3/4]

Fiea::Engine::Content::Attributed::Attributed ( const Attributed & other)

Copy constructor for Attributed.

Parameters
otherThe Attributed object to copy from.
Here is the call graph for this function:

◆ Attributed() [4/4]

Fiea::Engine::Content::Attributed::Attributed ( Attributed && other)
noexcept

Move constructor for Attributed.

Parameters
otherThe Attributed object to move from.
Here is the call graph for this function:

◆ ~Attributed()

virtual Fiea::Engine::Content::Attributed::~Attributed ( )
virtualdefault
Here is the call graph for this function:

Member Function Documentation

◆ AppendInstanceAttribute()

Datum & Fiea::Engine::Content::Attributed::AppendInstanceAttribute ( const string & key)

Appends a new instance attribute.

Parameters
keyThe name of the new instance attribute.
Returns
Reference to the appended Datum object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Attributes()

std::vector< string > Fiea::Engine::Content::Attributed::Attributes ( )

Retrieves all attribute names.

Returns
A vector of all attribute names.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClassAttributes()

std::vector< string > Fiea::Engine::Content::Attributed::ClassAttributes ( )

Retrieves all class attribute names.

Returns
A vector of class attribute names.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clone()

Attributed * Fiea::Engine::Content::Attributed::Clone ( ) const
nodiscardoverridevirtual

Creates a deep copy of this Attributed object.

Returns
A pointer to the cloned object.

Reimplemented from Fiea::Engine::Content::Scope.

Reimplemented in Fiea::Engine::GameObject.

Here is the call graph for this function:

◆ InstanceAttributes()

std::vector< string > Fiea::Engine::Content::Attributed::InstanceAttributes ( )

Retrieves all instance attribute names.

Returns
A vector of instance attribute names.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAttribute()

bool Fiea::Engine::Content::Attributed::IsAttribute ( const string & key)

Checks if a given key is an attribute.

Parameters
keyThe attribute key to check.
Returns
True if the key exists as an attribute, otherwise false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsClassAttribute()

bool Fiea::Engine::Content::Attributed::IsClassAttribute ( const string & key)

Checks if a given key is a class attribute.

Parameters
keyThe attribute key to check.
Returns
True if the key is a class attribute, otherwise false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInstanceAttribute()

bool Fiea::Engine::Content::Attributed::IsInstanceAttribute ( const string & key)

Checks if a given key is an instance attribute.

Parameters
keyThe attribute key to check.
Returns
True if the key is an instance attribute, otherwise false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

Attributed & Fiea::Engine::Content::Attributed::operator= ( Attributed && rhs)
noexcept

Move assignment operator.

Parameters
rhsThe Attributed object to move from.
Returns
Reference to this Attributed object.
Here is the call graph for this function:

◆ operator=() [2/2]

Attributed & Fiea::Engine::Content::Attributed::operator= ( const Attributed & rhs)

Copy assignment operator.

Parameters
rhsThe Attributed object to copy from.
Returns
Reference to this Attributed object.
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: