Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
917b7078
Commit
917b7078
authored
18 years ago
by
tho
Browse files
Options
Downloads
Patches
Plain Diff
added some doc comments
parent
dbe0e950
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Socket/Mainpage.dox
+10
-6
10 additions, 6 deletions
Socket/Mainpage.dox
Socket/SocketPolicy.hh
+16
-7
16 additions, 7 deletions
Socket/SocketPolicy.hh
Socket/SocketProtocol.hh
+2
-0
2 additions, 0 deletions
Socket/SocketProtocol.hh
with
28 additions
and
13 deletions
Socket/Mainpage.dox
+
10
−
6
View file @
917b7078
...
@@ -53,13 +53,17 @@ namespace senf {
...
@@ -53,13 +53,17 @@ namespace senf {
To make your code more flexible, you should not pass around your
To make your code more flexible, you should not pass around your
socket in this form. Most of your code will be using only a small
socket in this form. Most of your code will be using only a small
subset of the ProtocolClientSocketHandle or
subset of the ProtocolClientSocketHandle or
ProtocolServerSocketHandle API. If instead of using the
ProtocolServerSocketHandle API.
If instead of using the
fully specified handle type you use a more incomplete type, you
fully specified handle type you use a more incomplete type, you
allow your code to be used with all socket which fulfill the
allow your code to be used with all sockets which fulfill the
minimal requirements of your code.
minimal requirements of your code. These types are based on the
ClientSocketHandle and ServerSocketHandle templates which implement
This works, by defining a special reduced policy or handle for
the policy interface without providing the concrete protocol interface.
your code:
To use those templates you may define a special reduced policy or handle for
your code. By giving only an incomplete policy you thereby reduce the
interface to that required by your module:
\code
\code
typedef ClientSocketHandle<
typedef ClientSocketHandle<
...
...
This diff is collapsed.
Click to expand it.
Socket/SocketPolicy.hh
+
16
−
7
View file @
917b7078
...
@@ -76,14 +76,18 @@
...
@@ -76,14 +76,18 @@
<dd>configures, if and how buffering is configured for a socket</dd>
<dd>configures, if and how buffering is configured for a socket</dd>
</dl>
</dl>
Every Policy value is identified by a class type. The policy
In a concrete policy, each of these policy axis is assigned a value,
classes themselves built an inheritance hierarchy for each policy
the policy value. This value is identified by a class type. For example,
axis. For each policy axis, the root of this tree is the class
possible values for <em>framingPolicy</em> are <tt>DatagramFramingPolicy</tt>
named \e Policy \c Base (e.g. \p AddressingPolicyBase).
or <tt>StreamFramingPolicy</tt> which are classes derived from the axis
base class <tt>FramingPolicyBase</tt>. This base class doubles as
The senf::SocketPolicy defines the complete policy of a socket. It
<tt>UnspecifiedFramingPolicy</tt> (which is just a typedef alias).
If a policy axis is assigned this Unspecified type, the axis is left
unspecified, the policy will be incomplete.
The senf::SocketPolicy tempalte defines the complete policy of a socket. It
combines a set of policy classes, one for each policy
combines a set of policy classes, one for each policy
axis. Together, they define the behavior of a socket handle. The
axis
as described above
. Together, they define the behavior of a socket handle. The
socket handle instances do not implement any socket functionality
socket handle instances do not implement any socket functionality
themselves instead defering the implementation to the policy
themselves instead defering the implementation to the policy
classes. The SocketHandle interface is therefore \e not
classes. The SocketHandle interface is therefore \e not
...
@@ -100,8 +104,13 @@
...
@@ -100,8 +104,13 @@
compatible. If they are, the more derived SocketHandle can be
compatible. If they are, the more derived SocketHandle can be
converted (assigned to) the more basic SocketHandle.
converted (assigned to) the more basic SocketHandle.
\doc Example (concrete policy, incomplete policy, compatibility/assignment)
\section policy_group_details The Policy Framework Classes
\section policy_group_details The Policy Framework Classes
\doc Policy should be Axis here. Make clear, that this information is only
needed when extending the library.
In the following discussion we will use the following conventions:
In the following discussion we will use the following conventions:
\li \e Policy is one or \c AddressingPolicy, \c FramingPolicy, \c
\li \e Policy is one or \c AddressingPolicy, \c FramingPolicy, \c
CommunicationPolicy, \c ReadPolicy, \c WritePolicy or \c
CommunicationPolicy, \c ReadPolicy, \c WritePolicy or \c
...
...
This diff is collapsed.
Click to expand it.
Socket/SocketProtocol.hh
+
2
−
0
View file @
917b7078
...
@@ -225,6 +225,8 @@ namespace senf {
...
@@ -225,6 +225,8 @@ namespace senf {
protocols themselves, they are combined to build concrete protocols. This structure will
protocols themselves, they are combined to build concrete protocols. This structure will
remove a lot of code duplication. It is important to ensure, that the protocol facets do not
remove a lot of code duplication. It is important to ensure, that the protocol facets do not
overlap, since otherwise there will be problems resolving overlapping members.
overlap, since otherwise there will be problems resolving overlapping members.
\doc init_client init_server
*/
*/
template
<
class
SocketPolicy
>
template
<
class
SocketPolicy
>
class
ConcreteSocketProtocol
class
ConcreteSocketProtocol
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment