Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Olympe::ParameterEditorRegistry Class Reference

Singleton mapping TaskNodeType -> vector of ParameterDescriptor. More...

#include <ParameterEditorRegistry.h>

Public Member Functions

void RegisterNodeType (TaskNodeType nodeType, const std::vector< ParameterDescriptor > &descriptors)
 Registers a set of parameter descriptors for a node type.
 
const std::vector< ParameterDescriptor > & GetNodeParameters (TaskNodeType nodeType) const
 Returns the parameter descriptors for the given node type.
 
const ParameterDescriptorGetParameterDescriptor (TaskNodeType nodeType, const std::string &paramName) const
 Returns the descriptor for a specific parameter of a node type.
 

Static Public Member Functions

static ParameterEditorRegistryGet ()
 Returns the singleton instance.
 

Private Member Functions

 ParameterEditorRegistry ()
 
void InitializeBuiltInParameters ()
 

Private Attributes

std::unordered_map< uint8_t, std::vector< ParameterDescriptor > > m_params
 

Static Private Attributes

static const std::vector< ParameterDescriptors_empty
 Returned by GetNodeParameters when a type has no descriptors.
 

Detailed Description

Singleton mapping TaskNodeType -> vector of ParameterDescriptor.

Definition at line 51 of file ParameterEditorRegistry.h.

Constructor & Destructor Documentation

◆ ParameterEditorRegistry()

Olympe::ParameterEditorRegistry::ParameterEditorRegistry ( )
private

Definition at line 30 of file ParameterEditorRegistry.cpp.

References InitializeBuiltInParameters().

+ Here is the call graph for this function:

Member Function Documentation

◆ Get()

ParameterEditorRegistry & Olympe::ParameterEditorRegistry::Get ( )
static

Returns the singleton instance.

Calls InitializeBuiltInParameters() on first access.

Definition at line 24 of file ParameterEditorRegistry.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ GetNodeParameters()

const std::vector< ParameterDescriptor > & Olympe::ParameterEditorRegistry::GetNodeParameters ( TaskNodeType  nodeType) const

Returns the parameter descriptors for the given node type.

Returns an empty vector if no descriptors have been registered for nodeType.

Parameters
nodeTypeThe node type.
Returns
Reference to the descriptors vector.

Definition at line 50 of file ParameterEditorRegistry.cpp.

References GetComponentTypeID_Static(), m_params, and s_empty.

Referenced by GetParameterDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetParameterDescriptor()

const ParameterDescriptor * Olympe::ParameterEditorRegistry::GetParameterDescriptor ( TaskNodeType  nodeType,
const std::string &  paramName 
) const

Returns the descriptor for a specific parameter of a node type.

Parameters
nodeTypeThe node type.
paramNameParameter name.
Returns
Pointer to the descriptor, or nullptr if not found.

Definition at line 57 of file ParameterEditorRegistry.cpp.

References GetComponentTypeID_Static(), and GetNodeParameters().

+ Here is the call graph for this function:

◆ InitializeBuiltInParameters()

void Olympe::ParameterEditorRegistry::InitializeBuiltInParameters ( )
private

◆ RegisterNodeType()

void Olympe::ParameterEditorRegistry::RegisterNodeType ( TaskNodeType  nodeType,
const std::vector< ParameterDescriptor > &  descriptors 
)

Registers a set of parameter descriptors for a node type.

Overwrites any previously registered descriptors for nodeType.

Parameters
nodeTypeThe node type.
descriptorsOrdered list of parameter descriptors.

Definition at line 39 of file ParameterEditorRegistry.cpp.

References GetComponentTypeID_Static(), and m_params.

Referenced by InitializeBuiltInParameters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_params

std::unordered_map<uint8_t, std::vector<ParameterDescriptor> > Olympe::ParameterEditorRegistry::m_params
private

Definition at line 98 of file ParameterEditorRegistry.h.

Referenced by GetNodeParameters(), and RegisterNodeType().

◆ s_empty

const std::vector< ParameterDescriptor > Olympe::ParameterEditorRegistry::s_empty
staticprivate

Returned by GetNodeParameters when a type has no descriptors.

Definition at line 101 of file ParameterEditorRegistry.h.

Referenced by GetNodeParameters().


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