aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-12-07 17:17:35 +0100
committerMarek Gradzki <mgradzki@cisco.com>2017-12-07 17:17:39 +0100
commitacf33e49b99f8046ae42ed5fd8bff47be396dd7c (patch)
tree0e2adaa0429e2bf794ddd34650dfa565d254da9d /src
parent8f3ad25c637381da3f499f992c3477768cb636f9 (diff)
jvpp: unify notification handling
Since introduction of dedicated SW Interface Event, there is no need for special handling of messages that can be both requests and events. Change-Id: I76575e32c6d5b19e9a1ca953e5841d8ac3de4de7 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py7
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py2
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/util.py21
3 files changed, 7 insertions, 23 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
index 5f2cdc2ad05..8126912230b 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
@@ -80,7 +80,7 @@ def generate_dtos(func_list, base_package, plugin_package, plugin_name, dto_pack
base_type = ""
# Generate request/reply or dump/dumpReply even if structure can be used as notification
- if not util.is_just_notification(func["name"]):
+ if not util.is_notification(func["name"]):
if util.is_reply(camel_case_dto_name):
description = "reply DTO"
request_dto_name = util.remove_reply_suffix(camel_case_dto_name)
@@ -107,9 +107,8 @@ def generate_dtos(func_list, base_package, plugin_package, plugin_name, dto_pack
write_dto_file(base_package, plugin_package, base_type, camel_case_dto_name, description, dto_package,
dto_path, fields, func, inputfile, methods)
-
- # for structures that are also used as notifications, generate dedicated notification DTO
- if util.is_notification(func["name"]):
+ else:
+ # for structures that are also used as notifications, generate dedicated notification DTO
description = "notification DTO"
dto_path = os.path.join(dto_package, camel_case_dto_name + ".java")
methods = generate_dto_base_methods(camel_case_dto_name, func)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
index e67b6ecfa5d..a02f04d6ce7 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
@@ -145,7 +145,7 @@ def generate_jni_impl(func_list, plugin_name, inputfile):
f_name = f['name']
camel_case_function_name = util.underscore_to_camelcase(f_name)
if is_manually_generated(f_name) or util.is_reply(camel_case_function_name) \
- or util.is_just_notification(f_name):
+ or util.is_notification(f_name):
continue
arguments = ''
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/util.py b/src/vpp-api/java/jvpp/gen/jvppgen/util.py
index 6c2ffbc420c..ce34f8549d8 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/util.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/util.py
@@ -148,16 +148,12 @@ jni_field_accessors = {'u8': 'ByteField',
'f64[]': 'ObjectField'
}
-# FIXME no convention in the naming of events (notifications) in vpe.api
-notifications_message_suffixes = ("event", "counters")
def is_notification(name):
- """ Returns true if the structure is a notification regardless of its no other use """
- return is_just_notification(name)
+ """ Returns true if the structure is a notification """
+ # FIXME no convention in the naming of events (notifications) in vpe.api
+ notifications_message_suffixes = ("event", "counters")
-
-def is_just_notification(name):
- """ Returns true if the structure is just a notification and has no other use """
return name.lower().endswith(notifications_message_suffixes)
@@ -182,16 +178,5 @@ def api_message_to_javadoc(api_message):
return " * " + str.replace("\n", "\n * ")
-notification_dto_suffix = "Notification"
-
-
-def add_notification_suffix(camel_case_dto_name):
- camel_case_dto_name += notification_dto_suffix
- return camel_case_dto_name
-
-
def is_array(java_type_as_string):
return java_type_as_string.endswith("[]")
-
-def is_want(name):
- return name.startswith("want_") \ No newline at end of file
href='#n148'>148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593