Pure virtual class to register script accessible entries through the use of sf::ScriptGlobalObject class.
More...
#include <ScriptGlobalEntry.h>
|
static bool | call (const std::string &name, const Value::vector_type &arguments, Value &result) |
| Finds the function with name 'name' and returns true when the function was found passing the correct amount of parameters. When found the function is also executed.
|
|
static ScriptGlobalEntry * | getEntry (const std::string &name) |
| Gets the entry pointer by name.
|
|
|
static constexpr size_t | unlimitedArgs = std::numeric_limits<int>::max() |
| Unsigned size value indicating not found or no index.
|
|
|
std::string | _name |
| Holds the name of the entry.
|
|
std::string | _description |
| Holds description of the entry.
|
|
int | _argumentCount {0} |
| Holds the number of parameters to pass to the entry.
|
|
Pure virtual class to register script accessible entries through the use of sf::ScriptGlobalObject class.
◆ ScriptGlobalEntry() [1/2]
sf::ScriptGlobalEntry::ScriptGlobalEntry |
( |
const std::string & |
name, |
|
|
const std::string & |
description, |
|
|
int |
argumentCount |
|
) |
| |
Default Constructor adding itself to the global mapped entries.
- Parameters
-
name | Name of the function. |
description | Description of the function. |
argumentCount | Amount of arguments needed. |
◆ ~ScriptGlobalEntry()
virtual sf::ScriptGlobalEntry::~ScriptGlobalEntry |
( |
| ) |
|
|
virtual |
Destructor. Removes itself from the mapped entries.
◆ ScriptGlobalEntry() [2/2]
◆ call() [1/2]
static bool sf::ScriptGlobalEntry::call |
( |
const std::string & |
name, |
|
|
const Value::vector_type & |
arguments, |
|
|
Value & |
result |
|
) |
| |
|
static |
Finds the function with name 'name' and returns true when the function was found passing the correct amount of parameters. When found the function is also executed.
- Parameters
-
name | Name of the entry. |
arguments | Required arguments. |
result | Result from the call. |
- Returns
◆ call() [2/2]
Must be implemented to be able to call the function.
◆ getArgumentCount()
int sf::ScriptGlobalEntry::getArgumentCount |
( |
| ) |
const |
|
inline |
Gets the amount of parameters that is needed for this function.
- Returns
- When unlimitedArgs is unlimited, -2 is the same a unlimited but at least 2 arguments.
◆ getDescription()
std::string sf::ScriptGlobalEntry::getDescription |
( |
| ) |
const |
|
inline |
Gets the description of the entry.
◆ getEntry()
static ScriptGlobalEntry * sf::ScriptGlobalEntry::getEntry |
( |
const std::string & |
name | ) |
|
|
static |
Gets the entry pointer by name.
- Parameters
-
- Returns
- nullptr when not found.
◆ getName()
std::string sf::ScriptGlobalEntry::getName |
( |
| ) |
const |
|
inline |
Gets the name of the entry.
◆ operator=()
◆ setDescription()
void sf::ScriptGlobalEntry::setDescription |
( |
const std::string & |
description | ) |
|
|
inline |
Sets the description of the entry.
◆ _argumentCount
int sf::ScriptGlobalEntry::_argumentCount {0} |
|
protected |
Holds the number of parameters to pass to the entry.
◆ _description
std::string sf::ScriptGlobalEntry::_description |
|
protected |
Holds description of the entry.
◆ _name
std::string sf::ScriptGlobalEntry::_name |
|
protected |
Holds the name of the entry.
◆ unlimitedArgs
constexpr size_t sf::ScriptGlobalEntry::unlimitedArgs = std::numeric_limits<int>::max() |
|
staticconstexpr |
Unsigned size value indicating not found or no index.
The documentation for this class was generated from the following file: