Skip to content
Permalink
Browse files

readonly -> restrict/write

  • Loading branch information...
markus2330 committed May 20, 2019
1 parent 5576a8e commit 48cf9755e7fd41784b611b9e7eae0e09328a05c0
Showing with 13 additions and 13 deletions.
  1. +7 −7 book/approach.tex
  2. +1 −1 shared/setup.tex
  3. +4 −4 slides/04.tex
  4. +1 −1 slides/05.tex
@@ -1155,7 +1155,7 @@ \subsubsection{Code Generation}
With the property ^opt:=p^, the configuration setting with this property can be changed by adding the command-line option ^-p^.
\end{example}
\item[opt/long] is used for long command-line options, which differ from short command-line options by supporting strings and not only characters.
\item[readonly] yields compilation errors when developers assign a value to a contextual value within the program.
\item[restrict/write] yields compilation errors when developers assign a value to a contextual value within the program.
\item[default] enables us to start the application even if the backend does not work.
\elektra{Gen} uses it to hard-code default values into the application.
If the backend is available, the property \property{default} is interpreted by the backend.
@@ -1180,7 +1180,7 @@ \subsubsection{Code Generation}
default:=Hello
type:=string
opt:=b
readonly:=1
restrict/write:=1
\end{code}
\par
\elektra{Gen} gives the user read-only access to the object ^env.foo.bar^:
@@ -1192,7 +1192,7 @@ \subsubsection{Code Generation}
\par
Line~1 prints the configuration value of ^/foo/bar^ or ^"Hello"^ (without quotes) by default.
When invoking the application with ^application -b "This world"^, the application would print ^"This world"^ (without quotes).
Line~2 leads to a compilation error because of the property \property{readonly}.
Line~2 leads to a compilation error because of the property \property{restrict/write}.
\end{example}


@@ -2180,13 +2180,13 @@ \subsection{Contextual Value with Policies}
\begin{description}
\item[LockPolicy] determines locking behavior of the class ^Value^ to support concurrent access from several threads.
In the default case, no locking occurs.
\item[WritePolicy] implements the property \property{readonly}.
\item[WritePolicy] implements the property \property{restrict/write}.
It specifies read-only restrictions for a ^Value^.
All operations that change the value of ^Value^ are guarded by static asserts.
If the policy is changed to be ^ReadOnlyPolicy^, the compiler rejects source code that tries to modify contextual values.
^ReadOnlyPolicy^ is a trivial class defining a variable as ^true^.
If the variable is set, the static assertions fail.
To prohibit any changes to a particular configuration setting, users set the property \property{readonly} $\mapsto$ ^1^ (i.\,e., true) as already discussed in \secref{property-opt}.
To prohibit any changes to a particular configuration setting, users set the property \property{restrict/write} $\mapsto$ ^1^ (i.\,e., true) as already discussed in \secref{property-opt}.
\item[SetPolicy] defines how the cache of the class ^Value^'s instances is synchronized with the key set.
One of the design decisions of applications is the namespace of newly-created configuration settings.
This policy supports developers to select the namespace they prefer for their application.
@@ -2254,7 +2254,7 @@ \subsection{Generated APIs}
\begin{code}
[slapd/threads/listener]
type:=long
readonly:=1
restrict/write:=1
default:=1
\end{code}

@@ -2266,7 +2266,7 @@ \subsection{Generated APIs}
WritePolicyIs<ReadOnlyPolicy>> {
... keyNew ("/slapd/threads/listener",
KEY_META, "type", "long",
KEY_META, "readonly", "1",
KEY_META, "restrict/write", "1",
KEY_END) ...
};
\end{code}
@@ -28,7 +28,7 @@
keywordstyle=[4]\color{NavyBlue}\bfseries,
keywordstyle=[5]\color{Mahogany},
%
keywords={layer, require, validation, check, range, description, rationale, requirement, visibility, accessibility, enable, condition, message, default, opt, readonly, type, context, property1, property2, description, file, content, mountpoint, metadata, infos, plugins},
keywords={layer, require, validation, check, range, description, rationale, requirement, visibility, accessibility, enable, condition, message, default, opt, restrict, write, type, context, property1, property2, description, file, content, mountpoint, metadata, infos, plugins},
keywords=[2]{},
keywords=[3]{order, interface, network, emphasized},
%keywords=[4]{[, ]}, %Not needed
@@ -380,7 +380,7 @@ \subsection{How?}
\item[type] represents the type to be used in the emitted source code.
\item[opt] is used for short command-line options to be copied to the namespace \namespace{proc}.
\item[opt/long] is used for long command-line options, which differ from short command-line options by supporting strings and not only characters.
\item[readonly] yields compilation errors when developers assign a value to a contextual value within the program.
\item[restrict/write] yields compilation errors when developers assign a value to a contextual value within the program.
\item[default] enables us to start the application even if the backend does not work.
\end{description}
\end{frame}
@@ -393,7 +393,7 @@ \subsection{How?}
default:=Hello
type:=string
opt:=b
readonly:=1
restrict/write:=1
\end{code}
\par
\elektra{Gen} gives the user read-only access to the object ^env.foo.bar^:
@@ -407,7 +407,7 @@ \subsection{How?}
\pause
Line~1 prints the configuration value of ^/foo/bar^ or ^"Hello"^ (without quotes) by default.
When invoking the application with ^application -b "This world"^, the application would print ^"This world"^ (without quotes).
Line~2 leads to a compilation error because of the property \property{readonly}.
Line~2 leads to a compilation error because of the property \property{restrict/write}.
\end{frame}
\begin{frame}[fragile]
@@ -420,7 +420,7 @@ \subsection{How?}
WritePolicyIs<ReadOnlyPolicy>> {
... keyNew ("/slapd/threads/listener",
KEY_META, "type", "long",
KEY_META, "readonly", "1",
KEY_META, "restrict/write", "1",
KEY_END) ...
};
\end{code}
@@ -248,7 +248,7 @@ \subsection{}
\item[type] represents the type to be used in the emitted source code.
\item[opt] is used for short command-line options to be copied to the namespace \namespace{proc}.
\item[opt/long] is used for long command-line options, which differ from short command-line options by supporting strings and not only characters.
\item[readonly] yields compilation errors when developers assign a value to a contextual value within the program.
\item[restrict/write] yields compilation errors when developers assign a value to a contextual value within the program.
\item[default] enables us to start the application even if the backend does not work.
\end{description}
\end{frame}

0 comments on commit 48cf975

Please sign in to comment.
You can’t perform that action at this time.