#include <nNetwork.h>
Public Member Functions | |
nVersion () | |
nVersion (int min, int max) | |
bool | Supported (int version) const |
bool | Merge (const nVersion &a, const nVersion &b) |
int | Min () const |
int | Max () const |
bool | operator!= (const nVersion &other) |
bool | operator== (const nVersion &other) |
nVersion & | operator= (const nVersion &other) |
Private Attributes | |
int | min_ |
int | max_ |
Definition at line 126 of file nNetwork.h.
nVersion::nVersion | ( | ) |
nVersion::nVersion | ( | int | min, | |
int | max | |||
) |
bool nVersion::Supported | ( | int | version | ) | const |
Definition at line 264 of file nNetwork.cpp.
Referenced by nConfItemVersionWatcher::AdaptVersion().
00268 { 00269 int min = a.min_; 00270 if ( min < b.min_ ) 00271 { 00272 min = b.min_; 00273 } 00274 00275 int max = a.max_; 00276 if ( max > b.max_ ) 00277 { 00278 max = b.max_; 00279 } 00280 00281 if ( min <= max ) 00282 { 00283 min_ = min; 00284 max_ = max; 00285 return true; 00286 } 00287 else 00288 { 00289 return false;
int nVersion::Min | ( | ) | const [inline] |
Definition at line 135 of file nNetwork.h.
References min_.
Referenced by nConfItemVersionWatcher::AdaptVersion(), nServerInfo::Compatibility(), nConfItemVersionWatcher::DoWritable(), nConfItemVersionWatcher::FillTemplateParameters(), and nConfItemVersionWatcher::OnVersionChange().
00135 { 00136 return min_; 00137 }
int nVersion::Max | ( | ) | const [inline] |
Definition at line 138 of file nNetwork.h.
References max_.
Referenced by nServerInfo::CalcScore(), nServerInfo::Compatibility(), ePlayerNetID::CreateVoter(), nConfItemVersionWatcher::DoWritable(), login_accept_handler(), and nConfItemVersionWatcher::OnVersionChange().
00138 { 00139 return max_; 00140 }
bool nVersion::operator!= | ( | const nVersion & | other | ) | [inline] |
Definition at line 142 of file nNetwork.h.
References operator==().
00142 { 00143 return !operator==(other); 00144 }
bool nVersion::operator== | ( | const nVersion & | other | ) |
Definition at line 291 of file nNetwork.cpp.
Referenced by operator!=().
int nVersion::min_ [private] |
int nVersion::max_ [private] |