diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-14 02:17:15 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-14 02:17:15 +0800 |
commit | 44f0ac322be6fc4cdb42e6ab29eb4eec70fdbea5 (patch) | |
tree | 0cd64a4ed6820c675853be3e8dbef891dc9089d8 | |
parent | c12cd3abdf307d23aab7f3f78334f4b758dadc24 (diff) |
VTY: Put commands into a global dictionary... avoiding the GC
-rw-r--r-- | OsmoVTY.st | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 [ |