INET Framework for OMNeT++/OMNEST
inet::ModuleIdAddress Class Reference

This class provides network addresses using the module id of interface modules. More...

#include <ModuleIdAddress.h>

Public Member Functions

 ModuleIdAddress ()
 
 ModuleIdAddress (int id)
 
int getId () const
 
bool tryParse (const char *addr)
 
bool isUnspecified () const
 
bool isUnicast () const
 
bool isMulticast () const
 
bool isBroadcast () const
 
bool operator== (const ModuleIdAddress &addr1) const
 Returns equals(addr). More...
 
bool operator!= (const ModuleIdAddress &addr1) const
 Returns !equals(addr). More...
 
bool operator< (const ModuleIdAddress &addr1) const
 Compares two addresses. More...
 
bool operator<= (const ModuleIdAddress &addr1) const
 
bool operator> (const ModuleIdAddress &addr1) const
 
bool operator>= (const ModuleIdAddress &addr1) const
 
std::string str () const
 

Private Attributes

int id
 

Detailed Description

This class provides network addresses using the module id of interface modules.

The module id address supports unspecified, broadcast and multicast addresses too. This class doesn't support address prefixes.

Constructor & Destructor Documentation

inet::ModuleIdAddress::ModuleIdAddress ( )
inline
39 : id(0) {}
int id
Definition: ModuleIdAddress.h:36
inet::ModuleIdAddress::ModuleIdAddress ( int  id)
inline
40 : id(id) {}
int id
Definition: ModuleIdAddress.h:36

Member Function Documentation

int inet::ModuleIdAddress::getId ( ) const
inline

Referenced by inet::GenericARP::mapUnicastAddress().

42 { return id; }
int id
Definition: ModuleIdAddress.h:36
bool inet::ModuleIdAddress::isBroadcast ( ) const
inline

Referenced by inet::L3Address::isBroadcast().

48 { return id == -1; }
bool inet::ModuleIdAddress::isMulticast ( ) const
inline

Referenced by inet::L3Address::isMulticast().

47 { return id < -1; }
bool inet::ModuleIdAddress::isUnicast ( ) const
inline

Referenced by inet::L3Address::isUnicast().

46 { return id > 0; }
bool inet::ModuleIdAddress::isUnspecified ( ) const
inline

Referenced by inet::L3Address::isUnspecified().

45 { return id == 0; }
bool inet::ModuleIdAddress::operator!= ( const ModuleIdAddress addr1) const
inline

Returns !equals(addr).

58 { return id != addr1.id; }
bool inet::ModuleIdAddress::operator< ( const ModuleIdAddress addr1) const
inline

Compares two addresses.

63 { return id < addr1.id; }
bool inet::ModuleIdAddress::operator<= ( const ModuleIdAddress addr1) const
inline
64 { return id <= addr1.id; }
bool inet::ModuleIdAddress::operator== ( const ModuleIdAddress addr1) const
inline

Returns equals(addr).

53 { return id == addr1.id; }
bool inet::ModuleIdAddress::operator> ( const ModuleIdAddress addr1) const
inline
65 { return id > addr1.id; }
bool inet::ModuleIdAddress::operator>= ( const ModuleIdAddress addr1) const
inline
66 { return id >= addr1.id; }
std::string inet::ModuleIdAddress::str ( ) const
inline

Referenced by inet::L3Address::str().

68 { std::ostringstream s; s << id; return s.str(); }
int id
Definition: ModuleIdAddress.h:36
value< double, units::s > s
Definition: Units.h:1049
bool inet::ModuleIdAddress::tryParse ( const char *  addr)

Referenced by inet::L3Address::tryParse().

23 {
24  char *endp;
25  id = strtol(addr, &endp, 10);
26  return *endp == 0;
27 }

Member Data Documentation

int inet::ModuleIdAddress::id
private

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