summaryrefslogtreecommitdiff
path: root/src/PeerSessionResource.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-29 12:12:22 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-29 12:12:22 +0000
commit8b6da1ee367af8e65278fd1c5ada253f07b57bd9 (patch)
tree6e0d44a59e112a17c71a9396c77725cadd6549a2 /src/PeerSessionResource.h
parent30f362319e25d7c2182f6f46d1297385c39787b8 (diff)
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
Diffstat (limited to 'src/PeerSessionResource.h')
-rw-r--r--src/PeerSessionResource.h75
1 files changed, 60 insertions, 15 deletions
diff --git a/src/PeerSessionResource.h b/src/PeerSessionResource.h
index f0828c0e..cfe148af 100644
--- a/src/PeerSessionResource.h
+++ b/src/PeerSessionResource.h
@@ -87,39 +87,60 @@ public:
~PeerSessionResource();
// localhost is choking this peer
- bool amChoking() const;
+ bool amChoking() const
+ {
+ return _amChoking;
+ }
void amChoking(bool b);
// localhost is interested in this peer
- bool amInterested() const;
+ bool amInterested() const
+ {
+ return _amInterested;
+ }
void amInterested(bool b);
// this peer is choking localhost
- bool peerChoking() const;
+ bool peerChoking() const
+ {
+ return _peerChoking;
+ }
void peerChoking(bool b);
// this peer is interested in localhost
- bool peerInterested() const;
+ bool peerInterested() const
+ {
+ return _peerInterested;
+ }
void peerInterested(bool b);
// this peer should be choked
- bool chokingRequired() const;
+ bool chokingRequired() const
+ {
+ return _chokingRequired;
+ }
void chokingRequired(bool b);
// this peer is eligible for unchoking optionally.
- bool optUnchoking() const;
+ bool optUnchoking() const
+ {
+ return _optUnchoking;
+ }
void optUnchoking(bool b);
bool shouldBeChoking() const;
// this peer is snubbing.
- bool snubbing() const;
+ bool snubbing() const
+ {
+ return _snubbing;
+ }
void snubbing(bool b);
@@ -137,7 +158,10 @@ public:
void markSeeder();
- bool fastExtensionEnabled() const;
+ bool fastExtensionEnabled() const
+ {
+ return _fastExtensionEnabled;
+ }
void fastExtensionEnabled(bool b);
@@ -149,13 +173,19 @@ public:
bool peerAllowedIndexSetContains(size_t index) const;
// fast index set which localhost has sent to a peer.
- const std::deque<size_t>& amAllowedIndexSet() const;
+ const std::deque<size_t>& amAllowedIndexSet() const
+ {
+ return _amAllowedIndexSet;
+ }
void addAmAllowedIndex(size_t index);
bool amAllowedIndexSetContains(size_t index) const;
- bool extendedMessagingEnabled() const;
+ bool extendedMessagingEnabled() const
+ {
+ return _extendedMessagingEnabled;
+ }
void extendedMessagingEnabled(bool b);
@@ -165,13 +195,22 @@ public:
void addExtension(const std::string& name, uint8_t id);
- bool dhtEnabled() const;
+ bool dhtEnabled() const
+ {
+ return _dhtEnabled;
+ }
void dhtEnabled(bool b);
- PeerStat& getPeerStat();
+ PeerStat& getPeerStat()
+ {
+ return _peerStat;
+ }
- unsigned int latency() const;
+ unsigned int latency() const
+ {
+ return _latency;
+ }
void updateLatency(unsigned int latency);
@@ -183,9 +222,15 @@ public:
void updateDownloadLength(size_t bytes);
- const Time& getLastDownloadUpdate() const;
+ const Time& getLastDownloadUpdate() const
+ {
+ return _lastDownloadUpdate;
+ }
- const Time& getLastAmUnchoking() const;
+ const Time& getLastAmUnchoking() const
+ {
+ return _lastAmUnchoking;
+ }
uint64_t getCompletedLength() const;