summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-11-14 19:56:50 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2024-11-16 10:12:49 +0100
commit47bd6afb103c5ddfb4a878e95416793610ed1be3 (patch)
treec06610993cc935c2759019ba3a6972d874799678
parentbb2f021704f06909952dfcae45c212b1a496189a (diff)
Move ReplyBuilder and WaitingRef definitions to network.h
-rw-r--r--src/network.h26
-rw-r--r--src/network/protocol.h24
2 files changed, 26 insertions, 24 deletions
diff --git a/src/network.h b/src/network.h
index 1fc2c87..8ea8b6c 100644
--- a/src/network.h
+++ b/src/network.h
@@ -136,4 +136,30 @@ struct Server::Priv
vector<unique_ptr<Service>> services;
};
+class ReplyBuilder
+{
+public:
+ using Header = NetworkProtocol::Header;
+
+ void header( Header::Item && );
+ void body( const Ref & );
+
+ const vector< Header::Item > & header() const { return mheader; }
+ vector< Object > body() const;
+
+private:
+ vector< Header::Item > mheader;
+ vector< Ref > mbody;
+};
+
+struct WaitingRef
+{
+ const Storage storage;
+ const PartialRef ref;
+ vector< Digest > missing;
+
+ optional< Ref > check();
+ optional< Ref > check( ReplyBuilder &, const vector< Digest > &);
+};
+
}
diff --git a/src/network/protocol.h b/src/network/protocol.h
index f925af4..2db4e63 100644
--- a/src/network/protocol.h
+++ b/src/network/protocol.h
@@ -261,28 +261,4 @@ inline bool operator!=(const NetworkProtocol::Header::Item & left,
inline bool operator==(const NetworkProtocol::Cookie & left, const NetworkProtocol::Cookie & right)
{ return left.value == right.value; }
-class ReplyBuilder
-{
-public:
- void header(NetworkProtocol::Header::Item &&);
- void body(const Ref &);
-
- const vector<NetworkProtocol::Header::Item> & header() const { return mheader; }
- vector<Object> body() const;
-
-private:
- vector<NetworkProtocol::Header::Item> mheader;
- vector<Ref> mbody;
-};
-
-struct WaitingRef
-{
- const Storage storage;
- const PartialRef ref;
- vector<Digest> missing;
-
- optional<Ref> check();
- optional<Ref> check( ReplyBuilder &, const vector< Digest > &);
-};
-
}