Commit 5e674dd3 authored by Christopher Alfeld's avatar Christopher Alfeld

A bunch of code to implement class renaming. Net effect is that the names

of the traffice instances now reflect the variables they are stored in,
same as nodes and links.
parent 81891ae6
......@@ -25,6 +25,8 @@ Agent instproc init {} {
$self set node {}
$self set application {}
$self set destination {}
global ::GLOBALS::last_class
set ::GLOBALS::last_class $self
}
Agent instproc set_node {node} {
$self set node $node
......@@ -44,6 +46,13 @@ Agent instproc connect {dst} {
}
set destination $dst
}
Agent instproc rename {old new} {
$self instvar application
# In normal conditions this will never occur.
if {$application != {}} {
$application set agent $new
}
}
# Agent/UDP
Agent/UDP instproc connect {dst} {
......@@ -140,6 +149,8 @@ Agent/Null instproc connect {dst} {
# Application
Application instproc init {} {
$self set agent {}
global ::GLOBALS::last_class
set ::GLOBALS::last_class $self
}
Application instproc attach-agent {agent} {
$self set agent $agent
......@@ -149,6 +160,13 @@ Application instproc get_node {} {
$self instvar agent
return [$agent get_node]
}
Application instproc rename {old new} {
$self instvar agent
# In normal condition sthis will never occur.
if {$agent != {}} {
$agent set_application $self
}
}
# Application/Traffic/CBR
Application/Traffic/CBR instproc init {} {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment