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
c1658a3b
Commit
c1658a3b
authored
17 years ago
by
tho
Browse files
Options
Downloads
Patches
Plain Diff
cleanup UNAdressing
parent
af60ed25
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Socket/Protocols/UN/UNAddressing.cc
+5
-11
5 additions, 11 deletions
Socket/Protocols/UN/UNAddressing.cc
Socket/Protocols/UN/UNAddressing.hh
+1
-10
1 addition, 10 deletions
Socket/Protocols/UN/UNAddressing.hh
with
6 additions
and
21 deletions
Socket/Protocols/UN/UNAddressing.cc
+
5
−
11
View file @
c1658a3b
...
@@ -27,8 +27,7 @@
...
@@ -27,8 +27,7 @@
//#include "UNAddressing.ih"
//#include "UNAddressing.ih"
// Custom includes
// Custom includes
#include
<stdio.h>
#include
<boost/operators.hpp>
#define prefix_
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
///////////////////////////////cc.p////////////////////////////////////////
...
@@ -36,18 +35,13 @@
...
@@ -36,18 +35,13 @@
prefix_
senf
::
UNSocketAddress
::
UNSocketAddress
()
prefix_
senf
::
UNSocketAddress
::
UNSocketAddress
()
{}
{}
prefix_
senf
::
UNSocketAddress
::
UNSocketAddress
(
std
::
string
p
)
prefix_
senf
::
UNSocketAddress
::
UNSocketAddress
(
std
::
string
const
&
path
)
{
{
clear
();
clear
();
::
strncpy
(
addr_
.
sun_path
,
p
.
c_str
(),
sizeof
(
addr_
.
sun_path
));
::
strncpy
(
addr_
.
sun_path
,
p
ath
.
c_str
(),
sizeof
(
addr_
.
sun_path
));
addr_
.
sun_path
[
sizeof
(
addr_
.
sun_path
)
-
1
]
=
0
;
addr_
.
sun_path
[
sizeof
(
addr_
.
sun_path
)
-
1
]
=
0
;
}
}
prefix_
senf
::
UNSocketAddress
fromString
(
std
::
string
s
)
{
return
senf
::
UNSocketAddress
::
UNSocketAddress
(
s
);
}
prefix_
bool
senf
::
UNSocketAddress
::
operator
==
(
UNSocketAddress
const
&
other
)
prefix_
bool
senf
::
UNSocketAddress
::
operator
==
(
UNSocketAddress
const
&
other
)
const
const
{
{
...
@@ -55,7 +49,7 @@ prefix_ bool senf::UNSocketAddress::operator==(UNSocketAddress const & other)
...
@@ -55,7 +49,7 @@ prefix_ bool senf::UNSocketAddress::operator==(UNSocketAddress const & other)
}
}
prefix_
std
::
string
senf
::
UNSocketAddress
::
path
()
prefix_
std
::
string
senf
::
UNSocketAddress
::
path
()
const
const
{
{
return
std
::
string
(
addr_
.
sun_path
);
return
std
::
string
(
addr_
.
sun_path
);
}
}
...
@@ -77,7 +71,7 @@ prefix_ sockaddr * senf::UNSocketAddress::sockaddr_p()
...
@@ -77,7 +71,7 @@ prefix_ sockaddr * senf::UNSocketAddress::sockaddr_p()
return
reinterpret_cast
<
struct
sockaddr
*>
(
&
addr_
);
return
reinterpret_cast
<
struct
sockaddr
*>
(
&
addr_
);
}
}
prefix_
sockaddr
const
*
senf
::
UNSocketAddress
::
sockaddr_p
()
prefix_
sockaddr
const
*
senf
::
UNSocketAddress
::
sockaddr_p
()
const
const
{
{
return
reinterpret_cast
<
struct
sockaddr
const
*>
(
&
addr_
);
return
reinterpret_cast
<
struct
sockaddr
const
*>
(
&
addr_
);
...
...
This diff is collapsed.
Click to expand it.
Socket/Protocols/UN/UNAddressing.hh
+
1
−
10
View file @
c1658a3b
...
@@ -31,11 +31,6 @@
...
@@ -31,11 +31,6 @@
#include
<string>
#include
<string>
#include
<sys/socket.h>
#include
<sys/socket.h>
#include
<sys/un.h>
#include
<sys/un.h>
#include
<boost/cstdint.hpp>
#include
<boost/operators.hpp>
#include
"../../../Socket/SocketPolicy.hh"
#include
"../../../Socket/ClientSocketHandle.hh"
#include
"../../../Socket/CommunicationPolicy.hh"
#include
"../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include
"../../../Socket/Protocols/GenericAddressingPolicy.hh"
#include
"../../../Utils/safe_bool.hh"
#include
"../../../Utils/safe_bool.hh"
...
@@ -52,18 +47,14 @@ namespace senf {
...
@@ -52,18 +47,14 @@ namespace senf {
\implementation This implementation is based on sockaddr_un.
\implementation This implementation is based on sockaddr_un.
\ingroup addr_group
\ingroup addr_group
\fixme Why both std::string constructor and from_string member ?
*/
*/
class
UNSocketAddress
class
UNSocketAddress
:
public
comparable_safe_bool
<
UNSocketAddress
>
:
public
comparable_safe_bool
<
UNSocketAddress
>
{
{
public:
public:
UNSocketAddress
();
UNSocketAddress
();
explicit
UNSocketAddress
(
std
::
string
p
);
explicit
UNSocketAddress
(
std
::
string
const
&
path
);
///< Construct an address constant from given path
///< Construct an address constant from given path
static
UNSocketAddress
from_string
(
std
::
string
const
s
);
///< Create UNSocketAddress from string
bool
operator
==
(
UNSocketAddress
const
&
other
)
const
;
bool
operator
==
(
UNSocketAddress
const
&
other
)
const
;
///< Compare UNSocketAddress for equality
///< Compare UNSocketAddress for equality
...
...
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