Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcNamespaceBinding

TcBinding for attaching to PROGRAMS or Variable Lists PLC Symbols.

The TcNamespaceBinding is unique, because it has no parent - it is the entry point, as well as its Memory Definition is based on the Children passed to it

Hierarchy

Implements

Index

Constructors

constructor

  • Constructor a namespace Binding, which will grow and adjust, as children are added to it

    Parameters

    • context: TcContext

      The TcContext which owns this binding

    • symbol: TcSymbol

      The TcSymbol which owns this binding

    • parent: TcEmitter

      Parent Emitter, to whom a event will be propagate to

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcNamespaceBinding

Accessors

clearPackages

context

indexGroup

  • get indexGroup(): number

indexOffset

  • get indexOffset(): number

isValid

  • get isValid(): boolean

readOnly

  • get readOnly(): boolean

readPackages

size

  • get size(): number

symbol

Methods

Private __addChild

  • __addChild(child: { binding: TcSymbolBinding; key: string | number }): void
  • Internal method, for adding a Child TcSymbolBinding as part of this TcNamespaceBinding

    The method also readjusts the indexOffset and size of this TcNamespaceBinding

    Parameters

    Returns void

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

checkInput

  • checkInput(value: {}): void

clear

  • clear(): Promise<void>

emit

  • emit(eventName: string | symbol, e: TcEvent): boolean
  • Emits an event of eventName with data e and if parent is present will propagated that event to it, unless stopped

    Parameters

    • eventName: string | symbol

      The event name to emit

    • e: TcEvent

      The Data associated with this event

    Returns boolean

    • True if the event had listeners, false otherwise.

emitChange

emitCleared

emitGet

emitSet

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

fromRaw

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

read

  • read(): Promise<any>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

subscribe

  • subscribe(sampling: number, callback: (value: any) => void): Promise<void>
  • Performs a subscription of this TcBinding for monitoring value change

    throws

    TcBindingIsInvalidException - Attempting operation on an invalidated TcBinding

    throws

    TcComIsInvalidException - Attempted to use an Invalid TcCom Object for subscription

    throws

    TcComSubscribeException - Failed to subscribe to the provided pointer

    Parameters

    • sampling: number

      The speed at which change is detected

    • callback: (value: any) => void

      Callback, which is invoked when a change does happened

        • (value: any): void
        • Parameters

          • value: any

          Returns void

    Returns Promise<void>

toRaw

unsubscribe

  • unsubscribe(): Promise<void>

write

  • write(value: any): Promise<any>

Static addChild

Static invalidate

Generated using TypeDoc