Changeset 7580 for trunk/libtransmission/bandwidth.h
- Timestamp:
- Jan 2, 2009, 7:56:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/bandwidth.h
r7579 r7580 20 20 #include "transmission.h" 21 21 #include "ptrarray.h" 22 #include "utils.h" /* tr_new(), tr_free() */ 22 23 23 24 struct tr_peerIo; … … 103 104 tr_session * session; 104 105 tr_ptrArray children; /* struct tr_bandwidth */ 105 tr_ptrArray peers; /* tr_peerIo */106 struct tr_peerIo * peer; 106 107 } 107 108 tr_bandwidth; … … 112 113 **/ 113 114 115 tr_bandwidth* tr_bandwidthConstruct( tr_bandwidth * bandwidth, 116 tr_session * session, 117 tr_bandwidth * parent ); 118 114 119 /** @brief create a new tr_bandwidth object */ 115 tr_bandwidth* 116 tr_bandwidthNew ( tr_session * session, 117 tr_bandwidth * parent ); 118 119 /** @brief destroy a tr_bandwidth object */ 120 void tr_bandwidthFree ( tr_bandwidth * bandwidth ); 120 static inline tr_bandwidth* tr_bandwidthNew( tr_session * session, tr_bandwidth * parent ) 121 { 122 return tr_bandwidthConstruct( tr_new0( tr_bandwidth, 1 ), session, parent ); 123 } 124 125 tr_bandwidth* tr_bandwidthDestruct( tr_bandwidth * bandwidth ); 126 127 /** @brief free a tr_bandwidth object */ 128 static inline void tr_bandwidthFree( tr_bandwidth * bandwidth ) 129 { 130 tr_free( tr_bandwidthDestruct( bandwidth ) ); 131 } 121 132 122 133 /** @brief test to see if the pointer refers to a live bandwidth object */ … … 220 231 * in that particular case we want to ignore the global speed limit... 221 232 */ 222 void tr_bandwidthHonorParentLimits ( tr_bandwidth * bandwidth, 223 tr_direction direction, 224 tr_bool isEnabled ); 225 226 /****** 227 ******* 228 ******/ 229 230 /** 231 * @brief add a tr_peerIo to this bandwidth's list. 232 * They will be notified when more bandwidth is made available for them to consume. 233 */ 234 void tr_bandwidthAddPeer( tr_bandwidth * bandwidth, 233 static inline void tr_bandwidthHonorParentLimits ( tr_bandwidth * bandwidth, 234 tr_direction direction, 235 tr_bool isEnabled ) 236 { 237 assert( tr_isBandwidth( bandwidth ) ); 238 assert( tr_isDirection( direction ) ); 239 240 bandwidth->band[direction].honorParentLimits = isEnabled; 241 } 242 243 /****** 244 ******* 245 ******/ 246 247 void tr_bandwidthSetPeer( tr_bandwidth * bandwidth, 235 248 struct tr_peerIo * peerIo ); 236 249 237 /**238 * @brief remove a peer-io from this bandwidth's list.239 */240 void tr_bandwidthRemovePeer( tr_bandwidth * bandwidth,241 struct tr_peerIo * peerIo );242 243 250 #endif
Note: See TracChangeset
for help on using the changeset viewer.