aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-14 02:17:15 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-14 02:17:15 +0800
commit44f0ac322be6fc4cdb42e6ab29eb4eec70fdbea5 (patch)
tree0cd64a4ed6820c675853be3e8dbef891dc9089d8
parentc12cd3abdf307d23aab7f3f78334f4b758dadc24 (diff)
VTY: Put commands into a global dictionary... avoiding the GC
-rw-r--r--OsmoVTY.st16
1 files changed, 16 insertions, 0 deletions
diff --git a/OsmoVTY.st b/OsmoVTY.st
index 18995a8..2b6e581 100644
--- a/OsmoVTY.st
+++ b/OsmoVTY.st
@@ -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 [