Public Types | Public Member Functions
RoutingTask Class Reference

Brief description of class still missing. More...

#include <RoutingTask.h>

List of all members.

Public Types

enum  Action { None = 0, Del, Add }

Public Member Functions

Action action () const
const Addressdestination () const
const Addressgateway () const
bool isSameGateway (const RoutingTask &o) const
bool operator< (const RoutingTask &o)
const Addresspeer () const
 RoutingTask ()
 RoutingTask (const RoutingTask &o)
void setAction (Action a)
void setDestination (const Address &d)
void setGateway (const Address &g)
void setPeer (const Address p)
void toLog (int level) const

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Enumeration Documentation

Enumerator:
None 
Del 
Add 
{None=0, Del, Add};

Constructor & Destructor Documentation

Description of constructor still missing

References None.

{
  _action=None;
}
{
  _peer=o._peer;
  _destination=o._destination;
  _gateway=o._gateway;
  _action=o._action;
}

Member Function Documentation

Action RoutingTask::action ( ) const [inline]
{return _action;}
const Address& RoutingTask::destination ( ) const [inline]
{return _destination;}
const Address& RoutingTask::gateway ( ) const [inline]
{return _gateway;}
bool RoutingTask::isSameGateway ( const RoutingTask o) const
{
  if(_peer==o._peer && _destination==o._destination && _gateway==o._gateway) {
    assert(_action!=o._action); // Make sure it is reversed actions
    return true;
  }
  return false;
}
bool RoutingTask::operator< ( const RoutingTask o)
{
  if(_peer<o._peer) return true;
  else if(_peer>o._peer) return false;
  else {
    if(_destination<o._destination) return true;
    else if(_destination>o._destination) return true;
    else {
      return _action<o._action; // Important: Del must be before Add
    }
  }
}
const Address& RoutingTask::peer ( ) const [inline]
{return _peer;}
void RoutingTask::setAction ( Action  a) [inline]
{_action=a;}
void RoutingTask::setDestination ( const Address d) [inline]
{_destination=d;}
void RoutingTask::setGateway ( const Address g) [inline]
{_gateway=g;}
void RoutingTask::setPeer ( const Address  p) [inline]
{_peer=p;}
void RoutingTask::toLog ( int  level) const

References GpCoreTools::Address::toString().

{
  static const char * actionStrings[]={"none", "del", "add"};
  Log::write(level, "%s for node [%s], dest=[%s], gw=[%s]\n",
             actionStrings[_action], _peer.toString().data(),
             _destination.toString().data(), _gateway.toString().data());
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines