Prox Struct Reference

#include <ProxNodeHandle.h>

List of all members.

Public Member Functions

 operator double ()
 operator simtime_t ()
 Prox ()
 Prox (simtime_t prox)
 Prox (simtime_t prox, double acc)
 Prox (double prox, double acc)
bool operator== (Prox p) const
bool operator!= (Prox p) const

Public Attributes

double proximity
double accuracy

Static Public Attributes

static const Prox PROX_SELF
static const Prox PROX_UNKNOWN
static const Prox PROX_TIMEOUT

Friends

std::ostream & operator<< (std::ostream &os, const Prox &prox)

Detailed Description

Definition at line 33 of file ProxNodeHandle.h.


Constructor & Destructor Documentation

Prox::Prox (  ) 

Definition at line 41 of file ProxNodeHandle.cc.

00041 {}

Prox::Prox ( simtime_t  prox  ) 

Definition at line 42 of file ProxNodeHandle.cc.

00042 : proximity(SIMTIME_DBL(prox)), accuracy(1) {}

Prox::Prox ( simtime_t  prox,
double  acc 
)

Definition at line 43 of file ProxNodeHandle.cc.

00043 : proximity(SIMTIME_DBL(prox)), accuracy(acc) {}

Prox::Prox ( double  prox,
double  acc 
)

Definition at line 44 of file ProxNodeHandle.cc.

00044 : proximity(prox), accuracy(acc) {}


Member Function Documentation

Prox::operator double (  ) 

Definition at line 37 of file ProxNodeHandle.cc.

00037 { return proximity; };

Prox::operator simtime_t (  ) 

Definition at line 38 of file ProxNodeHandle.cc.

00038                          { return (proximity >= MAXTIME_DBL)
00039                                    ? MAXTIME : proximity; };

bool Prox::operator!= ( Prox  p  )  const

Definition at line 47 of file ProxNodeHandle.cc.

00047 { return !(*this == p); }

bool Prox::operator== ( Prox  p  )  const

Definition at line 46 of file ProxNodeHandle.cc.

00046 { return proximity == p.proximity && accuracy == p.accuracy; }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Prox prox 
) [friend]

Definition at line 76 of file ProxNodeHandle.cc.

00077 {
00078     if (prox == Prox::PROX_SELF) os << "[self]";
00079     else if (prox == Prox::PROX_UNKNOWN) os << "[unknown]";
00080     else if (prox == Prox::PROX_TIMEOUT) os << "[timeout]";
00081     else {
00082         os << prox.proximity;
00083         if (prox.accuracy != 1) os << " (a=" << prox.accuracy << ")";
00084     }
00085    return os;
00086 }


Member Data Documentation

const Prox Prox::PROX_SELF [static]
const Prox Prox::PROX_TIMEOUT [static]
const Prox Prox::PROX_UNKNOWN [static]

The documentation for this struct was generated from the following files:
Generated on Wed May 26 16:21:18 2010 for OverSim by  doxygen 1.6.3