2022-02-04 11:14:53 +00:00
|
|
|
package hyphae
|
|
|
|
|
|
|
|
import "sync"
|
|
|
|
|
2022-02-19 16:42:32 +00:00
|
|
|
// EmptyHypha is a hypha that does not exist and is not stored anywhere. You get one when querying for a hypha that was not created before.
|
2022-02-04 11:14:53 +00:00
|
|
|
type EmptyHypha struct {
|
|
|
|
sync.RWMutex
|
|
|
|
|
|
|
|
canonicalName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *EmptyHypha) CanonicalName() string {
|
|
|
|
return e.canonicalName
|
|
|
|
}
|
|
|
|
|
2022-02-19 16:42:32 +00:00
|
|
|
// ExtendEmptyToTextual returns a new textual hypha with the same name as the given empty hypha. The created hypha is not stored yet.
|
2022-02-19 08:26:38 +00:00
|
|
|
func ExtendEmptyToTextual(e *EmptyHypha, mycoFilePath string) *TextualHypha {
|
|
|
|
return &TextualHypha{
|
|
|
|
canonicalName: e.CanonicalName(),
|
|
|
|
mycoFilePath: mycoFilePath,
|
2022-02-04 14:56:28 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-06 13:09:56 +00:00
|
|
|
|
2022-02-19 16:42:32 +00:00
|
|
|
// ExtendEmptyToMedia returns a new media hypha with the same name as the given empty hypha. The created hypha is not stored yet.
|
2022-02-19 08:26:38 +00:00
|
|
|
func ExtendEmptyToMedia(e *EmptyHypha, mediaFilePath string) *MediaHypha {
|
|
|
|
return &MediaHypha{
|
|
|
|
canonicalName: e.CanonicalName(),
|
|
|
|
mycoFilePath: "",
|
|
|
|
mediaFilePath: mediaFilePath,
|
2022-02-06 13:09:56 +00:00
|
|
|
}
|
|
|
|
}
|