Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb230c76

Browse files
committed
Run clang-format on message/
1 parent28797ac commitb230c76

39 files changed

+615
-632
lines changed

‎message/src/network/detail/debug.hpp‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@
1616
The user can force the logging to be enabled by defining NETWORK_ENABLE_LOGGING.
1717
*/
1818
#if defined(NETWORK_DEBUG) && !defined(NETWORK_ENABLE_LOGGING)
19-
#defineNETWORK_ENABLE_LOGGING
19+
#defineNETWORK_ENABLE_LOGGING
2020
#endif
2121

2222
#ifdef NETWORK_ENABLE_LOGGING
2323

24-
#include<network/logging/logging.hpp>
25-
#ifndef NETWORK_MESSAGE
26-
#defineNETWORK_MESSAGE(msg) {network::logging::log(network::logging::log_record( __FILE__, __LINE__ ) << msg ); }
27-
#endif
24+
#include<network/logging/logging.hpp>
25+
#ifndef NETWORK_MESSAGE
26+
#defineNETWORK_MESSAGE(msg) \
27+
{ \
28+
network::logging::log(network::logging::log_record(__FILE__, __LINE__) \
29+
<< msg); \
30+
}
31+
#endif
2832

2933
#else
3034

31-
#ifndef NETWORK_MESSAGE
32-
#defineNETWORK_MESSAGE(msg)
33-
#endif
34-
35+
#ifndef NETWORK_MESSAGE
36+
#defineNETWORK_MESSAGE(msg)
3537
#endif
3638

39+
#endif
3740

3841
#endif/* end of include guard: NETWORK_DEBUG_HPP_20110410*/

‎message/src/network/detail/directive_base.hpp‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
/** Defines the base type from which all directives inherit
1212
* to allow friend access to message and other types' internals.
1313
*/
14-
namespacenetwork {namespacedetail {
14+
namespacenetwork {
15+
namespacedetail {}// namespace detail
1516

16-
}// namespacedetail
17+
}// namespacenetwork
1718

18-
}// namespace network
19-
20-
#endif// NETWORK_DETAIL_DIRECTIVE_BASE_HPP__
19+
#endif// NETWORK_DETAIL_DIRECTIVE_BASE_HPP__

‎message/src/network/detail/wrapper_base.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
#ifndef NETWORK_DETAIL_WRAPPER_BASE_HPP__
99
#defineNETWORK_DETAIL_WRAPPER_BASE_HPP__
1010

11-
#endif// NETWORK_DETAIL_WRAPPER_BASE_HPP__
11+
#endif// NETWORK_DETAIL_WRAPPER_BASE_HPP__
1212

‎message/src/network/message.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
#include<network/message/message_concept.hpp>
2929
#endif
3030

31-
#endif// NETWORK_MESSAGE_HPP_20111021
31+
#endif// NETWORK_MESSAGE_HPP_20111021

‎message/src/network/message/basic_message.hpp‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,36 @@ struct basic_storage_pimpl;
1616

