Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3bca295b
Commit
3bca295b
authored
Oct 13, 2016
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add constructors and assign operators
parent
ffb044f1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
38 deletions
+38
-38
libcaf_io/caf/io/uri.hpp
libcaf_io/caf/io/uri.hpp
+29
-19
libcaf_io/src/uri.cpp
libcaf_io/src/uri.cpp
+9
-19
No files found.
libcaf_io/caf/io/uri.hpp
View file @
3bca295b
...
...
@@ -32,16 +32,12 @@
namespace
caf
{
namespace
io
{
namespace
detail
{
class
uri_private
;
void
intrusive_ptr_add_ref
(
uri_private
*
p
);
void
intrusive_ptr_release
(
uri_private
*
p
);
}
// namespace detail
namespace
{
using
str_bounds
=
std
::
pair
<
std
::
string
::
iterator
,
std
::
string
::
iterator
>
;
...
...
@@ -73,7 +69,6 @@ public:
return
(
what
)
?
str
().
compare
(
what
)
:
str
().
compare
(
""
);
}
///
/// @brief Create an empty URI.
///
...
...
@@ -85,7 +80,29 @@ public:
/// @note {@link caf::io::uri uri} is implicit shared, thus copy
/// operations are very fast and lightweight.
///
uri
(
const
uri
&
other
);
uri
(
const
uri
&
other
)
=
default
;
///
/// @brief Create this object from @p other.
/// @param other The original {@link caf::io::uri uri} object.
/// @note {@link caf::io::uri uri} is implicit shared, thus copy
/// operations are very fast and lightweight.
///
uri
(
uri
&&
other
)
=
default
;
///
/// @brief Copy assigment from @p other.
/// @param other Original {@link caf::io::uri uri} object.
/// @returns <code>*this</code>.
///
uri
&
operator
=
(
const
uri
&
other
)
=
default
;
///
/// @brief Move assignment from @p other;
/// @param other Original {@link caf::io::uri uri} object.
/// @return <code>*this</code>.
///
uri
&
operator
=
(
uri
&&
other
)
=
default
;
///
/// @brief Create an URI from @p uri_str.
...
...
@@ -251,13 +268,6 @@ public:
///
void
swap
(
uri
&
other
);
///
/// @brief Equivalent to <code>uri(other).swap(*this)</code>.
/// @param other Original {@link caf::io::uri uri} object.
/// @returns <code>*this</code>.
///
uri
&
operator
=
(
const
uri
&
other
);
/// @cond private
template
<
class
Inspector
>
...
...
@@ -268,9 +278,9 @@ public:
/// @endcond
private:
uri
(
detail
::
uri_private
*
d
);
uri
(
uri_private
*
d
);
intrusive_ptr
<
detail
::
uri_private
>
d_
;
intrusive_ptr
<
uri_private
>
d_
;
};
}
// namespace io
...
...
libcaf_io/src/uri.cpp
View file @
3bca295b
...
...
@@ -44,7 +44,6 @@ using str_bounds = std::pair<std::string::iterator, std::string::iterator>;
namespace
caf
{
namespace
io
{
namespace
detail
{
class
uri_private
:
public
ref_counted
{
friend
optional
<
uri
>
uri
::
make
(
const
string
&
uri_str
);
...
...
@@ -234,7 +233,6 @@ intrusive_ptr<uri_private> m_default_uri_private(new uri_private);
}
// namespace <anonymous>
}
// namespace detail
}
// namespace io
}
// namespace caf
...
...
@@ -242,7 +240,7 @@ namespace caf {
namespace
io
{
optional
<
uri
>
uri
::
make
(
const
string
&
uri_str
)
{
detail
::
uri_private
*
result
=
new
detail
::
uri_private
;
uri_private
*
result
=
new
uri_private
;
if
(
result
->
parse_uri
(
uri_str
))
return
uri
{
result
};
else
{
...
...
@@ -256,22 +254,14 @@ optional<uri> uri::make(const char* cstr) {
return
make
(
tmp
);
}
uri
::
uri
()
:
d_
(
detail
::
m_default_uri_private
)
{
uri
::
uri
()
:
d_
(
m_default_uri_private
)
{
// nop
}
uri
::
uri
(
detail
::
uri_private
*
d
)
:
d_
(
d
)
{
uri
::
uri
(
uri_private
*
d
)
:
d_
(
d
)
{
// nop
}
uri
::
uri
(
const
uri
&
other
)
:
d_
(
other
.
d_
)
{
// nop
}
uri
&
uri
::
operator
=
(
const
uri
&
other
)
{
d_
=
other
.
d_
;
return
*
this
;
}
const
string
&
uri
::
str
()
const
{
return
d_
->
as_string
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment