Class SBCClassFactory#
This class describes a class factory in a class proxy. More...
#include <SBCClassFactory.hpp>
Public Functions#
| Type | Name |
|---|---|
| SBCClassFactory () Constructs a class factory. |
|
| void | addConstructor (SBCClassConstructor * constructor) Adds a constructor to the factory. |
| SBCClassConstructor * | getConstructor (const SBValue & t0=SBValue(), const SBValue & t1=SBValue(), const SBValue & t2=SBValue(), const SBValue & t3=SBValue(), const SBValue & t4=SBValue(), const SBValue & t5=SBValue(), const SBValue & t6=SBValue(), const SBValue & t7=SBValue(), const SBValue & t8=SBValue(), const SBValue & t9=SBValue(), const SBValue & t10=SBValue(), const SBValue & t11=SBValue(), const SBValue & t12=SBValue(), const SBValue & t13=SBValue(), const SBValue & t14=SBValue(), const SBValue & t15=SBValue()) const Returns the constructor with arguments t0 ,t1 , ...,t15 . |
| SBHashMap< std::string, SBCClassConstructor * > const & | getConstructorMap () const Returns the constructor map. |
| unsigned int | getNumberOfConstructors () noexcept const Returns the number of registered constructors. |
| void | print (unsigned int offset=0) const Prints the factory. |
| virtual | ~SBCClassFactory () Destructs the factory. |
Detailed Description#
Short name: SBFactory
Public Functions Documentation#
function SBCClassFactory#
Constructs a class factory.
Constructs a new SBCClassFactory instance.
Initializes the internal map that stores constructors.
function addConstructor#
Adds a constructor to the factory.
Registers the provided constructor in the internal map. If the pointer is null, an error is logged.
Parameters:
constructorPointer to the SBCClassConstructor to add. Must not be null.
function getConstructor#
Returns the constructor with arguments t0 ,t1 , ...,t15 .
SBCClassConstructor * SBCClassFactory::getConstructor (
const SBValue & t0=SBValue (),
const SBValue & t1=SBValue (),
const SBValue & t2=SBValue (),
const SBValue & t3=SBValue (),
const SBValue & t4=SBValue (),
const SBValue & t5=SBValue (),
const SBValue & t6=SBValue (),
const SBValue & t7=SBValue (),
const SBValue & t8=SBValue (),
const SBValue & t9=SBValue (),
const SBValue & t10=SBValue (),
const SBValue & t11=SBValue (),
const SBValue & t12=SBValue (),
const SBValue & t13=SBValue (),
const SBValue & t14=SBValue (),
const SBValue & t15=SBValue ()
) const
Retrieves a constructor matching the provided arguments.
Searches the registered constructors and returns the one that can create an instance with the given arguments. If multiple constructors match, an error is logged and the first match is returned. If none match, nullptr is returned.
Parameters:
t0First argument value (default constructed if not provided).t1Second argument value.t2Third argument value.t3Fourth argument value.t4Fifth argument value.t5Sixth argument value.t6Seventh argument value.t7Eighth argument value.t8Ninth argument value.t9Tenth argument value.t10Eleventh argument value.t11Twelfth argument value.t12Thirteenth argument value.t13Fourteenth argument value.t14Fifteenth argument value.t15Sixteenth argument value.
Returns:
Pointer to a matching SBCClassConstructor, or nullptr if none found.
function getConstructorMap#
Returns the constructor map.
Returns the map of registered constructors.
Provides read-only access to the internal map that associates constructor signatures with their instances.
Returns:
Constant reference to the map of constructors.
function getNumberOfConstructors#
Returns the number of registered constructors.
Retrieves the count of constructors currently stored in the factory.
Returns:
Number of constructors.
function print#
Prints the factory.
Prints information about the factory and its constructors.
Outputs the factory details and a list of registered constructor signatures, indented by the specified offset.
Parameters:
offsetNumber of tab characters to indent the output.
function ~SBCClassFactory#
Destructs the factory.
Destroys the SBCClassFactory instance.
Releases the internal constructor map.