2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

lib: Utilize smaps in the idl.

String to string maps are used all over the Open vSwitch database.
Before this patch, they were implemented in the idl as parallel
string arrays.  This strategy has proven a bit cumbersome.  With
this patch, string to string maps are implemented using the smap
library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ethan Jackson
2012-05-22 01:53:07 -07:00
parent 79f1cbe9f8
commit a699f6143e
6 changed files with 266 additions and 420 deletions

View File

@@ -450,6 +450,11 @@ class Type(object):
def is_map(self):
return self.value is not None
def is_smap(self):
return (self.is_map()
and self.key.type == StringType
and self.value.type == StringType)
def is_optional_pointer(self):
return (self.is_optional() and not self.value
and (self.key.type == StringType or self.key.ref_table_name))