Content-Based Networking Simulation Library Documentation (v. 1.2.1) |
Abstract class representing a node in the network. More...
#include <Node.h>
Public Member Functions | |
virtual ssim::ProcessId | activate () |
Override ssim::ProcessWithPId::activate method to initialize some local variables. | |
virtual void | add_neighbor (ssim::ProcessId nid, ssim::Time length) |
Method used to notify a Node about a neighboring process. | |
bool | broadcast_packet (const Packet *packet, ssim::Time lag=0, bool count_all=false) |
Issues a packet to all neighbors (does not include localhost). The count_all parameter controls whether the packets are counted individually for each neighbor pair (true ), or if broadcast counts as a single packet that happens to go to all neighbors (false ). Default is false . | |
virtual size_t | bytesize () const =0 |
Methods used to compute the amount of memory being used by the simulation. | |
unsigned int | control_packets () const |
Returns the number of control packets sent by this node since the last time they were cleared. | |
unsigned int | data_packets () const |
Returns the number of data packets sent by this node since the last time they were cleared. | |
unsigned int | id () const |
Returns the node's ID, as it is read from the topology file. | |
ssim::ProcessId | i2p (unsigned int ifid) const |
Returns the ssim::ProcessId associated with an interface id. | |
virtual void | issue_packet (unsigned int ifid, const Packet *packet, ssim::Time lag=0, bool count=true) |
Method that issues a packet down the specified interface. The count parameter controls whether the data/control counts should be updated with this packet or not. | |
virtual void | issue_packet (ssim::ProcessId pid, const Packet *packet, ssim::Time lag=0) |
Method that issues a packet to the specified process. | |
unsigned int | neighbor_count () const |
Returns the number of neighbors. | |
virtual void | node_fail () |
Method to handle node_fail workload events. | |
virtual bool | has_failed () const =0 |
virtual void | node_recover () |
Method to handle node_recover workload events. | |
unsigned int | p2i (ssim::ProcessId pid) const |
Returns the interface id associated with a particular process. | |
void | process_event (const ssim::Event *evt) |
Method that handles incoming events, converts them to Packets and performs the lookup to determine what interface they came in on. | |
virtual void | process_packet (unsigned int ifid, const Packet &pkt)=0 |
Method to handle incoming packets. The second argument contains the interface that the packet came in on. The third argument tells the simulation if the packet is readable or not. | |
void | reset_packet_counters () |
Resets the packet counters to zer. | |
virtual void | send_message (MessageId mid, const Message &message) |
Method that handles send_message workload events. The mid argument is the unique message id provided by the DeliveryOracle . This must be propagated so that. | |
virtual void | set_predicate (const Predicate &predicate, unsigned int rate, bool pred_null) |
Method that handles set_predicate workload events. | |
virtual void | set_power (power_type p) |
virtual bool | count_power () const =0 |
virtual power_type | power_left () |
unsigned int | x_location () const |
Returns the x location in the simulated topology. | |
unsigned int | y_location () const |
Returns the y location in the simulated topology. | |
Protected Member Functions | |
Node (unsigned int id, unsigned int x, unsigned int y) |
Abstract class representing a node in the network.
virtual void cbnsim::Node::node_fail | ( | ) | [inline, virtual] |
Method to handle node_fail
workload events.
The default implementation is empty.
virtual void cbnsim::Node::node_recover | ( | ) | [inline, virtual] |
Method to handle node_recover
workload events.
The default implementation is empty.
virtual void cbnsim::Node::process_packet | ( | unsigned int | ifid, |
const Packet & | pkt | ||
) | [pure virtual] |
Method to handle incoming packets. The second argument contains the interface that the packet came in on. The third argument tells the simulation if the packet is readable or not.
The default implementation is empty.
virtual void cbnsim::Node::send_message | ( | MessageId | mid, |
const Message & | message | ||
) | [inline, virtual] |
Method that handles send_message
workload events. The mid
argument is the unique message id provided by the DeliveryOracle
. This must be propagated so that.
Default implementation is empty.
virtual void cbnsim::Node::set_predicate | ( | const Predicate & | predicate, |
unsigned int | rate, | ||
bool | pred_null | ||
) | [inline, virtual] |
Method that handles set_predicate
workload events.
Default implementation is empty.
Copyright © 2001-2004 University of Colorado.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". This documentation is authored and maintained by Matthew J. Rutherford |