Section 7: TSP command reference
Models 707B and 708B Switching Matrix Reference Manual
7-128
707B-901-01 Rev. B / January 2015
Details
This function is useful for aliasing attributes to improve execution speed. Calling the function created
with
makegetter()
executes faster than accessing the attribute directly.
Creating a getter function is only useful if it is going to be called several times. Otherwise, the
overhead of creating the getter function outweighs the overhead of accessing the attribute directly.
Example
getRule = makegetter(channel, "connectrule")
-- (intervening code)
r = getrule()
Creates a getter function called
getRule.
When
getRule()
is called, it
returns the value of
connectrule
.
Also see
(on page 7-128)
makesetter()
This function creates a function that, when called, sets the value of an attribute.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
No
Usage
setter
= makesetter(
table
,
attributeName
)
setter
Function that sets the value of the attribute
table
Read-only table where the attribute is located
attributeName
The string name of the attribute
Details
This function is useful for aliasing attributes to improve execution speed. Calling the
setter
function
will execute faster than accessing the attribute directly.
Creating a
setter
function is only useful if it is going to be called several times. If you are not calling
the
setter
function several times, it is more efficient to access the attribute directly.
Example
setRule = makesetter(channel, "connectrule")
r = setrule(channel.BREAK_BEFORE_MAKE)
Creates a setter function called
setRule
.
When
setRule()
is called, it
configures the setting for
connectrule
. In this example,
the connection rule is set to
break-before-make.
Also see
(on page 7-127)