Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 5.32 KB

File metadata and controls

37 lines (31 loc) · 5.32 KB

class MapElement

Member values

Member name Data type Description
event MapEvent Map event that occured
action Action Action to invoke upon event occurence
name string Map element friendly name

Member functions

Function name Return type Input type Description
has_event() const bool void Returns true if event is set.
event() const MapEvent& void Returns the current value of event. If event is not set, returns a MapEvent with none of its fields set (possibly event::default_instance()).
mutable_event() MapEvent * void Returns a pointer to the mutable MapEvent object that stores the field's value. If the field was not set prior to the call, then the returned MapEvent will have none of its fields set (i.e. it will be identical to a newly-allocated MapEvent). After calling this, has_event() will return true and event() will return a reference to the same instance of MapEvent.
clear_event() void void Clears the value of the field. After calling this, has_event() will return false and event() will return the default value.
set_allocated_event() void MapEvent * Sets the MapEvent object to the field and frees the previous field value if it exists. If the MapEvent pointer is not NULL, the message takes ownership of the allocated MapEvent object and has_ MapEvent() will return true. Otherwise, if the event is NULL, the behavior is the same as calling clear_event().
release_event() MapEvent * void Releases the ownership of the field and returns the pointer of the MapEvent object. After calling this, caller takes the ownership of the allocated MapEvent object, has_event() will return false, and event() will return the default value.
has_action() const bool void Returns true if action is set.
action() const Action& void Returns the current value of action. If action is not set, returns a Action with none of its fields set (possibly action::default_instance()).
mutable_action() Action * void Returns a pointer to the mutable Action object that stores the field's value. If the field was not set prior to the call, then the returned Action will have none of its fields set (i.e. it will be identical to a newly-allocated Action). After calling this, has_action() will return true and action() will return a reference to the same instance of Action.
clear_action() void void Clears the value of the field. After calling this, has_action() will return false and action() will return the default value.
set_allocated_action() void Action * Sets the Action object to the field and frees the previous field value if it exists. If the Action pointer is not NULL, the message takes ownership of the allocated Action object and has_ Action() will return true. Otherwise, if the action is NULL, the behavior is the same as calling clear_action().
release_action() Action * void Releases the ownership of the field and returns the pointer of the Action object. After calling this, caller takes the ownership of the allocated Action object, has_action() will return false, and action() will return the default value.
name() const string& void Returns the current value of name. If name is not set, returns the empty string/empty bytes.
set_name() void const string& Sets the value of name. After calling this, name() will return a copy of value.
set_name() void string&& (C++11 and beyond): Sets the value of name, moving from the passed string. After calling this, name() will return a copy of value.
set_name() void const char* Sets the value of name using a C-style null-terminated string. After calling this, name() will return a copy of value.
mutable_name() string * void Returns a pointer to the mutable string object that stores name's value. If the field was not set prior to the call, then the returned string will be empty. After calling this, name() will return whatever value is written into the given string.
clear_name() void void Clears the value of name. After calling this, name() will return the empty string/empty bytes.
set_allocated_name() void string* Sets the string object to the field and frees the previous field value if it exists. If the string pointer is not NULL, the message takes ownership of the allocated string object. The message is free to delete the allocated string object at any time, so references to the object may be invalidated. Otherwise, if the value is NULL, the behavior is the same as calling clear_name().
release_name() string * void Releases the ownership of name and returns the pointer of the string object. After calling this, caller takes the ownership of the allocated string object and name() will return the empty string/empty bytes.

Parent topic: Base (C++)