Skip to content

Commit 38fcd3a

Browse files
committed
Lining up message's get_body
Clang found some hidden virtual functions in message_base. This commit fixes the warnings.
1 parent c20b57e commit 38fcd3a

File tree

2 files changed

+198
-198
lines changed

2 files changed

+198
-198
lines changed

include/network/message/message.hpp

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,62 @@
1515

1616
namespace network {
1717

18-
struct message_pimpl;
18+
struct message_pimpl;
1919

20-
// The common message type.
21-
struct message : message_base {
22-
// Nested types
23-
typedef boost::iterator_range<
20+
// The common message type.
21+
struct message : message_base {
22+
// Nested types
23+
typedef boost::iterator_range<
2424
std::multimap<std::string, std::string>::const_iterator>
2525
headers_range;
2626

27-
// Constructors
28-
message();
29-
message(message const & other);
27+
// Constructors
28+
message();
29+
message(message const & other);
30+
message(message && other) = default;
3031

31-
// Assignment
32-
message & operator=(message other);
32+
// Assignment
33+
message& operator=(message const &other);
34+
message& operator=(message &&other);
3335

34-
// Mutators
35-
virtual void set_destination(std::string const & destination);
36-
virtual void set_source(std::string const & source);
37-
virtual void append_header(std::string const & name,
38-
std::string const & value);
39-
virtual void remove_headers(std::string const & name);
40-
virtual void remove_headers();
41-
virtual void set_body(std::string const & body);
42-
virtual void append_body(std::string const & data);
36+
// Mutators
37+
virtual void set_destination(std::string const & destination);
38+
virtual void set_source(std::string const & source);
39+
virtual void append_header(std::string const & name,
40+
std::string const & value);
41+
virtual void remove_headers(std::string const & name);
42+
virtual void remove_headers();
43+
virtual void set_body(std::string const & body);
44+
virtual void append_body(std::string const & data);
4345

44-
// Retrievers
45-
virtual void get_destination(std::string & destination) const;
46-
virtual void get_source(std::string & source) const;
47-
virtual void get_headers(
48-
boost::function<void(std::string const &, std::string const &)> inserter) const;
49-
virtual void get_headers(
50-
std::string const & name,
51-
boost::function<void(std::string const &, std::string const &)> inserter) const;
52-
virtual void get_headers(
53-
boost::function<bool(std::string const &, std::string const &)> predicate,
54-
boost::function<void(std::string const &, std::string const &)> inserter) const;
55-
virtual void get_body(std::string & body) const;
56-
virtual void get_body(
57-
boost::function<void(boost::iterator_range<char const *>)> chunk_reader,
58-
size_t size) const;
46+
// Retrievers
47+
virtual void get_destination(std::string & destination) const;
48+
virtual void get_source(std::string & source) const;
49+
virtual void get_headers(boost::function<void(std::string const &, std::string const &)> inserter) const;
50+
virtual void get_headers(std::string const & name,
51+
boost::function<void(std::string const &, std::string const &)> inserter) const;
52+
virtual void get_headers(boost::function<bool(std::string const &, std::string const &)> predicate,
53+
boost::function<void(std::string const &, std::string const &)> inserter) const;
54+
virtual void get_body(std::string & body) const;
55+
virtual void get_body(boost::function<void(std::string::const_iterator, size_t)> chunk_reader, size_t size) const;
5956

60-
void swap(message & other);
57+
void swap(message & other);
6158

62-
// Destructor
63-
virtual ~message();
64-
private:
65-
message_pimpl * pimpl;
66-
};
59+
// Destructor
60+
virtual ~message();
61+
private:
62+
message_pimpl * pimpl;
63+
};
6764

68-
inline void swap(message & left, message & right) {
65+
inline void swap(message & left, message & right) {
6966
left.swap(right);
70-
}
67+
}
7168

72-
template <class Directive>
73-
message_base & operator<< (message_base & msg, Directive directive) {
74-
directive(msg);
75-
return msg;
76-
}
69+
template <class Directive>
70+
message_base & operator<< (message_base & msg, Directive directive) {
71+
directive(msg);
72+
return msg;
73+
}
7774

7875
} // namespace network
7976

0 commit comments

Comments
 (0)