(1) Data component access is used to model shared data. Data components can be made accessible outside their containment hierarchy. Components can declare that they require access to externally declared data components. Components may provide access to their data components.
(2) The use of component access for data components is illustrated in Figure 12. Data2, Thread1, and Thread2 are subcomponents of a process implementation. Thread1 contains a data subcomponent called Data1. Data1 is made accessible outside Thread1 through a provides data access feature declaration in the thread type of Thread1. It is being accessed by Thread2 as expressed by a requires data access feature declaration in the thread type of Thread2. Thread1 accesses data component Data2.
Figure 12 Containment Hierarchy and Shared Access
Syntax
-- The requires and provides subcomponent access subclause
data_access_spec ::=
defining_data_component_access_identifier :
( provides | requires ) data access
[ data_unique_component_classifier_reference
| prototype_identifier ]
data_access_refinement ::=
defining_data_component_access_identifier : refined to
( provides | requires ) data access
[ data_unique_component_classifier_reference
| prototype_identifier ]
Naming Rules
(N1) The defining identifier of a provides or requires data access declaration must be unique within the namespace of the component type where the data access is declared.
(N2) The defining identifier of a provides or requires data access refinement must exist as a defining identifier of a provides or requires data access or as a defining identifier of an abstract feature in the namespace of the component type being extended.
(N3) The component type identifier or component implementation name of a data access classifier reference must exist in the package namespace.
(N4) The prototype identifier, if present, must exist in the namespace of the classifier that contains the data access declaration.
Legality Rules
(L1) If a data access refers to a component classifier or a component prototype, then the category of the classifier or prototype must be of category data.
(L2) A data access declaration may be refined by refining the data classifier, by adding a property association, or by doing both. If the refinement only adds a property association the classifier reference is optional.
(L3) A provides data access cannot be refined to a requires data access and a requires data access cannot be refined to a provides data access.
(L4) An abstract feature can be refined into a data access. In this case, the abstract feature must not have a direction specified.
Consistency Rules
(C1)A data access declaration that does not specify a data classifier reference is incomplete. Such a reference can be added in a data access refinement declaration.
(C2)If the source code of a component does access shared data, then the component type declaration must specify a requires data access declaration. In other words, for all components that access shared data their component type declaration must reflect that fact.
(C3)A data access refinement may refine an abstract feature declaration. If the abstract feature declaration specifies a direction of in, then the access right of the data access must be read-only. If the direction is out, then the access right of the data access must be write-only. If the abstract feature does not have a specified direction, then any access right is acceptable.
Standard Properties
Access_Right : Access_Rights => read_write
-- access time range for data access
Access_Time: record (
First: IO_Time_Spec ;
Last: IO_Time_Spec ; )
=> [ First =>[Time => Start; Offset => 0.0 ns .. 0.0 ns;];
Last => [Time => Completion; Offset => 0.0 ns .. 0.0 ns;]; ]
Semantics
(3) A requires data access declaration in the component type indicates that a component requires access to a component declared external to the component. Required data accesses are resolved to actual data subcomponents through access connection declarations. For data components different forms of required access, such as read-only access, are specified by a Access_Right property. Read-only access can also be specified through a directional access connection from the data component to the requires data access feature, while write-only access is specified through a directional access connection to the data component.
(4) A provides data access declaration in the component type indicates that a subcomponent provides access to a data component contained in the component. Provided data accesses can be used to resolve required subcomponent access. For data and bus components different forms of provided access, such as read-only access, are specified by a Access_Right property or be directional access connections.
(5) If a data access feature is a refinement of an abstract feature, then the direction of the abstract feature, if specified, imposes a restriction on the data flow, i.e., in implies read-only, and out implies write-only.
(6) Shared data may be accessed by multiple threads. Such potential concurrent access is controlled according to the Concurrency_Control_Protocol property.
(7) Access_Time specifies the time range over which a component has access to a shared data component. By default access is required for the duration of the component execution. The value of a shared data component is read or written through the use of a data variable that represents the shared data component, or through Get_Value and Put_Value service calls. Write access immediately updates the shared data component.
Examples
package Example
public
system simple
end simple;
system implementation simple.impl
subcomponents
A: process pp.i;
B: process qq.i;
connections
data access A.dataset -> B.Reqdataset;
end simple.impl;
process pp
features
Dataset: provides data access dataset_type;
end pp;
process implementation pp.i
subcomponents
Share1: data dataset_type;
-- other subcomponent declarations
connections
data access Share1 <-> Dataset;
end pp.i;
process qq
features
Reqdataset: requires data access dataset_type;
end qq;
process implementation qq.i
subcomponents
Q: thread rr;
connections
data access Reqdataset <-> Q.Req1;
end qq.i;
thread rr
features
Req1: requires data access dataset_type;
end rr;
data dataset_type
end dataset_type
end Example;