1717
structbasic_storage_base : message_base {
1818
basic_storage_base();
19-
basic_storage_base(basic_storage_baseconst &);
20-
basic_storage_base(basic_storage_base &&);
21-
virtualvoidset_destination(std::stringconst & destination);
22-
virtualvoidset_source(std::stringconst & source);
23-
virtualvoidappend_header(std::stringconst & name,
24-
std::stringconst & value);
25-
virtualvoidremove_headers(std::stringconst & name);
19+
basic_storage_base(basic_storage_baseconst&);
20+
basic_storage_base(basic_storage_base && );
21+
virtualvoidset_destination(std::stringconst& destination);
22+
virtualvoidset_source(std::stringconst& source);
23+
virtualvoidappend_header(std::stringconst& name, std::stringconst& value);
24+
virtualvoidremove_headers(std::stringconst& name);
2625
virtualvoidremove_headers();
27-
virtualvoidset_body(std::stringconst & body);
28-
virtualvoidappend_body(std::stringconst & data);
29-
30-
virtualvoidget_destination(std::string & destination);
31-
virtualvoidget_source(std::string & source);
32-
virtualvoidget_headers(function<void(std::stringconst &, std::stringconst &)> inserter);
33-
virtualvoidget_headers(std::stringconst & name, function<void(std::stringconst &, std::stringconst &)> inserter);
34-
virtualvoidget_body(std::string & body);
35-
virtualvoidget_body(function<void(iterator_range<charconst *>)> chunk_reader, size_t size);
36-
37-
virtualvoidswap(basic_storage_base & other);
26+
virtualvoidset_body(std::stringconst& body);
27+
virtualvoidappend_body(std::stringconst& data);
28+
29+
virtualvoidget_destination(std::string& destination);
30+
virtualvoidget_source(std::string& source);
31+
virtualvoidget_headers(
32+
function<void(std::stringconst&, std::stringconst&)> inserter);
33+
virtualvoidget_headers(
34+
std::stringconst& name,
35+
function<void(std::stringconst&, std::stringconst&)> inserter);
36+
virtualvoidget_body(std::string& body);
37+
virtualvoidget_body(
38+
function<void(iterator_range<charconst*>)> chunk_reader,
39+
size_t size);
40+
41+
virtualvoidswap(basic_storage_base& other);
3842

3943
virtual~basic_storage_base();
4044
protected:
4145
scoped_ptr<basic_storage_pimpl> pimpl;
4246
};
4347

44-
voidswap(basic_storage_base& l, basic_storage_base& r);
48+
voidswap(basic_storage_base& l, basic_storage_base& r);
4549

4650
}// namespace network
4751

