
|
|
This file was automatically generated from diguyVariable.h. Do not edit this file directly; the changes will be lost.Includes: diguy_constants.h | diguy_typedefs.h | declspec_diguy.h
Contents:
Alphabetical IndexLink against: libdiguy
class diguyVariable
|
class BDI_DECLSPEC_diguy diguyVariable { public: const char* get_name(); int set_name(const char* name); const char* get_type_name(); diguyScenario* get_scenario(); diguyCharacter* get_character(); int copy(diguyVariable* rhs); int get_value_as_int(); float get_value_as_float(); const char* get_value_as_string(); int set_value_as_int(int value); int set_value_as_float(float value); int set_value_as_string(const char* value); int increment_value_as_int(int increment_amount = 1); int decrement_value_as_int(int decrement_amount = 1); int equal_to_int(int value); int greater_than_int(int value); int less_than_int(int value); int equal_to_float(float value); int greater_than_float(float value); int less_than_float(float value); int equal_to_string(const char* value); int greater_than_string(const char* value); int less_than_string(const char* value); int get_initial_value_as_int(); float get_initial_value_as_float(); const char* get_initial_value_as_string(); int set_initial_value_as_int(int initial_value); int set_initial_value_as_float(float initial_value); int set_initial_value_as_string(const char* initial_value); enum { CALLBACK_ID_VALUE_CHANGED = 1 }; #ifdef CPLUSPLUS_ONLY int add_callback(int callback_id, diguyVariableCallback* callback, void* callback_params = 0, void* callback_user_data = 0); int remove_callback(int callback_id, diguyVariableCallback* callback); int remove_callback_with_user_data(int callback_id, void* callback_user_data); int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL); int map_event_handler_to_callback_id(int callback_id, const char* handler_name); int unmap_event_handler_from_callback_id(int callback_id, const char* handler_name, int unmap_all_matches = 0);
function diguyVariable::get_name |
Prototype:
Description:const char* get_name();
Returns the name of the variable. This pointer will never be NULL.Returns:
name of the variableCallable From:
- C++
- Script
function diguyVariable::set_name |
Prototype:
Description:int set_name(const char* name);
This function sets the name of this object.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::get_type_name |
Prototype:
Description:const char* get_type_name();
Returns the type name of the object. This pointer will never be NULL.Returns:
type name of the objectCallable From:
- C++
- Script
function diguyVariable::get_scenario |
Prototype:
Description:diguyScenario* get_scenario();
Returns the scenario that this variable belongs to. This pointer will never be NULL. Note that if this variable belongs to a character, a pointer to the scenario that the character belongs to will be returned.Returns:
pointer of type diguyScenarioCallable From:
- C++
- Script
function diguyVariable::get_character |
Prototype:
Description:diguyCharacter* get_character();
Returns the character that this variable belongs to, if any. This pointer might be NULL is this variable is not a character variable.Returns:
pointer of type diguyCharacter; NULL if this variable is not a character variableCallable From:
- C++
- Script
function diguyVariable::copy |
Prototype:
Description:int copy(diguyVariable* rhs);
Copies the contents of the passed variable.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::get_value_as_int |
Prototype:
Description:int get_value_as_int();
Returns the value of the variable as an integer.Returns:
value of the variableCallable From:
- C++
- Script
function diguyVariable::get_value_as_float |
Prototype:
Description:float get_value_as_float();
Returns the value of the variable as a floating point number.Returns:
value of the variableCallable From:
- C++
- Script
function diguyVariable::get_value_as_string |
Prototype:
Description:const char* get_value_as_string();
Returns the value of the variable as a string. This pointer will never be NULL.Returns:
value of the variableCallable From:
- C++
- Script
function diguyVariable::set_value_as_int |
Prototype:
Description:int set_value_as_int(int value);
This function sets the value as an integer.Arguments:
Returns:
value new value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::set_value_as_float |
Prototype:
Description:int set_value_as_float(float value);
This function sets the value as a floating point number.Arguments:
Returns:
value new value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::set_value_as_string |
Prototype:
Description:int set_value_as_string(const char* value);
This function sets the value as a string.Arguments:
Returns:
value new value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::increment_value_as_int |
Prototype:
Description:int increment_value_as_int(int increment_amount = 1);
This function increments the value as an int.Arguments:
Returns:
increment_amount the value by which to increment
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::decrement_value_as_int |
Prototype:
Description:int decrement_value_as_int(int decrement_amount = 1);
This function decrements the value as an int.Arguments:
Returns:
decrement_amount the value by which to decrement
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::equal_to_int |
Prototype:
Returns:int equal_to_int(int value);
1 if the variable as an int is equal to the passed value; 0 if notArguments:
Returns:
value the value to compare against
0 on success, -1 on failureCallable From:
- C++
- Script
- Decision Bead
function diguyVariable::greater_than_int |
Prototype:
Returns:int greater_than_int(int value);
1 if the variable as an int is greater than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::less_than_int |
Prototype:
Returns:int less_than_int(int value);
1 if the variable as an int is less than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::equal_to_float |
Prototype:
Returns:int equal_to_float(float value);
1 if the variable as a float is equal to the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::greater_than_float |
Prototype:
Returns:int greater_than_float(float value);
1 if the variable as a float is greater than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::less_than_float |
Prototype:
Returns:int less_than_float(float value);
1 if the variable as a float is less than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::equal_to_string |
Prototype:
Returns:int equal_to_string(const char* value);
1 if the variable as a string is equal to the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::greater_than_string |
Prototype:
Returns:int greater_than_string(const char* value);
1 if the variable as a string is alphabetically greater than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::less_than_string |
Prototype:
Returns:int less_than_string(const char* value);
1 if the variable as a string is alphabetically less than the passed value; 0 if notArguments:
Callable From:
value the value to compare against
- C++
- Script
- Decision Bead
function diguyVariable::get_initial_value_as_int |
Prototype:
Description:int get_initial_value_as_int();
Returns the initial value of the variable as an integer.Returns:
initial value of the variableCallable From:
- C++
- Script
function diguyVariable::get_initial_value_as_float |
Prototype:
Description:float get_initial_value_as_float();
Returns the initial value of the variable as a floating point number.Returns:
initial value of the variableCallable From:
- C++
- Script
function diguyVariable::get_initial_value_as_string |
Prototype:
Description:const char* get_initial_value_as_string();
Returns the initial value of the variable as a string. This pointer will never be NULL.Returns:
initial value of the variableCallable From:
- C++
- Script
function diguyVariable::set_initial_value_as_int |
Prototype:
Description:int set_initial_value_as_int(int initial_value);
This function sets the initial value as an integer. The current value will be set to the initial value when the scenario containing this variable is reset.Arguments:
Returns:
initial value new initial value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::set_initial_value_as_float |
Prototype:
Description:int set_initial_value_as_float(float initial_value);
This function sets the initial value as a floating point number. The current value will be set to the initial value when the scenario containing this variable is reset.Arguments:
Returns:
initial value new initial value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::set_initial_value_as_string |
Prototype:
Description:int set_initial_value_as_string(const char* initial_value);
This function sets the initial value as a string. The current value will be set to the initial value when the scenario containing this variable is reset.Arguments:
Returns:
initial value new initial value of variable
0 on success, -1 on failureCallable From:
- C++
- Script
| Callback Functions |
enumeration |
Description:enum { CALLBACK_ID_VALUE_CHANGED = 1 };
This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().Usable From:
- C++
- Script
function diguyVariable::add_callback |
Prototype:
Description:int add_callback(int callback_id, diguyVariableCallback* callback, void* callback_params = 0, void* callback_user_data = 0);
This function adds a user callback.Arguments:
callback pointer to function with prototype diguyVariableCallback (typedefed above) callback_id integer id of when this callback is to be called callback_params not currently used; pass NULL callback_user_data pointer for user's own use; DI-Guy will do nothing to the contents of this pointer beyond passing it back when the callback is invoked callback_id should be one of the following values:CALLBACK_ID_VALUE_CHANGED
This callback will be called whenever the value of the variable changes.
There are no parameters for this callback.Callback Return Values:
Callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the callback returns DIGUY_CALLBACK_STOP, the default handler of the function will not be called; the callback is asserting that it has done everything necessary for the function call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default handler for the function will be called after the callback.Returns:
0 on success, -1 on failureCallable From:
- C++
function diguyVariable::remove_callback |
Prototype:
Description:int remove_callback(int callback_id, diguyVariableCallback* callback);
This function removes a user callback. All callbacks matching the specified callback_id and callback function will be removed.Arguments:
Returns:
callback_id integer id of when this callback is to be called callback pointer to function with prototype diguyVariableCallback (typedefed above)
0 on success, -1 on failureCallable From:
- C++
function diguyVariable::remove_callback_with_user_data |
Prototype:
Description:int remove_callback_with_user_data(int callback_id, void* callback_user_data);
This function removes a user callback. All callbacks matching the specified callback_id and callback_user_data pointer will be removed.Arguments:
Returns:
callback_id integer id of when this callback is to be called callback_user_data pointer for user's own use
0 on success, -1 on failureCallable From:
- C++
function diguyVariable::add_callback_script |
Prototype:
Description:int add_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function adds a user callback script. Callback scripts can be removed with remove_callback_script().
See diguyCharacter::add_callback_script() for an example of use.Arguments:
callback_id integer id of the callback callback_script script text of callback to be added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.Lua specific:
When the script is called, the object for which it is being called will be in the callback_object global.
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::remove_callback_script |
Prototype:
Description:int remove_callback_script(int callback_id, const char* callback_script, const char* callback_script_type = NULL);
This function removes a user callback script previously added with add_callback_script().
See diguyCharacter::remove_callback_script() for an example of use.Arguments:
callback_id integer id of the callback callback_script script text of callback previously added callback_script_type the type of script contained in callback_script If NULL is passed for callback_script, all callback scripts whose ids match callback_id and whose types match callback_script_type will be removed.
If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.Lua specific:
To pass NULL when calling from a lua script, use nil.Returns:
0 on success, -1 on failureCallable From:
- C++
- Script
| Event Handler Functions |
function diguyVariable::map_event_handler_to_callback_id |
Prototype:
Description:int map_event_handler_to_callback_id(int callback_id, const char* handler_name);
This function maps the event handler with the given name to a callback id. This mapping will be saved in the .dss file and restored when the .dss file is loaded.
Mappings can also be made via the DI-Guy Scenario UI.
The event handler is one of the following:
Arguments:
- a variable callback function registered by diguyScenario::register_variable_event_handler() or diguyScenario::register_variable_event_handler_from_library()
- a script registered by diguyScenario::register_variable_event_handler_script()
- a Script, Decision, or Library Function in the scenario whose "Event Type" is "Variable"
Returns:
callback_id integer id of callback handler_name name of the event handler to map
0 on success, -1 on failureCallable From:
- C++
- Script
function diguyVariable::unmap_event_handler_from_callback_id |
Prototype:
Description:int unmap_event_handler_from_callback_id(int callback_id, const char* handler_name, int unmap_all_matches = 0);
This function unmaps the event handler with the given name from a callback id.Arguments:
Returns:
callback_id integer id of callback handler_name name of the event handler to map unmap_all_matches pass 0 to unmap only the first match, pass 1 to unmap all matches
0 on success, -1 on failureCallable From:
- C++
- Script
ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs contain unpublished proprietary information of Boston Dynamics and are protected by Copyright Laws of the United States. They may not be used, duplicated, or disclosed in any form, in whole or in part, without the prior written consent from Boston Dynamics.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the government is subject to restrictions as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Sofware clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the Commercial Computer Software--Restricted Rights at 48 CFR 52.227-19, as applicable. Unpublished-rights reserved under the Copyright Laws of the United States.
Contractor/Manufacturer is:
Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.