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 72 of file ProxNodeHandle.cc.

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


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 Tue Sep 8 17:27:01 2009 for OverSim by  doxygen 1.5.8