AddrParamsClass Class Reference

#include <addr-params.h>

Inheritance diagram for AddrParamsClass:

TclClass Collaboration diagram for AddrParamsClass:

Collaboration graph
[legend]

Detailed Description

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

Public Member Functions

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

Static Public Member Functions

static AddrParamsClassinstance ()

Private Attributes

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

Static Private Attributes

static AddrParamsClassinstance_ = NULL


Constructor & Destructor Documentation

AddrParamsClass::AddrParamsClass  )  [inline]
 

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

References instance_.

00060                       : TclClass("AddrParams"),
00061                 hlevel_(1), NodeMask_(NULL), 
00062                 NodeShift_(NULL) {
00063         instance_ = this;
00064     }


Member Function Documentation

void AddrParamsClass::bind  )  [virtual]
 

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

00066 {
00067     TclClass::bind();
00068     add_method("McastShift");
00069     add_method("McastMask");
00070     add_method("NodeShift");
00071     add_method("NodeMask");
00072     add_method("PortMask");
00073     add_method("PortShift");
00074     add_method("hlevel");
00075     add_method("nodebits");
00076 }

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

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

00065                                                       {
00066         Tcl::instance().add_errorf("Cannot create instance of "
00067                        "AddrParamsClass");
00068         return NULL;
00069     }

int AddrParamsClass::hlevel  )  [inline]
 

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

References hlevel_.

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

00081 { return hlevel_; }

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

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

References instance_.

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

00073 { return *instance_; }

int AddrParamsClass::mcast_mask  )  [inline]
 

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

References McastMask_.

00076 { return McastMask_; }

int AddrParamsClass::mcast_shift  )  [inline]
 

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

References McastShift_.

00075 { return McastShift_; }

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

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

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

00079 {
00080     Tcl& tcl = Tcl::instance();
00081     int argc = ac - 2;
00082     const char*const* argv = av + 2;
00083 
00084     if (argc == 2) {
00085         if (strcmp(argv[1], "McastShift") == 0) {
00086             tcl.resultf("%d", McastShift_);
00087             return (TCL_OK);
00088         } else if (strcmp(argv[1], "McastMask") == 0) {
00089             tcl.resultf("%d", McastMask_);
00090             return (TCL_OK);
00091         } else if (strcmp(argv[1], "PortShift") == 0) {
00092             tcl.resultf("%d", PortShift_);
00093             return (TCL_OK);
00094         } else if (strcmp(argv[1], "PortMask") == 0) {
00095             tcl.resultf("%d", PortMask_);
00096             return (TCL_OK);
00097         } else if (strcmp(argv[1], "hlevel") == 0) {
00098             tcl.resultf("%d", hlevel_);
00099             return (TCL_OK);
00100         } else if (strcmp(argv[1], "nodebits") == 0) {
00101             tcl.resultf("%d", nodebits_);
00102             return (TCL_OK);
00103         }
00104     } else if (argc == 3) {
00105         if (strcmp(argv[1], "McastShift") == 0) {
00106             McastShift_ = atoi(argv[2]);
00107             return (TCL_OK);
00108         } else if (strcmp(argv[1], "McastMask") == 0) {
00109             McastMask_ = atoi(argv[2]);
00110             return (TCL_OK);
00111         } else if (strcmp(argv[1], "PortShift") == 0) {
00112             PortShift_ = atoi(argv[2]);
00113             return (TCL_OK);
00114         } else if (strcmp(argv[1], "PortMask") == 0) {
00115             PortMask_ = atoi(argv[2]);
00116             return (TCL_OK);
00117         } else if (strcmp(argv[1], "hlevel") == 0) {
00118             hlevel_ = atoi(argv[2]);
00119             if (NodeMask_ != NULL)
00120                 delete []NodeMask_;
00121             if (NodeShift_ != NULL)
00122                 delete []NodeShift_;
00123             NodeMask_ = new int[hlevel_];
00124             NodeShift_ = new int[hlevel_];
00125             return (TCL_OK);
00126         } else if (strcmp(argv[1], "nodebits") == 0) {
00127             nodebits_ = atoi(argv[2]);
00128             return (TCL_OK);
00129         } else if (strcmp(argv[1], "NodeShift") == 0) {
00130             tcl.resultf("%d", node_shift(atoi(argv[2])-1));
00131             return (TCL_OK);
00132         } else if (strcmp(argv[1], "NodeMask") == 0) {
00133             tcl.resultf("%d", node_mask(atoi(argv[2])-1));
00134             return (TCL_OK);
00135         }
00136     } else if (argc == 4) {
00137         if (strcmp(argv[1], "NodeShift") == 0) {
00138             NodeShift_[atoi(argv[2])-1] = atoi(argv[3]);
00139             return (TCL_OK);
00140         } else if (strcmp(argv[1], "NodeMask") == 0) {
00141             NodeMask_[atoi(argv[2])-1] = atoi(argv[3]);
00142             return (TCL_OK);
00143         }
00144     }
00145     return TclClass::method(ac, av);
00146 }

Here is the call graph for this function:

int AddrParamsClass::node_mask int  n  )  [inline]
 

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

References NodeMask_.

Referenced by method().

00080 { return NodeMask_[n]; }

int AddrParamsClass::node_shift int  n  )  [inline]
 

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

References NodeShift_.

Referenced by method().

00079 { return NodeShift_[n]; }

int AddrParamsClass::nodebits  )  [inline]
 

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

References nodebits_.

00082 { return nodebits_; }

int AddrParamsClass::port_mask  )  [inline]
 

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

References PortMask_.

00078 { return PortMask_; }

int AddrParamsClass::port_shift  )  [inline]
 

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

References PortShift_.

00077 { return PortShift_; }


Field Documentation

int AddrParamsClass::hlevel_ [private]
 

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

Referenced by hlevel(), and method().

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

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

Referenced by AddrParamsClass(), and instance().

int AddrParamsClass::McastMask_ [private]
 

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

Referenced by mcast_mask(), and method().

int AddrParamsClass::McastShift_ [private]
 

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

Referenced by mcast_shift(), and method().

int AddrParamsClass::nodebits_ [private]
 

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

Referenced by method(), and nodebits().

int* AddrParamsClass::NodeMask_ [private]
 

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

Referenced by method(), and node_mask().

int* AddrParamsClass::NodeShift_ [private]
 

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

Referenced by method(), and node_shift().

int AddrParamsClass::PortMask_ [private]
 

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

Referenced by method(), and port_mask().

int AddrParamsClass::PortShift_ [private]
 

Definition at line 87 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 Mar 6 17:02:40 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6