Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Procedural::ComponentID Struct Reference

Unique identifier for a procedural component. More...

#include <ComponentID.hpp>

Public Member Functions

 ComponentID ()=default
 Default constructor.
 
 ComponentID (const std::string &group, const std::string &name)
 Constructs a ComponentID from separate group and name strings.
 
 ComponentID (const std::string &combinedGroupName)
 Constructs a ComponentID from a combined group.name string.
 
bool operator== (const ComponentID &rhs) const noexcept
 Equality comparison operator.
 
std::string str () const
 Converts the ComponentID to its string representation.
 

Public Attributes

std::string group
 The component's group/namespace identifier.
 
std::string name
 The component's name within the group.
 

Detailed Description

Unique identifier for a procedural component.

ComponentID provides a two-part identification system for procedural components, consisting of a group (namespace) and a name. This allows components to be organized hierarchically and avoids naming conflicts between plugins.

Component IDs can be constructed from separate group and name strings, or from a combined string representation (e.g., "MyCompany.Components.MeshGenerator").

Example usage:

// Construct from separate group and name
ComponentID id1("MyCompany.Components", "MeshGenerator");
// Construct from combined string
ComponentID id2("MyCompany.Components.MeshGenerator");
// Compare IDs
if (id1 == id2) {
// IDs are equal
}
Unique identifier for a procedural component.
Definition ComponentID.hpp:35

Constructor & Destructor Documentation

◆ ComponentID() [1/3]

Infinity::Procedural::ComponentID::ComponentID ( )
default

Default constructor.

Creates an empty ComponentID with no group or name.

◆ ComponentID() [2/3]

Infinity::Procedural::ComponentID::ComponentID ( const std::string &  group,
const std::string &  name 
)

Constructs a ComponentID from separate group and name strings.

Parameters
groupThe component's group/namespace (e.g., "MyCompany.Components").
nameThe component's name within the group (e.g., "MeshGenerator").

◆ ComponentID() [3/3]

Infinity::Procedural::ComponentID::ComponentID ( const std::string &  combinedGroupName)

Constructs a ComponentID from a combined group.name string.

Parses a dot-separated string to extract the group and name components. The last segment after the final dot is treated as the name, and everything before it is treated as the group.

Parameters
combinedGroupNameCombined string (e.g., "MyCompany.Components.MeshGenerator").

Member Function Documentation

◆ operator==()

bool Infinity::Procedural::ComponentID::operator== ( const ComponentID rhs) const
noexcept

Equality comparison operator.

Two ComponentIDs are equal if both their group and name match.

Parameters
rhsThe ComponentID to compare against.
Returns
True if the ComponentIDs are equal, false otherwise.

◆ str()

std::string Infinity::Procedural::ComponentID::str ( ) const

Converts the ComponentID to its string representation.

Returns the combined "group.name" string form of this ComponentID.

Returns
String representation in the format "group.name".

Member Data Documentation

◆ group

std::string Infinity::Procedural::ComponentID::group

The component's group/namespace identifier.

◆ name

std::string Infinity::Procedural::ComponentID::name

The component's name within the group.