-
Notifications
You must be signed in to change notification settings - Fork 63
mw/com: migrate_umlet_to_plantuml__skeleton_proxy #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
kalu-an
wants to merge
4
commits into
eclipse-score:main
from
kalu-an:skeleton_proxy_migrate_umlet_to_plantuml
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
318e7f6
mw/com: migrate_umlet_to_plantuml__skeleton_proxy
kalu-an 628a42d
mw/com: incorporate reviewer suggestions
kalu-an f4710b9
mw/com: incorporate missing reviewer suggestions
kalu-an 0da108b
Update score/mw/com/design/skeleton_proxy/generic_proxy/README.md
kalu-an File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
233 changes: 233 additions & 0 deletions
233
score/mw/com/design/skeleton_proxy/generic_proxy/generic_proxy_model.puml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,233 @@ | ||
| @startuml generic_proxy_model | ||
| title "Generic Proxy Extension" | ||
|
|
||
| class "score::mw::com::impl::HandleType" { | ||
| -indentifier_: InstanceIdentifier | ||
| +operator==(const HandleType& other): bool | ||
| +operator<(const HandleType& other): bool | ||
| +GetInstanceId(): InstanceIdentifier& | ||
| +GetServiceInstanceDeployment(): ServiceInstanceDeployment& | ||
| } | ||
|
|
||
| class "ProxyBindingFactory" { | ||
| +{static} Create(HandleType handle): std::unique_ptr<ProxyBinding> | ||
| +{static} CreateGeneric(HandleType handle, ServiceElementMap<GenericProxyEvent>& events): std::unique_ptr<ProxyBinding> | ||
| +{static} FindService(InstanceIdentifier) : std::optional<HandleType> | ||
| } | ||
|
|
||
| abstract class "score::mw::com::impl::ProxyBase" { | ||
| -proxy_binding_ : std::unique_ptr<ProxyBinding> | ||
| -handle_ : HandleType | ||
| +{static} FindService(InstanceSpecifier): ServiceHandleContainer<HandleType> | ||
| +{static} Preconstruct(const HandleType&): Result<ConstructionToken> | ||
| +GetHandle() : const HandleType& | ||
| .. | ||
| <u>Notes:</u> | ||
| ProxyBase is not copyable but moveable | ||
| } | ||
|
|
||
| abstract class "ProxyBinding" { | ||
| +{abstract} IsEventProvided() = 0: bool | ||
| } | ||
|
|
||
| class "mw::com::impl::GenericProxy" #yellow { | ||
| using HandleType = ProxyBase::HandleType | ||
| using EventMap = ServiceElementMap<GenericProxyEvent> | ||
| .. | ||
| +GenericProxy(ConstructionToken&&) | ||
| +GenericProxy(HandleType) | ||
| +events_ : EventMap | ||
| } | ||
|
|
||
| class "lola::Proxy" { | ||
| +{static} Create(const LolaServiceInstanceDeployment& shm_binding, const LolaServiceTypeDeployment& service_deployment, QualityType quality_type) : Result<Proxy> | ||
| +{static} Create(const LolaServiceInstanceDeployment& shm_binding, const LolaServiceTypeDeployment& service_deployment, QualityType quality_type, ServiceElementMap<GenericProxyEvent>&) : Result<Proxy> | ||
| +Proxy(Proxy&&) | ||
| +GetServiceHandles(instance_identifier : InstanceIdentifier) : score::Result<std::vector<HandleType>> | ||
| +GetEventDataControl(element_fq_id : const ElementFqId) : EventDataControl* | ||
| +GetRawDataStorage(element_fq_id : const ElementFqId) : void* | ||
| +GetEventMetaInfo(element_fq_id : const ElementFqId) : const EventMetaInfo& | ||
| +GetQualityType() : QualityType | ||
| +GetSourcePid() : pid_t | ||
| +{abstract} IsEventProvided(): bool | ||
| } | ||
|
|
||
| class "mw::com::impl::ProxyEvent<SampleType>" { | ||
| +GetNewSamples(F&& receiver, size_t max_num_samples): Result<size_t> | ||
kalu-an marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| abstract class "ProxyEventBindingBase" { | ||
| +{abstract} Subscribe(size_t maxSampleCount) = 0: void | ||
| +{abstract} GetSubscriptionState() = 0: SubscriptionState | ||
| +{abstract} Unsubscribe() = 0: void | ||
| +{abstract} SetReceiveHandler(EventReceiveHandler handler) = 0: void | ||
| +{abstract} UnsetReceiveHandler() = 0: void | ||
| +{abstract} GetNumNewSamplesAvailable() = 0: Result<std::size_t> | ||
| } | ||
|
|
||
| abstract class "ProxyEventBinding<SampleType>" { | ||
| using Callback = score::cpp::callback<void(SamplePtr<SampleType>) noexcept> | ||
| .. | ||
| +{abstract} GetNewSamples(Callback&&, TrackerGuardFactory&) = 0: Result<size_t> | ||
| } | ||
|
|
||
| class "SampleReferenceTracker" { | ||
| +SampleReferenceTracker() | ||
| +SampleReferenceTracker(size_t max_num_samples) | ||
| +GetNumAvailableSamples(): size_t | ||
| +Allocate(size_t count) : TrackerGuardFactory | ||
| +Reset(size_t new_max_count) : void | ||
| +IsUsed() : bool | ||
| } | ||
|
|
||
| class "lola::ProxyEvent<SampleType>" { | ||
| +ProxyEvent(lola::Proxy& parent) | ||
| +GetNewSamples(ProxyEventBinding::Callback&&, TrackerGuardFactory&): Result<size_t> | ||
| -common_dispatch_ : lola::ProxyEventCommon | ||
| .. | ||
| <u>Notes:</u> | ||
| Dispatches all calls to functions in ProxyEventBindingBase interface to ProxyEventCommon | ||
| } | ||
|
|
||
| class "ProxyEventBindingFactory" { | ||
| +{static}<SampleType> Create(ProxyBase& parent, score::cpp::string_view event_name): std::unique_ptr<ProxyEventBinding<SampleType>> | ||
kalu-an marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| +{static} <b>CreateGeneric(ProxyBase& parent, score::cpp::string_view event_name): std::unique_ptr<GenericProxyEventBinding></b> | ||
| } | ||
|
|
||
| class "lola::SubscriptionStateMachine" { | ||
| .. | ||
| <u>Notes:</u> | ||
| State machine that manages subscriptions to a ProxyEvent. | ||
| Details about the state machine can be found in | ||
| proxy_event_state_machine.puml. | ||
| } | ||
|
|
||
| class "ProxyBaseView" { | ||
| +ProxyBaseView(proxy_base : ProxyBase&) | ||
| +GetImpl() : ProxyBinding& | ||
| } | ||
|
|
||
| class "lola::SlotCollector" { | ||
| using SlotIndexVector = std::vector<EventDataControl::SlotIndexType>; | ||
| .. | ||
| -event_data_control_: EventDataControl& | ||
| -SlotCollector(EventDataControl&, const std::size_t max_slots) | ||
| +GetNumNewSamplesAvailable(): size_t | ||
| +GetNewSamplesSlotIndices(size_t max_count): pair<SlotIndexVector::const_reverse_iterator, SlotIndexVector::const_reverse_iterator> | ||
| <u>Notes:</u> | ||
| SlotCollector is not copyable. | ||
| } | ||
|
|
||
| class "DummyProxy" <<generated>> { | ||
| using HandleType = ProxyBase::HandleType | ||
| .. | ||
| +DummyProxy(ConstructionToken&&) | ||
| +DummyProxy(HandleType) | ||
| +DummyEvent : events::DummyEvent | ||
| } | ||
|
|
||
| abstract class "mw::com::impl::ProxyEventBase" #yellow { | ||
| +ProxyEventBase(ProxyEventBindingBase&) | ||
| +Subscribe(size_t max_sample_count): void | ||
| +GetSubscriptionState() : SubscriptionState | ||
| +Unsubscribe(): void | ||
| +GetFreeSampleCount(): Result<size_t> | ||
| +GetNumNewSamplesAvailable(): Result<std::size_t> | ||
| +SetReceiveHandler(EventReceiveHandler handler) : void | ||
| +UnsetReceiveHandler() : void | ||
| } | ||
|
|
||
| class "mw::com::impl::GenericProxyEvent" #yellow { | ||
| +GetSampleSize() const : std::size_t | ||
| +HasSerializedFormat() const : bool | ||
| +GetNewSamples(F&& receiver, size_t max_num_samples): Result<size_t> | ||
| } | ||
|
|
||
| abstract class "GenericProxyEventBinding" #yellow { | ||
| using Callback = score::cpp::callback<void(SamplePtr<void>) noexcept> | ||
| .. | ||
| +GetSampleSize() const : std::size_t | ||
| +HasSerializedFormat() const : bool | ||
| +{abstract} GetNewSamples(Callback&&, size_t max_num_samples) = 0: Result<size_t> | ||
| } | ||
|
|
||
| class "lola::ProxyEventCommon" #yellow { | ||
| -element_fq_id_: ElementFqId | ||
| -parent_: lola::Proxy& | ||
| -subscription_event_state_machine_: std::shared_ptr<SubscriptionStateMachine> | ||
| -slot_collector_: score::cpp::optional<SlotCollector> | ||
| +ProxyEventCommon(lola::Proxy& parent, ElementFqId) | ||
| +Subscribe(size_t max_sample_count): void | ||
| +Unsubscribe(): void | ||
| +GetSubscriptionState() : SubscriptionState | ||
| +SetReceiveHandler(EventReceiveHandler handler) : void | ||
| +UnsetReceiveHandler(EventReceiveHandler handler) : void | ||
| +GetEventSourcePid() : pid_t | ||
| +GetElementFQId() : ElementFqId | ||
| +GetNumNewSamplesAvailable(): Result<std::size_t> | ||
| +GetNewSamplesSlotIndices(size_t max_count): pair<SlotIndexVector::const_reverse_iterator, SlotIndexVector::const_reverse_iterator> | ||
| .. | ||
| <u>Notes:</u> | ||
| lola::ProxyEventCommon is not moveable or copyable. | ||
| SlotCollector is instantiated by the SubscriptionStateMachine when it enters the | ||
| Subscribed state. It is cleared if it subsequently leaves the Subscribed state. | ||
| } | ||
|
|
||
| class "lola::GenericProxyEvent" #yellow { | ||
| +GenericProxyEvent(lola::Proxy& parent) | ||
| +GetNewSamples(GenericProxyEventBinding::Callback&&, TrackerGuardFactory&): Result<size_t> | ||
| -common_dispatch_ : lola::ProxyEventCommon | ||
| } | ||
|
|
||
| class "ServiceElementMap" { | ||
| using key_type = score::cpp::stringview | ||
| using mapped_type = GenericProxyEvent | ||
| using value_type = std::pair<const key_type, mapped_type> | ||
| using const_iterator = LegacyBidirectionalIterator to const value_type | ||
| .. | ||
| +cbegin() : const_iterator | ||
| +cend() : const_iterator | ||
| +find() : const_iterator | ||
| +size() : std::size_t | ||
| +empty() : bool | ||
| } | ||
|
|
||
| ' Relationships | ||
| "score::mw::com::impl::HandleType" <.. "score::mw::com::impl::ProxyBase" : uses | ||
|
|
||
| "score::mw::com::impl::ProxyBase" *--> "ProxyBinding" | ||
| "score::mw::com::impl::ProxyBase" <|-- "DummyProxy" | ||
| "score::mw::com::impl::ProxyBase" <|-- "mw::com::impl::GenericProxy" | ||
| "mw::com::impl::GenericProxy" *-- "ServiceElementMap" | ||
| "ProxyBindingFactory" ..> "ProxyBinding" : creates | ||
| "ProxyBinding" <|-- "lola::Proxy" | ||
| "lola::ProxyEventCommon" *-- "lola::Proxy" | ||
kalu-an marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "ProxyBindingFactory" <.. "mw::com::impl::GenericProxy" : uses | ||
| "ProxyBindingFactory" <.. "DummyProxy" : uses | ||
| "DummyProxy" *--> "mw::com::impl::ProxyEvent<SampleType>" : "0..n" | ||
| "mw::com::impl::GenericProxy" *--> "mw::com::impl::GenericProxyEvent" : "0..n" | ||
| "mw::com::impl::ProxyEventBase" *-- "SampleReferenceTracker" | ||
| "mw::com::impl::ProxyEventBase" <|-- "mw::com::impl::ProxyEvent<SampleType>" | ||
| "mw::com::impl::ProxyEventBase" <|-- "mw::com::impl::GenericProxyEvent" | ||
| "SampleReferenceTracker" <.. "lola::ProxyEvent<SampleType>" : uses | ||
| "SampleReferenceTracker" <.. "lola::GenericProxyEvent" : uses | ||
| "GenericProxyEventBinding" *--> "mw::com::impl::GenericProxyEvent" : "1" | ||
kalu-an marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "ProxyEventBindingFactory" o--> "ProxyBaseView" | ||
kalu-an marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "ProxyEventBindingFactory" ..> "ProxyEventBinding<SampleType>" : creates | ||
| "mw::com::impl::ProxyEvent<SampleType>" ..> "ProxyEventBindingFactory" : uses | ||
| "ProxyEventBinding<SampleType>" --* "mw::com::impl::ProxyEvent<SampleType>" : "1" | ||
|
|
||
| "GenericProxyEventBinding" <|-- "lola::GenericProxyEvent" | ||
|
|
||
| "ProxyEventBindingBase" <|-- "ProxyEventBinding<SampleType>" | ||
| "ProxyEventBindingBase" <|-- "GenericProxyEventBinding" | ||
| "ProxyEventBinding<SampleType>" <|-- "lola::ProxyEvent<SampleType>" | ||
|
|
||
| "lola::ProxyEvent<SampleType>" *-- "lola::ProxyEventCommon" : common_dispatch_ | ||
| "lola::GenericProxyEvent" *-- "lola::ProxyEventCommon" : common_dispatch_ | ||
|
|
||
| "lola::SubscriptionStateMachine" *-- "lola::SlotCollector" | ||
|
|
||
| "lola::ProxyEventCommon" *-- "lola::SlotCollector" : slot_collector_ | ||
|
|
||
| @enduml | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.