summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi_cpp_gen.py
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-11-13 12:36:56 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-11-29 07:39:22 +0000
commit53fffa1db7cb04982db8977acd61b808ef60d5a8 (patch)
tree7f8c8b25b51d722cc6353c028ddad4e0ad6fcd31 /src/vpp-api/vapi/vapi_cpp_gen.py
parent4f10db317382832068d67b5d19be4a696d80c19a (diff)
API: Add support for type aliases
Previously all types are compound. This adds support for aliases, so one can do things like: typedef u32 interface_index; or typedef u8 ip4_address[4]; Change-Id: I0455cad0123fc88acb491d2a3ea2725426bdb246 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vpp-api/vapi/vapi_cpp_gen.py')
-rwxr-xr-xsrc/vpp-api/vapi/vapi_cpp_gen.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vpp-api/vapi/vapi_cpp_gen.py b/src/vpp-api/vapi/vapi_cpp_gen.py
index 6b62bc4da22..c08993dc918 100755
--- a/src/vpp-api/vapi/vapi_cpp_gen.py
+++ b/src/vpp-api/vapi/vapi_cpp_gen.py
@@ -5,7 +5,7 @@ import os
import sys
import logging
from vapi_c_gen import CField, CEnum, CStruct, CSimpleType, CStructType,\
- CMessage, json_to_c_header_name
+ CMessage, json_to_c_header_name, CAlias
from vapi_json_parser import JsonParser
@@ -21,6 +21,10 @@ class CppEnum(CEnum):
pass
+class CppAlias(CAlias):
+ pass
+
+
class CppSimpleType (CSimpleType):
pass
@@ -251,7 +255,8 @@ if __name__ == '__main__':
struct_type_class=CppStructType,
field_class=CppField,
enum_class=CppEnum,
- message_class=CppMessage)
+ message_class=CppMessage,
+ alias_class=CppAlias)
gen_cpp_headers(jsonparser, logger, args.prefix, args.gen_h_prefix,
args.remove_path)