Documentation
¶
Index ¶
- type UseCaseBase
- func (u *UseCaseBase) AddUseCase()
- func (u *UseCaseBase) AvailableScenariosForEntity(entity spineapi.EntityRemoteInterface) []uint
- func (u *UseCaseBase) HandleEvent(payload spineapi.EventPayload)
- func (u *UseCaseBase) IsCompatibleEntityType(entity spineapi.EntityRemoteInterface) bool
- func (u *UseCaseBase) IsScenarioAvailableAtEntity(entity spineapi.EntityRemoteInterface, scenario uint) bool
- func (u *UseCaseBase) RemoteEntitiesScenarios() []api.RemoteEntityScenarios
- func (u *UseCaseBase) RemoveUseCase()
- func (u *UseCaseBase) UpdateUseCaseAvailability(available bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UseCaseBase ¶
type UseCaseBase struct {
LocalEntity spineapi.EntityLocalInterface
UseCaseActor model.UseCaseActorType
UseCaseName model.UseCaseNameType
EventCB api.EntityEventCallback
// contains filtered or unexported fields
}
func NewUseCaseBase ¶
func NewUseCaseBase( localEntity spineapi.EntityLocalInterface, usecaseActor model.UseCaseActorType, usecaseName model.UseCaseNameType, useCaseVersion string, useCaseDocumentSubVersion string, useCaseScenarios []api.UseCaseScenario, eventCB api.EntityEventCallback, useCaseUpdateEvent api.EventType, validActorTypes []model.UseCaseActorType, validEntityTypes []model.EntityTypeType, allEntityTypesValid bool, ) *UseCaseBase
Adds a new use case to an entity
Parameters:
- localEntity: The local entity which should support the use case
- usecaseActor: The actor type of the use case
- usecaseName: The name of the use case
- useCaseVersion: The version of the use case
- useCaseDocumentSubVersion: The sub version of the use case document
- useCaseScenarios: The supported scenarios of the use case
- eventCB: The callback to be called when an usecase update event of a remote entity is triggered (optional, can be nil)
- useCaseUpdateEvent: The event type of the use case update event for the eventCB
- validActorTypes: The valid actor types for the use case in a remote entity
- validEntityTypes: The valid entity types for the use case in a remote entity
func (*UseCaseBase) AddUseCase ¶
func (u *UseCaseBase) AddUseCase()
func (*UseCaseBase) AvailableScenariosForEntity ¶
func (u *UseCaseBase) AvailableScenariosForEntity(entity spineapi.EntityRemoteInterface) []uint
return the currently available scenarios for the use case for a remote entity
func (*UseCaseBase) HandleEvent ¶
func (u *UseCaseBase) HandleEvent(payload spineapi.EventPayload)
handle SPINE events
func (*UseCaseBase) IsCompatibleEntityType ¶
func (u *UseCaseBase) IsCompatibleEntityType(entity spineapi.EntityRemoteInterface) bool
func (*UseCaseBase) IsScenarioAvailableAtEntity ¶
func (u *UseCaseBase) IsScenarioAvailableAtEntity( entity spineapi.EntityRemoteInterface, scenario uint, ) bool
check if the provided scenario are available at the remote entity
func (*UseCaseBase) RemoteEntitiesScenarios ¶
func (u *UseCaseBase) RemoteEntitiesScenarios() []api.RemoteEntityScenarios
return the current list of compatible remote entities and their scenarios
func (*UseCaseBase) RemoveUseCase ¶
func (u *UseCaseBase) RemoveUseCase()
func (*UseCaseBase) UpdateUseCaseAvailability ¶
func (u *UseCaseBase) UpdateUseCaseAvailability(available bool)