pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:4427:
add_ref(new_node); add_ref(new_node); } /*! @module Builtin */ /*! @class Setter *! *! Internal class for implementing setters.
+
*!
+
*! This class is used by @[_get_setter()].
+
*!
+
*! @seealso
+
*! @[_get_setter()]
*/ PIKECLASS Setter { PIKEVAR object o flags ID_PROTECTED|ID_PRIVATE|ID_LOCAL; CVAR int f;
-
+
+
/*! @decl void `()(mixed val)
+
*!
+
*! Set the variable for the setter to @[val].
+
*!
+
*! This is the function returned by @[_get_setter()].
+
*/
PIKEFUN void `()(mixed val) flags ID_PROTECTED; { if (!THIS->o) { Pike_error("Uninitialized Setter!\n"); } object_low_set_index(THIS->o, THIS->f, Pike_sp-1); pop_n_elems(args); push_int(0); }
pike.git/src/builtin.cmod:4461:
ref_push_object(THIS->o); ref_push_string(ID_FROM_INT(prog, THIS->f)->name); f_sprintf(3); } else { push_constant_text("Setter(destructed object)"); } stack_pop_n_elems_keep_top(args); } }
+
/*! @endclass
+
*/
+
PMOD_EXPORT struct object *get_setter(struct object *o, int f) { struct object *res = clone_object(Setter_program, 0); struct Setter_struct *setter = OBJ2_SETTER(res); add_ref(setter->o = o); setter->f = f; return res; }
-
/*! @decl function(mixed_void) _get_setter(object o, string
s
)
+
/*! @decl function(mixed_void) _get_setter(object o, string
varname
)
*!
-
*! Get a setter for the variable named @[
s
] in object @[o].
+
*! Get a setter for the variable named @[
varname
] in object @[o].
*!
-
+
*! @returns
+
*! Returns a @[Setter()->`()()] for the variable if it exists,
+
*! and @expr{UNDEFINED@} otherwise.
+
*!
*! @seealso *! @[object_variablep()] */ PIKEFUN function(mixed:void) _get_setter(object o, string s) { struct program *p; struct inherit *inh; int f; if (!(p = o->prog)) { Pike_error("Indexing a destructed object.\n");
pike.git/src/builtin.cmod:4498:
if ((f >= 0) && IDENTIFIER_IS_VARIABLE(ID_FROM_INT(p, f)->identifier_flags)) { f += inh->identifier_level; push_function(get_setter(o, f), f_Setter_cq__backtick_28_29_fun_num); } else { push_undefined(); } stack_pop_n_elems_keep_top(args); }
-
/*! @endclass
-
*/
-
+
/*! @class Null *! *! This class is used to implement the low-level aspects of @[Val.Null]. *! *! @note *! This class should typically not be used directly. Use *! @[Val.Null] instead. *! *! @note *! This class was previously available as @[Sql.Null]. Any such use