VTY: Put commands into a global dictionary... avoiding the GC
This commit is contained in:
parent
c12cd3abdf
commit
44f0ac322b
16
OsmoVTY.st
16
OsmoVTY.st
|
@ -143,6 +143,15 @@ Object subclass: OSMOVTY [
|
||||||
OSMOVTY vty_init: app_info.
|
OSMOVTY vty_init: app_info.
|
||||||
OSMOVTY telnet_init: nil priv: nil port: 4444.
|
OSMOVTY telnet_init: nil priv: nil port: 4444.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
OSMOVTY class >> commands [
|
||||||
|
^ Smalltalk at: #VTY_Commands ifAbsent: [
|
||||||
|
| array |
|
||||||
|
array := OrderedCollection new.
|
||||||
|
Smalltalk at: #VTY_Commands put: array.
|
||||||
|
array.
|
||||||
|
]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
Object subclass: VTYCommand [
|
Object subclass: VTYCommand [
|
||||||
|
@ -211,8 +220,15 @@ Object subclass: VTYCommand [
|
||||||
|
|
||||||
install_ve [
|
install_ve [
|
||||||
<category: 'install'>
|
<category: 'install'>
|
||||||
|
OSMOVTY commands add: self.
|
||||||
OSMOVTY install_element_ve: command.
|
OSMOVTY install_element_ve: command.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
install: aNode [
|
||||||
|
<category: 'install'>
|
||||||
|
OSMOVTY commands add: self.
|
||||||
|
OSMOVTY install_element: aNode cmd: command.
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
Eval [
|
Eval [
|
||||||
|
|
Reference in New Issue