‎message/src/network/message/basic_message.ipp‎

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace network {
1111

1212
structbasic_storage_pimpl {
1313
basic_storage_pimpl();
14-
basic_storage_pimpl(basic_storage_pimplconst&);
14+
basic_storage_pimpl(basic_storage_pimplconst&);
1515

1616
virtual basic_storage_pimpl*clone();
1717
protected:
@@ -23,88 +23,85 @@ struct basic_storage_pimpl {
2323
};
2424

2525
basic_storage_base::basic_storage_base()
26-
: pimpl(new (std::nothrow) basic_storage_pimpl())
27-
{}
26+
: pimpl(new (std::nothrow) basic_storage_pimpl()) {}
2827

29-
basic_storage_base::basic_storage_base(basic_storage_baseconst & other)
30-
: pimpl(other.clone())
31-
{}
28+
basic_storage_base::basic_storage_base(basic_storage_baseconst& other)
29+
: pimpl(other.clone()) {}
3230

33-
voidbasic_storage_base::set_destination(std::stringconst& destination) {
31+
voidbasic_storage_base::set_destination(std::stringconst& destination) {
3432
pimpl->destination_ = destination;
3533
}
3634

37-
voidbasic_storage_base::set_source(std::stringconst& source) {
35+
voidbasic_storage_base::set_source(std::stringconst& source) {
3836
pimpl->source_ = source;
3937
}
4038

41-
voidbasic_storage_base::append_header(std::stringconst& name,
42-
std::stringconst& value) {
39+
voidbasic_storage_base::append_header(std::stringconst& name,
40+
std::stringconst& value) {
4341
pimpl->headers_.insert(std::make_pair(name, value));
4442
}
4543

46-
voidbasic_storage_base::remove_headers(std::stringconst& name) {
44+
voidbasic_storage_base::remove_headers(std::stringconst& name) {
4745
pimpl->headers_.erase(name);
4846
}
4947

5048
voidbasic_storage_base::remove_headers() {
5149
basic_storage_pimpl::headers_container_type().swap(pimpl->headers_);
5250
}
5351

54-
voidbasic_storage_base::set_body(std::stringconst& body) {
52+
voidbasic_storage_base::set_body(std::stringconst& body) {
5553
pimpl->body = body;
5654
}
5755

58-
voidbasic_storage_base::append_body(std::stringconst& data) {
56+
voidbasic_storage_base::append_body(std::stringconst& data) {
5957
pimpl->body.append(data);
6058
}
6159

62-
voidbasic_storage_base::get_destination(std::string& destination) {
60+
voidbasic_storage_base::get_destination(std::string& destination) {
6361
destination = pimpl->destination;
6462
}
6563

66-
voidbasic_storage_base::get_source(std::string& source) {
64+
voidbasic_storage_base::get_source(std::string& source) {
6765
source = pimpl->source;
6866
}
6967

70-
voidbasic_storage_base::get_headers(function<void(std::stringconst &, std::stringconst &)> inserter) {
68+
voidbasic_storage_base::get_headers(
69+
function<void(std::stringconst&, std::stringconst&)> inserter) {
7170
copy(pimpl->headers_, inserter);
7271
}
7372

74-
voidbasic_storage_base::get_headers(std::stringconst & name, function<void(std::stringconst &, std::stringconst &)> inserter) {
75-
basic_storage_pimpl::headers_container_type::const_iterator
76-
it = pimpl->headers_.find(name),
77-
pe = pimpl->headers_.end();
73+
voidbasic_storage_base::get_headers(
74+
std::stringconst& name,
75+
function<void(std::stringconst&, std::stringconst&)> inserter) {
76+
basic_storage_pimpl::headers_container_type::const_iterator it =
77+
pimpl->headers_.find(name), pe = pimpl->headers_.end();
7878
for (; it != pe; ++it)
7979
inserter(it->first, it->second);
8080
}
8181

82-
voidbasic_storage_base::get_body(std::string& body) {
82+
voidbasic_storage_base::get_body(std::string& body) {
8383
// TODO use iostreams!
8484
body = pimpl_->body;
8585
}
8686

87-
voidbasic_storage_base::get_body(function<void(iterator_range<charconst *>)> chunk_reader, size_t size) {
87+
voidbasic_storage_base::get_body(
88+
function<void(iterator_range<charconst*>)> chunk_reader,
89+
size_t size) {
8890
// TODO use iostreams!
89-
std::string::const_iterator it = pimpl->body.begin(),
90-
pe = pimpl->body.end();
91+
std::string::const_iterator it = pimpl->body.begin(), pe = pimpl->body.end();
9192
std::advance(it, size);
9293
chunk_reader(make_iterator_range(it, pe));
9394
pimpl->body.assign(it, pe);
9495
}
9596

96-
basic_storage_base::~basic_storage_base() {
97-
pimpl->reset();
98-
}
97+
basic_storage_base::~basic_storage_base() { pimpl->reset(); }
9998

100-
voidbasic_storage_base::swap(basic_storage_base& other) {
99+
voidbasic_storage_base::swap(basic_storage_base& other) {
101100
std::swap(pimpl, other.pimpl);
102101
}
103102

104-
voidswap(basic_storage_base & l, basic_storage_base & r) {
105-
l.swap(r);
106-
}
103+
voidswap(basic_storage_base& l, basic_storage_base& r) { l.swap(r); }
107104

108105
}/* network*/
109-
106+
110107
#endif/* NETWORK_MESSAGE_BASIC_MESSAGE_IPP_20110911*/

‎message/src/network/message/directives.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ NETWORK_STRING_DIRECTIVE(source);
1717
NETWORK_STRING_DIRECTIVE(destination);
1818
NETWORK_STRING_DIRECTIVE(body);
1919

20-
}// namespace network
20+
}// namespace network
2121

22-
#endif// NETWORK_MESSAGE_DIRECTIVES_HPP__
22+
#endif// NETWORK_MESSAGE_DIRECTIVES_HPP__

‎message/src/network/message/directives/detail/string_directive.hpp‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@
2727
//
2828

2929
#ifndef NETWORK_STRING_DIRECTIVE
30-
#defineNETWORK_STRING_DIRECTIVE(name) \
31-
structname##_directive { \
32-
std::stringconst & value; \
33-
explicit name##_directive(std::stringconst & value_) \
34-
: value(value_) {} \
35-
name##_directive(name##_directiveconst & other) \
36-
: value(other.value) {} \
37-
template<classMessage> \
38-
voidoperator()(Message & message)const { \
39-
message.set_##name(value); \
40-
} \
41-
}; \
42-
\
43-
inline name##_directiveconst \
44-
name (std::stringconst & input) { \
45-
return name##_directive(input); \
46-
}
30+
#defineNETWORK_STRING_DIRECTIVE(name) \
31+
structname##_directive { \
32+
std::stringconst& value; \
33+
explicit name##_directive(std::stringconst& value_) : value(value_) {} \
34+
name##_directive(name##_directiveconst& other) : value(other.value) {} \
35+
template<classMessage>voidoperator()(Message& message)const { \
36+
message.set_##name(value); \
37+
} \
38+
} \
39+
;
40+
41+
inline name##_directiveconstname(std::stringconst& input) {
42+
return name##_directive(input);
43+
}
4744
#endif/* NETWORK_STRING_DIRECTIVE*/
4845

4946
#endif/* NETWORK_MESSAGE_DIRECTIVES_DETAIL_STRING_DIRECTIVE_HPP_20100915*/

‎message/src/network/message/directives/detail/string_value.hpp‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,18 @@
1515
#include<boost/mpl/if.hpp>
1616
#include<boost/mpl/or.hpp>
1717

18-
namespacenetwork {namespacedetail {
18+
namespacenetwork {
19+
namespacedetail {
1920

2021
template<classTag>
21-
structstring_value :
22-
mpl::if_<
23-
is_async<Tag>,
24-
boost::shared_future<typename string<Tag>::type>,
25-
typename mpl::if_<
26-
mpl::or_<
27-
is_sync<Tag>,
28-
is_same<Tag, tags::default_string>,
29-
is_same<Tag, tags::default_wstring>
30-
>,
31-
typename string<Tag>::type,
32-
unsupported_tag<Tag>
33-
>::type
34-
>
35-
{};
22+
structstring_value
23+
: mpl::if_<is_async<Tag>,
24+
boost::shared_future<typename string<Tag>::type>,
25+
typename mpl::if_<mpl::or_<is_sync<Tag>,
26+
is_same<Tag, tags::default_string>,
27+
is_same<Tag, tags::default_wstring>>,
28+
typename string<Tag>::type,
29+
unsupported_tag<Tag>>::type> {};
3630

3731
}// namespace detail
3832
}// namespace network

‎message/src/network/message/directives/header.hpp‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,20 @@ namespace network {
1414
namespaceimpl {
1515

1616
structheader_directive {
17-
explicitheader_directive(std::stringconst & name,
18-
std::stringconst & value);
19-
voidoperator() (message_base & msg)const;
17+
explicitheader_directive(std::stringconst& name, std::stringconst& value);
18+
voidoperator()(message_base& msg)const;
2019
private:
21-
std::stringconst& name_;
22-
std::stringconst& value_;
20+
std::stringconst& name_;
21+
std::stringconst& value_;
2322
};
2423

25-
}// namespace impl
24+
}// namespace impl
2625

27-
inline impl::header_directive
28-
header(std::stringconst & header_name,std::stringconst& header_value) {
29-
returnimpl::header_directive(header_name, header_value);
26+
inline impl::header_directiveheader(std::stringconst& header_name,
27+
std::stringconst& header_value) {
28+
returnimpl::header_directive(header_name, header_value);
3029
}
3130

32-
}// namespace network
31+
}// namespace network
3332

34-
#endif// NETWORK_MESSAGE_DIRECTIVES_HEADER_HPP__
33+
#endif// NETWORK_MESSAGE_DIRECTIVES_HEADER_HPP__

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp