Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

AddrParamsClass Class Reference

#include <addr-params.h>

Inheritance diagram for AddrParamsClass:

Inheritance graph
[legend]
Collaboration diagram for AddrParamsClass:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AddrParamsClass ()
virtual TclObjectcreate (int, const char *const *)
virtual void bind ()
virtual int method (int ac, const char *const *av)
int mcast_shift ()
int mcast_mask ()
int port_shift ()
int port_mask ()
int node_shift (int n)
int node_mask (int n)
int hlevel ()
int nodebits ()

Static Public Member Functions

AddrParamsClassinstance ()

Private Attributes

int McastShift_
int McastMask_
int PortShift_
int PortMask_
int hlevel_
int * NodeMask_
int * NodeShift_
int nodebits_

Static Private Attributes

AddrParamsClassinstance_ = NULL

Constructor & Destructor Documentation

AddrParamsClass::AddrParamsClass  )  [inline]
 

Definition at line 41 of file addr-params.h.

References hlevel_, instance_, NodeMask_, and NodeShift_.

00041                           : TclClass("AddrParams"),
00042                             hlevel_(1), NodeMask_(NULL), 
00043                             NodeShift_(NULL) {
00044                 instance_ = this;
00045         }


Member Function Documentation

void AddrParamsClass::bind  )  [virtual]
 

Definition at line 42 of file addr-params.cc.

00043 {
00044         TclClass::bind();
00045         add_method("McastShift");
00046         add_method("McastMask");
00047         add_method("NodeShift");
00048         add_method("NodeMask");
00049         add_method("PortMask");
00050         add_method("PortShift");
00051         add_method("hlevel");
00052         add_method("nodebits");
00053 }

virtual TclObject* AddrParamsClass::create int  ,
const char *const * 
[inline, virtual]
 

Definition at line 46 of file addr-params.h.

00046                                                           {
00047                 Tcl::instance().add_errorf("Cannot create instance of "
00048                                            "AddrParamsClass");
00049                 return NULL;
00050         }

int AddrParamsClass::hlevel  )  [inline]
 

Definition at line 62 of file addr-params.h.

References hlevel_.

Referenced by HierClassifier::command(), and HierClassifier::HierClassifier().

00062 { return hlevel_; }

AddrParamsClass& AddrParamsClass::instance  )  [inline, static]
 

Definition at line 54 of file addr-params.h.

References instance_.

Referenced by ManualRoutingModule::add_route(), HierClassifier::command(), and HierClassifier::HierClassifier().

00054 { return *instance_; }

int AddrParamsClass::mcast_mask  )  [inline]
 

Definition at line 57 of file addr-params.h.

References McastMask_.

00057 { return McastMask_; }

int AddrParamsClass::mcast_shift  )  [inline]
 

Definition at line 56 of file addr-params.h.

References McastShift_.

00056 { return McastShift_; }

int AddrParamsClass::method int  ac,
const char *const *  av
[virtual]
 

Definition at line 55 of file addr-params.cc.

References hlevel_, McastMask_, McastShift_, node_mask(), node_shift(), nodebits_, NodeMask_, NodeShift_, PortMask_, and PortShift_.

00056 {
00057         Tcl& tcl = Tcl::instance();
00058         int argc = ac - 2;
00059         const char*const* argv = av + 2;
00060 
00061         if (argc == 2) {
00062                 if (strcmp(argv[1], "McastShift") == 0) {
00063                         tcl.resultf("%d", McastShift_);
00064                         return (TCL_OK);
00065                 } else if (strcmp(argv[1], "McastMask") == 0) {
00066                         tcl.resultf("%d", McastMask_);
00067                         return (TCL_OK);
00068                 } else if (strcmp(argv[1], "PortShift") == 0) {
00069                         tcl.resultf("%d", PortShift_);
00070                         return (TCL_OK);
00071                 } else if (strcmp(argv[1], "PortMask") == 0) {
00072                         tcl.resultf("%d", PortMask_);
00073                         return (TCL_OK);
00074                 } else if (strcmp(argv[1], "hlevel") == 0) {
00075                         tcl.resultf("%d", hlevel_);
00076                         return (TCL_OK);
00077                 } else if (strcmp(argv[1], "nodebits") == 0) {
00078                         tcl.resultf("%d", nodebits_);
00079                         return (TCL_OK);
00080                 }
00081         } else if (argc == 3) {
00082                 if (strcmp(argv[1], "McastShift") == 0) {
00083                         McastShift_ = atoi(argv[2]);
00084                         return (TCL_OK);
00085                 } else if (strcmp(argv[1], "McastMask") == 0) {
00086                         McastMask_ = atoi(argv[2]);
00087                         return (TCL_OK);
00088                 } else if (strcmp(argv[1], "PortShift") == 0) {
00089                         PortShift_ = atoi(argv[2]);
00090                         return (TCL_OK);
00091                 } else if (strcmp(argv[1], "PortMask") == 0) {
00092                         PortMask_ = atoi(argv[2]);
00093                         return (TCL_OK);
00094                 } else if (strcmp(argv[1], "hlevel") == 0) {
00095                         hlevel_ = atoi(argv[2]);
00096                         if (NodeMask_ != NULL)
00097                                 delete []NodeMask_;
00098                         if (NodeShift_ != NULL)
00099                                 delete []NodeShift_;
00100                         NodeMask_ = new int[hlevel_];
00101                         NodeShift_ = new int[hlevel_];
00102                         return (TCL_OK);
00103                 } else if (strcmp(argv[1], "nodebits") == 0) {
00104                         nodebits_ = atoi(argv[2]);
00105                         return (TCL_OK);
00106                 } else if (strcmp(argv[1], "NodeShift") == 0) {
00107                         tcl.resultf("%d", node_shift(atoi(argv[2])-1));
00108                         return (TCL_OK);
00109                 } else if (strcmp(argv[1], "NodeMask") == 0) {
00110                         tcl.resultf("%d", node_mask(atoi(argv[2])-1));
00111                         return (TCL_OK);
00112                 }
00113         } else if (argc == 4) {
00114                 if (strcmp(argv[1], "NodeShift") == 0) {
00115                         NodeShift_[atoi(argv[2])-1] = atoi(argv[3]);
00116                         return (TCL_OK);
00117                 } else if (strcmp(argv[1], "NodeMask") == 0) {
00118                         NodeMask_[atoi(argv[2])-1] = atoi(argv[3]);
00119                         return (TCL_OK);
00120                 }
00121         }
00122         return TclClass::method(ac, av);
00123 }

Here is the call graph for this function:

int AddrParamsClass::node_mask int  n  )  [inline]
 

Definition at line 61 of file addr-params.h.

References NodeMask_.

Referenced by method().

00061 { return NodeMask_[n]; }

int AddrParamsClass::node_shift int  n  )  [inline]
 

Definition at line 60 of file addr-params.h.

References NodeShift_.

Referenced by ManualRoutingModule::add_route(), and method().

00060 { return NodeShift_[n]; }

int AddrParamsClass::nodebits  )  [inline]
 

Definition at line 63 of file addr-params.h.

References nodebits_.

00063 { return nodebits_; }

int AddrParamsClass::port_mask  )  [inline]
 

Definition at line 59 of file addr-params.h.

References PortMask_.

00059 { return PortMask_; }

int AddrParamsClass::port_shift  )  [inline]
 

Definition at line 58 of file addr-params.h.

References PortShift_.

00058 { return PortShift_; }


Member Data Documentation

int AddrParamsClass::hlevel_ [private]
 

Definition at line 70 of file addr-params.h.

Referenced by AddrParamsClass(), hlevel(), and method().

AddrParamsClass * AddrParamsClass::instance_ = NULL [static, private]
 

Definition at line 38 of file addr-params.cc.

Referenced by AddrParamsClass(), and instance().

int AddrParamsClass::McastMask_ [private]
 

Definition at line 67 of file addr-params.h.

Referenced by mcast_mask(), and method().

int AddrParamsClass::McastShift_ [private]
 

Definition at line 66 of file addr-params.h.

Referenced by mcast_shift(), and method().

int AddrParamsClass::nodebits_ [private]
 

Definition at line 73 of file addr-params.h.

Referenced by method(), and nodebits().

int* AddrParamsClass::NodeMask_ [private]
 

Definition at line 71 of file addr-params.h.

Referenced by AddrParamsClass(), method(), and node_mask().

int* AddrParamsClass::NodeShift_ [private]
 

Definition at line 72 of file addr-params.h.

Referenced by AddrParamsClass(), method(), and node_shift().

int AddrParamsClass::PortMask_ [private]
 

Definition at line 69 of file addr-params.h.

Referenced by method(), and port_mask().

int AddrParamsClass::PortShift_ [private]
 

Definition at line 68 of file addr-params.h.

Referenced by method(), and port_shift().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:32:12 2004 for NS2.26SourcesOriginal by doxygen 1.3.3