nVersion Class Reference

#include <nNetwork.h>

List of all members.

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)
nVersionoperator= (const nVersion &other)

Private Attributes

int min_
int max_


Detailed Description

Definition at line 126 of file nNetwork.h.


Constructor & Destructor Documentation

nVersion::nVersion (  ) 

Definition at line 245 of file nNetwork.cpp.

00248 {
00249     min_=0;

nVersion::nVersion ( int  min,
int  max 
)

Definition at line 251 of file nNetwork.cpp.

00254 {
00255     tASSERT( min <= max );
00256     min_=min;


Member Function Documentation

bool nVersion::Supported ( int  version  )  const

Definition at line 258 of file nNetwork.cpp.

00261 {
00262     tASSERT( min_ <= max_ );

bool nVersion::Merge ( const nVersion a,
const nVersion b 
)

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;

Here is the caller graph for this function:

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     }

Here is the caller graph for this function:

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     }

Here is the caller graph for this function:

bool nVersion::operator!= ( const nVersion other  )  [inline]

Definition at line 142 of file nNetwork.h.

References operator==().

00142                                               {
00143         return !operator==(other);
00144     }

Here is the call graph for this function:

bool nVersion::operator== ( const nVersion other  ) 

Definition at line 291 of file nNetwork.cpp.

Referenced by operator!=().

00294 {

Here is the caller graph for this function:

nVersion & nVersion::operator= ( const nVersion other  ) 

Definition at line 296 of file nNetwork.cpp.

00299 {
00300     this->min_ = other.min_;
00301     this->max_ = other.max_;
00302 


Member Data Documentation

int nVersion::min_ [private]

Definition at line 148 of file nNetwork.h.

Referenced by Min().

int nVersion::max_ [private]

Definition at line 148 of file nNetwork.h.

Referenced by Max().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:50:59 2008 for Armagetron Advanced by  doxygen 1.5.4