OverSim
Prox Struct Reference

#include <ProxNodeHandle.h>

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
static const Prox PROX_WAITING

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.

{}
Prox::Prox ( simtime_t  prox)

Definition at line 42 of file ProxNodeHandle.cc.

: proximity(SIMTIME_DBL(prox)), accuracy(1) {}
Prox::Prox ( simtime_t  prox,
double  acc 
)

Definition at line 43 of file ProxNodeHandle.cc.

: proximity(SIMTIME_DBL(prox)), accuracy(acc) {}
Prox::Prox ( double  prox,
double  acc 
)

Definition at line 44 of file ProxNodeHandle.cc.

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

Member Function Documentation

Prox::operator double ( )

Definition at line 37 of file ProxNodeHandle.cc.

{ return proximity; };
Prox::operator simtime_t ( )

Definition at line 38 of file ProxNodeHandle.cc.

{ return (proximity >= MAXTIME_DBL)
? MAXTIME : proximity; };
bool Prox::operator!= ( Prox  p) const

Definition at line 47 of file ProxNodeHandle.cc.

{ return !(*this == p); }
bool Prox::operator== ( Prox  p) const

Definition at line 46 of file ProxNodeHandle.cc.

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

{
if (prox == Prox::PROX_SELF) os << "[self]";
else if (prox == Prox::PROX_UNKNOWN) os << "[unknown]";
else if (prox == Prox::PROX_WAITING) os << "[waiting]";
else if (prox == Prox::PROX_TIMEOUT) os << "[timeout]";
else {
os << prox.proximity;
if (prox.accuracy != 1) os << " (a=" << prox.accuracy << ")";
}
return os;
}

Member Data Documentation


The documentation for this struct was generated from the following files: