From 6815d8cfb1f8aee62609627fbf338dabb1dc0049 Mon Sep 17 00:00:00 2001 From: Victor Grishchenko Date: Mon, 25 Jan 2010 15:06:28 +0100 Subject: [PATCH] more comments is always better --- p2tp.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/p2tp.h b/p2tp.h index e70d18f..f372998 100644 --- a/p2tp.h +++ b/p2tp.h @@ -133,8 +133,11 @@ namespace p2tp { public: - /** Open/submit/retrieve a file. */ - FileTransfer(const char *file_name, const Sha1Hash& _root_hash=Sha1Hash::ZERO); + /** A constructor. Open/submit/retrieve a file. + * @param file_name the name of the file + * @param root_hash the root hash of the file; zero hash if the file + is newly submitted */ + FileTransfer(const char *file_name, const Sha1Hash& root_hash=Sha1Hash::ZERO); /** Close everything. */ ~FileTransfer(); @@ -147,16 +150,24 @@ namespace p2tp { /** Rotating queue read for channels of this transmission. */ int RevealChannel (int& i); + /** Find transfer by the root hash. */ static FileTransfer* Find (const Sha1Hash& hash); + /** Find transfer by the file descriptor. */ static FileTransfer* file (int fd) { return fd