Skip to content

Commit

Permalink
doc work
Browse files Browse the repository at this point in the history
  • Loading branch information
vectaport committed Nov 15, 2018
1 parent 08a684a commit 7d09ed8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions graphhub.go
Expand Up @@ -129,12 +129,12 @@ func (gh *graphhub) Panicf(format string, v ...interface{}) {
gh.hub.Panicf(format, v...)
}

// Source returns source stream by index
// Source returns source stream selected by string or int
func (gh *graphhub) Source(port interface{}) Stream {
return gh.hub.Source(port)
}

// Result returns result stream by index
// Result returns result stream selected by string or int
func (gh *graphhub) Result(port interface{}) Stream {
return gh.hub.Result(port)
}
Expand Down Expand Up @@ -199,12 +199,12 @@ func (gh *graphhub) SetResultNames(nm ...string) Hub {
return gh.hub.SetResultNames(nm...)
}

// SourceIndex returns the index of a source port matched by name or stream
// SourceIndex returns the index of a source port selected by string or Stream
func (gh *graphhub) SourceIndex(port interface{}) int {
return gh.hub.SourceIndex(port)
}

// ResultIndex returns the index of a source port matched by name or stream
// ResultIndex returns the index of a source port selected by string or Stream
func (gh *graphhub) ResultIndex(port interface{}) int {
return gh.hub.ResultIndex(port)
}
Expand Down Expand Up @@ -302,7 +302,7 @@ func (gh *graphhub) Loop() {

for i := 0; i < ns; i++ {
switch gh.HubCode() {

case While:
gh.Connect(wait, i, ins[i], insPort[i])

Expand All @@ -322,7 +322,7 @@ func (gh *graphhub) Loop() {
termc := gh.ConnectInit(steer, 0, wait, ns, 0) // termination condition recycled but also needs to be output
termc.Base().(*fgbase.Edge).Val = nil // remove initialization condition from termination condition
gh.ExposeResult(termc)

case Until:
gh.Connect(wait, i, ins[i], insPort[i])

Expand All @@ -345,7 +345,7 @@ func (gh *graphhub) Loop() {

default:
gh.Panicf("Uknown HubCode %q for GraphHub %q\n", gh.HubCode(), gh.Name())

}
}
fmt.Printf("// While loop %q internals:\n", gh.Name())
Expand Down
16 changes: 8 additions & 8 deletions hub.go
Expand Up @@ -22,10 +22,10 @@ type Hub interface {
// Panicf for logging of panic messages. Uses atomic log mechanism.
Panicf(format string, v ...interface{})

// Source returns source stream by index
// Source returns source stream selected by string or int
Source(port interface{}) Stream

// Result returns result stream by index
// Result returns result stream selected by string or int
Result(port interface{}) Stream

// SetSource sets a stream on a source port selected by string or int
Expand Down Expand Up @@ -64,10 +64,10 @@ type Hub interface {
// SetResultNames names the result ports
SetResultNames(nm ...string) Hub

// SourceIndex returns the index of a source port matched by name or stream
// SourceIndex returns the index of a source port selected by string or Stream
SourceIndex(port interface{}) int

// ResultIndex returns the index of a result port matched by name or stream
// ResultIndex returns the index of a result port selected by string or Stream
ResultIndex(port interface{}) int

// ConnectSources connects a list of source Streams to this hub
Expand Down Expand Up @@ -121,7 +121,7 @@ func (h *hub) SetName(name string) {
h.base.Name = name
}

// Source returns source stream by index
// Source returns source stream selected by int or string
func (h *hub) Source(port interface{}) Stream {
var i int
var ok bool
Expand All @@ -143,7 +143,7 @@ func (h *hub) Source(port interface{}) Stream {
return &stream{h.base.Src(i), h.fg}
}

// Result returns result stream by index
// Result returns result stream selected by int or string
func (h *hub) Result(port interface{}) Stream {
var i int
var ok bool
Expand Down Expand Up @@ -283,7 +283,7 @@ func (h *hub) SetResultNames(nm ...string) Hub {
return h
}

// SourceIndex returns the index of a source port matched by name or stream
// SourceIndex returns the index of a source port selected by string or stream
func (h *hub) SourceIndex(port interface{}) int {
var i int
var ok bool
Expand Down Expand Up @@ -313,7 +313,7 @@ func (h *hub) SourceIndex(port interface{}) int {
return i
}

// ResultIndex returns the index of a result port matched by name or stream
// ResultIndex returns the index of a result port selected by string or stream
func (h *hub) ResultIndex(port interface{}) int {
var i int
var ok bool
Expand Down

0 comments on commit 7d09ed8

Please sign in to comment.