![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Class that represents a template definition. More...
#include <ObjectFile.h>
Public Member Functions | |
DLLEXPORT | ObjectFileTemplateDefinition (const std::string &name, std::vector< std::unique_ptr< std::string >> ¶meters, std::shared_ptr< ObjectFileObject > obj) |
Creates a ObjectFileTemplateDefinition. More... | |
DLLEXPORT const std::string & | GetName () const |
Gets the name of this template. More... | |
DLLEXPORT std::unique_ptr< ObjectFileTemplateObject > | CreateInstanceFromThis (const ObjectFileTemplateInstance &instanceargs, LErrorReporter *reporterror=nullptr) |
Creates an instance from this template. More... | |
DLLEXPORT std::string | Serialize () const |
Static Public Member Functions | |
static DLLEXPORT std::shared_ptr< ObjectFileTemplateDefinition > | CreateFromObject (const std::string &name, std::shared_ptr< ObjectFileObject > obj, std::vector< std::unique_ptr< std::string >> &templateargs) |
Creates a ObjectFileTemplateDefinition from an ObjectFileObject and a parameter list. More... | |
Protected Member Functions | |
void | ReplaceStringWithTemplateArguments (std::string &target, const std::vector< std::unique_ptr< std::string >> &args) |
std::string | ReplaceStringTemplateArguments (const std::string &target, const std::vector< std::unique_ptr< std::string >> &args) |
Protected Attributes | |
std::string | Name |
Name of this template. More... | |
std::vector< std::unique_ptr< std::string > > | Parameters |
Template parameter definitions. More... | |
std::shared_ptr< ObjectFileObject > | RepresentingObject |
The object from which the instances are created. More... | |
Class that represents a template definition.
Potentially allow changing the definition to update instantiations
Make this more robust and nice and reduce the bloat in the implementation
Definition at line 310 of file ObjectFile.h.
DLLEXPORT Leviathan::ObjectFileTemplateDefinition::ObjectFileTemplateDefinition | ( | const std::string & | name, |
std::vector< std::unique_ptr< std::string >> & | parameters, | ||
std::shared_ptr< ObjectFileObject > | obj | ||
) |
Creates a ObjectFileTemplateDefinition.
Definition at line 512 of file ObjectFile.cpp.
|
static |
Creates a ObjectFileTemplateDefinition from an ObjectFileObject and a parameter list.
obj | The object from which to construct the template, the pointer will be deleted by this |
Definition at line 523 of file ObjectFile.cpp.
DLLEXPORT std::unique_ptr< Leviathan::ObjectFileTemplateObject > ObjectFileTemplateDefinition::CreateInstanceFromThis | ( | const ObjectFileTemplateInstance & | instanceargs, |
LErrorReporter * | reporterror = nullptr |
||
) |
Creates an instance from this template.
Refactor this function to be smaller
Allow objects to use the special defined values in the ObjectFileProcessor
Definition at line 557 of file ObjectFile.cpp.
DLLEXPORT const string & Leviathan::ObjectFileTemplateDefinition::GetName | ( | ) | const |
Gets the name of this template.
Definition at line 518 of file ObjectFile.cpp.
|
protected |
Definition at line 764 of file ObjectFile.cpp.
|
protected |
Definition at line 752 of file ObjectFile.cpp.
DLLEXPORT std::string Leviathan::ObjectFileTemplateDefinition::Serialize | ( | ) | const |
Definition at line 532 of file ObjectFile.cpp.
|
protected |
Name of this template.
Definition at line 350 of file ObjectFile.h.
|
protected |
Template parameter definitions.
Definition at line 353 of file ObjectFile.h.
|
protected |
The object from which the instances are created.
Definition at line 356 of file ObjectFile.h.