package components
- Alphabetic
- Public
- All
Type Members
-
trait
Component
extends Named
An outer description of a system.
An outer description of a system. Actual description is deferred to descendants. See also Links
-
trait
ComponentWithInternalStructure
extends Component with WithStaticSystem
Transparent component whose internal structure can be represented as a StaticSystem.
-
trait
ComponentsApi
extends AnyRef
Import components to core package.
-
class
Contact
[T] extends Named with Serializable
Basis point of connection of other elements.
Basis point of connection of other elements. If auxiliary then it is drawn on the graph as a simple little circle.
It order to improve performance the contact is compared by referential equality (#eq()). That's why it is not a case class. However, this creates some inconvenience in serialization.
NB: the contact is not very well serializable. After deserialization we obtain a different instance of the contact. But in most cases the comparison is done by referential equality (.eq) and thus it won't do well.
In synapse-grid-akka there is a solution for Contact serializations.
- See also
ru.primetalk.synapse.akka.ContactSerializer.
-
case class
FlatMapLink
[-T1, +T2](f: (T1) ⇒ GenTraversableOnce[T2]) extends LinkInfo[T1, T2] with Product with Serializable
The kind of link that does sequential transformation of data.
-
case class
InnerSystemComponent
(s: StaticSystem, stateHandle: StateHandle[Map[Contact[_], Any]], sharedStateHandles: List[StateHandle[_]] = Nil) extends Component with ComponentWithInternalStructure with Product with Serializable
The system that can be embedded into some other static system.
The system that can be embedded into some other static system. It has specially processed state:
- s
structure of the system
- stateHandle
the handle within parent system that holds internal system's state. The handle points to the map (stateHandle -> value)
- sharedStateHandles
a few state handles that are shared between the parent system and child. During runtime processing current values from parent are copied to child state before processing any signals and copied back afterwards.
-
case class
Link
[T1, T2, -TL1 >: T1, +TL2 <: T2](from: Contact[T1], to: Contact[T2], name: String, info: LinkInfo[TL1, TL2]) extends Named with TwoPoleComponent[T1, T2] with Product with Serializable
The Link is represented with a triple of two contacts and a linkInfo
The Link is represented with a triple of two contacts and a linkInfo
Special care is taken for type variants. Contacts are invariant because data is "set" and "get". However, the function is contra- and co- variant, because it is a function. So we have two additional types TL1, TL2.
-
sealed
trait
LinkInfo
[-T1, +T2] extends AnyRef
LinkInfo are individually processed functions with different signatures.
-
trait
Named
extends AnyRef
Named is used to store graph specific information - label or name.
-
case class
NopLink
[-T1, +T2 >: T1]() extends LinkInfo[T1, T2] with Product with Serializable
This link can connect contacts of the same type.
-
case class
RedMapLink
[-T1, +T2](stopContacts: Set[Contact[_]]) extends LinkInfo[T1, T2] with Product with Serializable
Prioritize contacts when some data passes through this link.
Prioritize contacts when some data passes through this link. Processes until the data is only on stopContacts. "Fires" starting from the initial contact until "firewall" contacts. TODO: move to Components.
- trait RttiContactExt extends ContactsDsl
-
case class
Signal
[T](contact: Contact[T], data: T) extends Product with Serializable
Signal is a pair of contact and data on it.
Signal is a pair of contact and data on it. Two methods are provided to match those of pairs - _1 and _2.
-
case class
SignalDist
(contactId: Int, data: AnyRef) extends Product with Serializable
Signal for remote transfer.
Signal for remote transfer. The real contacts are not quite well serializable (see Contact for details). Thus we use the position of the contact in the system's index.
- trait SignalsApi extends ContactsDsl
-
class
StateHandle
[S] extends Contact[S] with Stateful[S]
Permanent contacts store shared state that can be updated with stateful links.
-
case class
StateUpdate
[S, T2](from: Contact[T2], stateHandle: StateHandle[S], name: String, f: (S, T2) ⇒ S) extends Component with Product with Serializable
Special component that atomically updates state.
Special component that atomically updates state. It doesn't have any output contact.
-
case class
StateZipLink
[S, -T1, +T2 >: T1](stateHolder: StateHandle[S]) extends LinkInfo[T1, (S, T2)] with Product with Serializable
Zips state value with the inner data and
-
trait
Stateful
[State] extends AnyRef
Stateful elements of the system.
-
case class
StatefulFlatMapLink
[S, -T1, +T2](f: (S, T1) ⇒ (S, GenTraversableOnce[T2]), stateHolder: StateHandle[S]) extends LinkInfo[T1, T2] with Product with Serializable
The kind of link that does sequential transformation of data.
The kind of link that does sequential transformation of data. The function itself has state that is transformed every time. Prefer to use StateZipLink (?)
-
case class
StaticSystem
(inputs: List[Contact[_]], outputs: List[Contact[_]], privateStateHandles: List[StateHandle[_]], components: List[Component], name: String, extensions: Map[StaticSystemExtensionId[_], Any] = Map()) extends Component with Named with Stateful[Map[Contact[_], Any]] with ComponentWithInternalStructure with Product with Serializable
The core class for SynapseGrid.
The core class for SynapseGrid. Contains an immutable description of a system.
- inputs
input contacts of the system. Within the system it is prohibited to send signals on them.
- outputs
output contacts of the system. Within the system it is prohibited to connect outgoing links to these contacts. This is due to the fact that the signals that come to output contacts are not processed within the system. They are delayed for processing by the outer system.
- privateStateHandles
state identifiers for variables available within the system. The system itself is immutable and it is prohibited to save state somewhere in closures or global vars (due to thread unsafety). Instead the system's internal state is "provided" by runtime system in the form of map stateHandle->value. updates of states can be done only in a purely functional way.
- components
inner parts of the system - links, subsystems and other blocks. They have inputs and outputs.
- name
the system's name extension methods: unhandledExceptionHandler - user-defined exception handler. It can recover from exception by returning repaired Context, log it or rethrow. index - ContactsIndex styles - ContactsStyles
-
trait
StaticSystemExtensionId
[+T] extends AnyRef
ExtensionId for a StaticSystem extension.
ExtensionId for a StaticSystem extension. Every extension can be installed only once on the same StaticSystem.
The extension can contain some additional state for system processing.
However, it is not recommended to add mutable state to otherwise immutable StaticSystem.
-
trait
TwoPoleComponent
[T1, T2] extends Component
A component that has single input and single output.
- trait WithStaticSystem extends AnyRef
Value Members
- object Contact extends Serializable
- object StateHandle extends Serializable
- object StateUpdate extends Serializable
- object StaticSystem extends Serializable
- object WithStaticSystem