Return a negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object:
this < that => <0
this == that => 0
this > that => >0
This method may also be accessed via the <
<=
<=>
>=
and >
shortcut operators. If not overridden the default
implementation compares the toStr
representations. Also see docLang.
Examples:
3.compare(8) => -1
8.compare(3) => 1
8.compare(8) => 0
3 <=> 8 => -1 // shortcut for 3.compare(8)
Parent connector
Runtime database
Display name
Compare this object to the specified for equality. This
method may be accessed via the == and != shortcut operators.
If not overridden the default implementation compares for
reference equality using the === operator. If this method
is overridden, then hash() must also be overridden such that
any two objects which return true for equals() must return
the same value for hash(). This method must accept null
and
return false.
Return a unique hashcode for this object. If a class overrides hash() then it must ensure if equals() returns true for any two objects then they have same hash code.
Return if there is one or more points currently in watch.
Record id
Parent library
Log for this connector
Callback to handle close of the connection.
Callback when conn record is removed
Callback when conn record is updated
Callback made periodically every few seconds to handle background tasks.
Callback to handle learn tree navigation. This method
should return a grid where the rows are either navigation
elements to traverse or points to map. The learn
tag is
used to indicate a row which may be "dived into" to navigate
the remote system's tree. The learn
value is passed back to
this function to get the next level of the tree. A null arg
should return the root of the learn tree.
Also see ConnLib.onLearn which
provides the top-level callback for learn. If your learn
implementation does not require an open connection, then use
the ConnLib
level callback. By default that callback will
dispatch a message to Conn actor, perform open,
and then invoke this callback.
The following tags should be used to indicate points to map:
Callback to handle opening the connection. Raise DownErr or FaultErr if the connection failed. This callback is always called before operations such as onPing.
Callback to handle ping of the connector. Return custom status tags such as device version, etc to store on the connector record persistently. If there are version tags which should be removed then map those tags to Remove.val. If ping fails then raise exception and the connector will be automatically closed.
Callback to poll a bucket of points with the same tuning config. Default implementation calls onSyncCur. This callback is only used if the Conn.pollMode is configured as "buckets".
Callback made periodically for manual polling. This callback is only invoked if Conn.pollMode is configured as "manual". The frequency of the callback is determined by Conn.pollFreq. Use pointsWatched to list of points currently being watched.
Callback to synchronize the given list of points. The result of this call should be to invoke ConnPoint.updateCurOk or ConnPoint.updateCurErr on each point. All the points are guaranteed to return true for isCurEnabled
Callback to synchronize the a point's history data from the
connector. The result of this callback must be to invoke ConnPoint.updateHisOk
or ConnPoint.updateHisErr
(or just raise exception). The return of this method should
be whatever updateHisXXX
returns.
Callback when one or more points are put into watch mode. All the points are guaranteed to return true for isCurEnabled
Callback to write a point. The connector should write info.val
to the remote system. If successful then call ConnPoint.updateWriteOk.
If there is an error then invoke ConnPoint.updateWriteErr
or raise an exception. Note the value may have been
convered from writeVal if writeConvert
is configured.
Open the connector. The connection will linger open based on the configured linger timeout, then automatically close. If the connector fails to open, then raise an exception.
Current version of the record. This dict only represents the
current persistent tags. It does not track transient changes
such as connStatus
.
Runtime system
Set the ConnPoint.data value. The value must be immutable.
Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:
Return a string representation of this object.
Debug tracing for this connector
Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:
a->x a.trap("x", null)
a->x() a.trap("x", null)
a->x = b a.trap("x", [b])
a->x(b) a.trap("x", [b])
a->x(b, c) a.trap("x", [b, c])
The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.
This method called whenever an it-block is applied to an
object. The default implementation calls the function with this
,
and then returns this
.
Static
echoWrite x.toStr
to standard output followed by newline. If x
is null then print "null". If no argument is provided then
print an empty line.
Optional
x: JsObjStatic
makeConstructor with framework specific argument
ConnDispatch provides an implementation for all callbacks. A subclass is created by each connector to implement the various callbacks and store mutable state. All dispatch callbacks are executed within the parent Conn actor. See docHaxall::CustomConns#connDispatch.