1
0
Fork 0

VTY: Put commands into a global dictionary... avoiding the GC

This commit is contained in:
Holger Hans Peter Freyther 2010-09-14 02:17:15 +08:00
parent c12cd3abdf
commit 44f0ac322b
1 changed files with 16 additions and 0 deletions

View File

@ -143,6 +143,15 @@ Object subclass: OSMOVTY [
OSMOVTY vty_init: app_info.
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 [
@ -211,8 +220,15 @@ Object subclass: VTYCommand [
install_ve [
<category: 'install'>
OSMOVTY commands add: self.
OSMOVTY install_element_ve: command.
]
install: aNode [
<category: 'install'>
OSMOVTY commands add: self.
OSMOVTY install_element: aNode cmd: command.
]
]
Eval [