Ferreteria/v0.5/@cls/cStati: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.5‎ | @cls
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
&rarr; {{l/ver/class|cArgs}}
&rarr; {{l/ver/class|cArgs}}
|}
|}
* '''Source''': {{l/ferreteria/code|util/array/args.php}}
==About==
==About==
This class is similar in form to {{l/ver/class|cLocal}} in that it wraps an array, but the value of each element must be a Status object ({{l/ver/class|status\caBase}} podling). It will automatically create Status objects for each element requested. There is a default class, which can be overridden by name (overrides are stored in an array).
This class is similar in form to {{l/ver/class|cLocal}} in that it wraps an array, but the value of each element must be a Status object ({{l/ver/class|status\caBase}} podling). It will automatically create Status objects for each element requested. There is a default class, which can be overridden by name (overrides are stored in an array).
Line 15: Line 16:
** If a cell has a value, that value is the Status object.
** If a cell has a value, that value is the Status object.
** The value ultimately being stored is the Status object's value.
** The value ultimately being stored is the Status object's value.
** Accessing the value (if already set) then looks like this: [array]->GetCell(name)->GetIt()
** Internal access to an already-set value then looks like this: [array object]->GetCell(name)->GetIt().
==History==
==History==
* '''2022-07-28''' Created from just the generic parts (i.e. most) of cArgs.
* '''2022-07-28''' Created from just the generic parts (i.e. most) of cArgs.
** There was a class of this same name many months ago, but this one was created from scratch without referring to that old code.
** There was a class of this same name many months ago, but this one was created from scratch without referring to that old code.

Latest revision as of 20:35, 28 July 2022

Ferreteria class ferret\arr\cStati

[ cLocal > ] cStaticArgs

About

This class is similar in form to cLocal in that it wraps an array, but the value of each element must be a Status object (status\caBase podling). It will automatically create Status objects for each element requested. There is a default class, which can be overridden by name (overrides are stored in an array).

This class uses cLocal for a private object, but does not descend from it. This class used to descend from cLocal, but that caused problems with inconsistent usage (some callers put in values directly, rather than using status objects) and language structure made it easier to prevent this if it became a wrapper for a self-created private cLocal object instead.

  • Purpose: an array of Status objects
    • If a cell has a value, that value is the Status object.
    • The value ultimately being stored is the Status object's value.
    • Internal access to an already-set value then looks like this: [array object]->GetCell(name)->GetIt().

History

  • 2022-07-28 Created from just the generic parts (i.e. most) of cArgs.
    • There was a class of this same name many months ago, but this one was created from scratch without referring to that old code.