1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 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 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
|
//File: CosCollection.idl
//This is the single module for the Collection Service
#ifndef _COS_COLLECTION_IDL_
#define _COS_COLLECTION_IDL_
// omniORB specific pragmas to insert extra includes into the stub header.
#pragma hh #include "COS_sysdep.h"
#pragma prefix "omg.org"
#include <orb.idl>
module CosCollection {
interface Collection;
// T y p e d e f i n i t i o n s
typedef sequence<any> AnySequence;
typedef string Istring;
struct NVPair {
Istring name;
any value;
};
typedef sequence<NVPair> ParameterList;
// E x c e p t i o n s
exception EmptyCollection{};
exception PositionInvalid{};
enum IteratorInvalidReason {is_invalid,
is_not_for_collection,
is_const};
exception IteratorInvalid {IteratorInvalidReason why;};
exception IteratorInBetween{};
enum ElementInvalidReason { element_type_invalid,
positioning_property_invalid,
element_exists};
exception ElementInvalid {ElementInvalidReason why;};
exception KeyInvalid {};
exception ParameterInvalid {unsigned long which; Istring why;};
// O p e r a t i o n s
interface Operations {
// e l e m e n t t y p e s p e c i f i c
// i n f o r m a t i o n
readonly attribute CORBA::TypeCode element_type;
boolean check_element_type (in any element);
boolean equal (in any element1, in any element2);
long compare (in any element1, in any element2);
unsigned long hash (in any element, in unsigned long value);
// k e y r e t r i e v a l
any key (in any element);
// k e y t y p e s p e c i f i c
// i n f o r m a t i o n
readonly attribute CORBA::TypeCode key_type;
boolean check_key_type (in any a_key);
boolean key_equal (in any a_key1, in any a_key2);
long key_compare (in any a_key1, in any a_key2);
unsigned long key_hash (in any thisKey,
in unsigned long value);
// d e s t r o y i n g
void destroy();
};
interface Command {
boolean do_on (in any element);
};
interface Comparator {
long compare (in any element1, in any element2);
};
// Iterators
// I t e r a t o r
interface Iterator {
// m o v i n g i t e r a t o r s
boolean set_to_first_element ();
boolean set_to_next_element() raises (IteratorInvalid);
boolean set_to_next_nth_element (in unsigned long n)
raises (IteratorInvalid);
// r e t r i e v i n g e l e m e n t s
boolean retrieve_element (out any element)
raises (IteratorInvalid, IteratorInBetween);
boolean retrieve_element_set_to_next (
out any element,
out boolean more)
raises (IteratorInvalid, IteratorInBetween);
boolean retrieve_next_n_elements (
in unsigned long n,
out AnySequence result,
out boolean more)
raises (IteratorInvalid, IteratorInBetween);
boolean not_equal_retrieve_element_set_to_next (
in Iterator test,
out any element)
raises (IteratorInvalid, IteratorInBetween);
// r e m o v i n g e l e m e n t s
void remove_element()
raises (IteratorInvalid, IteratorInBetween);
boolean remove_element_set_to_next()
raises (IteratorInvalid, IteratorInBetween);
boolean remove_next_n_elements (
in unsigned long n,
out unsigned long actual_number)
raises (IteratorInvalid, IteratorInBetween);
boolean not_equal_remove_element_set_to_next (in Iterator test)
raises (IteratorInvalid, IteratorInBetween);
// r e p l a c i n g e l e m e n t s
void replace_element (in any element)
raises (IteratorInvalid, IteratorInBetween, ElementInvalid);
boolean replace_element_set_to_next (in any element)
raises(IteratorInvalid, IteratorInBetween, ElementInvalid);
boolean replace_next_n_elements (
in AnySequence elements,
out unsigned long actual_number)
raises (IteratorInvalid, IteratorInBetween, ElementInvalid);
boolean not_equal_replace_element_set_to_next (
in Iterator test,
in any element)
raises(IteratorInvalid, IteratorInBetween, ElementInvalid);
// a d d i n g e l e m e n t s
boolean add_element_set_iterator (in any element)raises
(ElementInvalid);
boolean add_n_elements_set_iterator (
in AnySequence elements,
out unsigned long actual_number)
raises (ElementInvalid);
// s e t t i n g i t e r a t o r s t a t e
void invalidate ();
// t e s t i n g i t e r a t o r s
boolean is_valid ();
boolean is_in_between ();
boolean is_for(in Collection collector);
boolean is_const ();
boolean is_equal (in Iterator test) raises (IteratorInvalid);
// c l o n i n g , a s s i g n i n g ,
// d e s t r o y i n g i t e r a t o r s
Iterator clone ();
void assign (in Iterator from_where) raises (IteratorInvalid);
void destroy ();
};
// O r d e r e d I t e r a t o r
interface OrderedIterator: Iterator {
// m o v i n g i t e r a t o r s
boolean set_to_last_element ();
boolean set_to_previous_element() raises (IteratorInvalid);
boolean set_to_nth_previous_element(in unsigned long n)
raises (IteratorInvalid);
void set_to_position (in unsigned long position)
raises (PositionInvalid);
// c o m p u t i n g i t e r a t o r p o s i t i o n
unsigned long position () raises (IteratorInvalid);
// r e t r i e v i n g e l e m e n t s
boolean retrieve_element_set_to_previous(
out any element,
out boolean more)
raises (IteratorInvalid, IteratorInBetween);
boolean retrieve_previous_n_elements (
in unsigned long n,
out AnySequence result,
out boolean more)
raises (IteratorInvalid, IteratorInBetween);
boolean not_equal_retrieve_element_set_to_previous (
in Iterator test,
out any element)
raises (IteratorInvalid, IteratorInBetween);
// r e m o v i n g e l e m e n t s
boolean remove_element_set_to_previous()
raises (IteratorInvalid, IteratorInBetween);
boolean remove_previous_n_elements (
in unsigned long n,
out unsigned long actual_number)
raises (IteratorInvalid, IteratorInBetween);
boolean not_equal_remove_element_set_to_previous(
in Iterator test)
raises (IteratorInvalid, IteratorInBetween);
// r e p l a c i n g e l e m e n t s
boolean replace_element_set_to_previous(in any element)
raises (IteratorInvalid, IteratorInBetween, ElementInvalid);
boolean replace_previous_n_elements(
in AnySequence elements,
out unsigned long actual_number)
raises (IteratorInvalid, IteratorInBetween, ElementInvalid);
boolean not_equal_replace_element_set_to_previous (
in Iterator test,
in any element)
raises (IteratorInvalid, IteratorInBetween, ElementInvalid);
// t e s t i n g i t e r a t o r s
boolean is_first ();
boolean is_last ();
boolean is_for_same (in Iterator test);
boolean is_reverse ();
};
// S e q u e n t i a l I t e r a t o r
interface SequentialIterator : OrderedIterator {
// adding elements
boolean add_element_as_next_set_iterator (in any element)
raises(IteratorInvalid, ElementInvalid);
void add_n_elements_as_next_set_iterator(
in AnySequence elements)
raises(IteratorInvalid, ElementInvalid);
boolean add_element_as_previous_set_iterator(in any element)
raises(IteratorInvalid, ElementInvalid);
void add_n_elements_as_previous_set_iterator(
in AnySequence elements)
raises(IteratorInvalid, ElementInvalid);
};
// K e y I t e r a t o r
interface KeyIterator : Iterator {
// m o v i n g t h e i t e r a t o r s
boolean set_to_element_with_key (in any a_key)
raises(KeyInvalid);
boolean set_to_next_element_with_key (in any a_key)
raises(IteratorInvalid, KeyInvalid);
boolean set_to_next_element_with_different_key()
raises (IteratorInBetween, IteratorInvalid);
// r e t r i e v i n g t h e k e y s
boolean retrieve_key (out any a_key)
raises (IteratorInBetween, IteratorInvalid);
boolean retrieve_next_n_keys (out AnySequence some_keys)
raises (IteratorInBetween, IteratorInvalid);
};
// E q u a l i t y I t e r a t o r
interface EqualityIterator : Iterator {
// m o v i n g t h e i t e r a t o r s
boolean set_to_element_with_value(in any element)
raises(ElementInvalid);
boolean set_to_next_element_with_value(in any element)
raises (IteratorInvalid, ElementInvalid);
boolean set_to_next_element_with_different_value()
raises (IteratorInBetween, IteratorInvalid);
};
// E q u a l i t y K e y I t e r a t o r
interface EqualityKeyIterator : EqualityIterator, KeyIterator {};
// S o r t e d I t e r a t o r
interface SortedIterator : OrderedIterator {};
// e n u m e r a t i o n t y p e f o r s p e c i f y i n g r a n g e s
enum LowerBoundStyle {equal_lo, greater, greater_or_equal};
enum UpperBoundStyle {equal_up, less, less_or_equal};
// K e y S o r t e d I t e r a t o r
interface KeySortedIterator : KeyIterator, SortedIterator {
// m o v i n g t h e i t e r a t o r s
boolean set_to_first_element_with_key (
in any a_key,
in LowerBoundStyle style)
raises(KeyInvalid);
boolean set_to_last_element_with_key (
in any a_key,
in UpperBoundStyle style)
raises (KeyInvalid);
boolean set_to_previous_element_with_key (in any a_key)
raises(IteratorInvalid, KeyInvalid);
boolean set_to_previous_element_with_different_key()
raises (IteratorInBetween, IteratorInvalid);
// r e t r i e v i n g k e y s
boolean retrieve_previous_n_keys(out AnySequence some_keys)
raises (IteratorInBetween, IteratorInvalid);
};
// E q u a l i t y S o r t e d I t e r a t o r
interface EqualitySortedIterator :
EqualityIterator, SortedIterator {
// m o v i n g t h e i t e r a t o r
boolean set_to_first_element_with_value (
in any element,
in LowerBoundStyle style)
raises (ElementInvalid);
boolean set_to_last_element_with_value (
in any element,
in UpperBoundStyle style)
raises (ElementInvalid);
boolean set_to_previous_element_with_value (in any elementally)
raises (IteratorInvalid, ElementInvalid);
boolean set_to_previous_element_with_different_value()
raises (IteratorInBetween, IteratorInvalid);
};
// E q u a l i t y K e y S o r t e d I t e r a t o r
interface EqualityKeySortedIterator :
EqualitySortedIterator, KeySortedIterator {};
// E q u a l i t y S e q u e n t i a l I t e r a t o r
interface EqualitySequentialIterator :
EqualityIterator, SequentialIterator {
// l o c a t i n g e l e m e n t s
boolean set_to_first_element_with_value (in any element)
raises (ElementInvalid);
boolean set_to_last_element_with_value (in any element)
raises (ElementInvalid);
boolean set_to_previous_element_with_value (in any element)
raises (ElementInvalid);
};
interface Collection {
// e l e m e n t t y p e i n f o r m a t i o n
readonly attribute CORBA::TypeCode element_type;
// a d d i n g e l e m e n t s
boolean add_element (in any element)
raises (ElementInvalid);
boolean add_element_set_iterator (
in any element,
in Iterator where)
raises (IteratorInvalid, ElementInvalid);
void add_all_from (in Collection collector)
raises (ElementInvalid);
// r e m o v i n g e l e m e n t s
void remove_element_at (in Iterator where)
raises (IteratorInvalid, IteratorInBetween);
unsigned long remove_all ();
// r e p l a c i n g e l e m e n t s
void replace_element_at (
in Iterator where,
in any element)
raises(IteratorInvalid, IteratorInBetween, ElementInvalid);
// r e t r i e v i n g e l e m e n t s
boolean retrieve_element_at (
in Iterator where,
out any element)
raises (IteratorInvalid, IteratorInBetween);
// i t e r a t i n g o v e r t h e c o l l e c t i o n
boolean all_elements_do (in Command what) ;
// i n q u i r i n g c o l l e c t i o n
// i n f o r m a t i o n
unsigned long number_of_elements ();
boolean is_empty ();
// d e s t r o y i n g c o l l e c t i o n
void destroy();
// c r e a t i n g i t e r a t o r s
Iterator create_iterator (in boolean read_only);
};
// O r d e r e d C o l l e c t i o n
interface OrderedCollection: Collection {
// r e m o v i n g e l e m e n t s
void remove_element_at_position (in unsigned long position)
raises (PositionInvalid);
void remove_first_element () raises (EmptyCollection);
void remove_last_element () raises (EmptyCollection);
// r e t r i e v i n g e l e m e n t s
boolean retrieve_element_at_position (
in unsigned long position,
out any element)
raises (PositionInvalid);
boolean retrieve_first_element (out any element)
raises (EmptyCollection);
boolean retrieve_last_element (out any element)
raises (EmptyCollection);
// c r e a t i n g i t e r a t o r s
OrderedIterator create_ordered_iterator(
in boolean read_only,
in boolean reverse_iteration);
};
// S e q u e n t i a l C o l l e c t i o n
interface SequentialCollection: OrderedCollection {
// a d d i n g e l e m e n t s
void add_element_as_first (in any element)
raises (ElementInvalid);
void add_element_as_first_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
void add_element_as_last (in any element)
raises (ElementInvalid);
void add_element_as_last_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
void add_element_as_next (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
void add_element_as_previous (
in any element,
in Iterator where)
raises (ElementInvalid,IteratorInvalid);
void add_element_at_position (
in unsigned long position,
in any element)
raises(PositionInvalid, ElementInvalid);
void add_element_at_position_set_iterator (
in unsigned long position,
in any element,
in Iterator where)
raises (PositionInvalid, ElementInvalid, IteratorInvalid);
// r e p l a c i n g e l e m e n t s
void replace_element_at_position (
in unsigned long position,
in any element)
raises (PositionInvalid, ElementInvalid);
void replace_first_element (in any element)
raises (ElementInvalid, EmptyCollection);
void replace_last_element (in any element)
raises (ElementInvalid, EmptyCollection);
// r e o r d e r i n g e l e m e n t s
void sort (in Comparator comparison); void reverse();
};
// S o r t e C o l l e c t i o n
interface SortedCollection: OrderedCollection{};
// E q u a l i t y C o l l e c t i o n
interface EqualityCollection: Collection {
// t e s t i n g e l e m e n t c o n t a i n m e n t
boolean contains_element (in any element)
raises(ElementInvalid);
boolean contains_all_from (in Collection collector)
raises(ElementInvalid);
// a d d i n g e l e m e n t s
boolean locate_or_add_element (in any element)
raises (ElementInvalid);
boolean locate_or_add_element_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
// l o c a t i n g e l e m e n t s
boolean locate_element (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_next_element (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_next_different_element (in Iterator where)
raises (IteratorInvalid, IteratorInBetween);
// r e m o v i n g e l e m e n t s
boolean remove_element (in any element)
raises (ElementInvalid);
unsigned long remove_all_occurrences (in any element)
raises (ElementInvalid);
// i n q u i r i n g c o l l e c t i o n
// i n f o r m a t i o n
unsigned long number_of_different_elements ();
unsigned long number_of_occurrences (in any element)
raises(ElementInvalid);
};
// K e y C o l l e c t i o n
interface KeyCollection: Collection {
// K e y t y p e i n f o r m a t i o n
readonly attribute CORBA::TypeCode key_type;
// t e s t i n g c o n t a i n m e n t
boolean contains_element_with_key (in any a_key)
raises(KeyInvalid);
boolean contains_all_keys_from (in KeyCollection collector)
raises(KeyInvalid);
// a d d i n g e l e m e n t s
boolean locate_or_add_element_with_key (in any element)
raises(ElementInvalid);
boolean locate_or_add_element_with_key_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
// a d d i n g o r r e p l a c i n g e l e m e n t s
boolean add_or_replace_element_with_key (in any element)
raises(ElementInvalid);
boolean add_or_replace_element_with_key_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
// r e m o v i n g e l e m e n t s
boolean remove_element_with_key(in any a_key)
raises(KeyInvalid);
unsigned long remove_all_elements_with_key (in any a_key)
raises(KeyInvalid);
// r e p l a c i n g e l e m e n t s
boolean replace_element_with_key (in any element)
raises(ElementInvalid);
boolean replace_element_with_key_set_iterator (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
// r e t r i e v i n g e l e m e n t s
boolean retrieve_element_with_key (
in any a_key,
out any element)
raises (KeyInvalid);
// c o m p u t i n g t h e k e y s
void key (in any element, out any a_key)
raises (ElementInvalid);
void keys (in AnySequence elements, out AnySequence some_keys)
raises (ElementInvalid);
// l o c a t i n g e l e m e n t s
boolean locate_element_with_key (
in any key,
in Iterator where)
raises (KeyInvalid, IteratorInvalid);
boolean locate_next_element_with_key (
in any key,
in Iterator where)
raises (KeyInvalid, IteratorInvalid);
boolean locate_next_element_with_different_key (
in Iterator where)
raises (IteratorInBetween, IteratorInvalid);
// i n q u i r i n g c o l l e c t i o n
// i n f o r m a t i o n
unsigned long number_of_different_keys ();
unsigned long number_of_elements_with_key (in any a_key)
raises(KeyInvalid);
};
// E q u a l i t y K e y C o l l e c t i o n
interface EqualityKeyCollection :
EqualityCollection, KeyCollection{};
// K e y S o r t e d C o l l e c t i o n
interface KeySortedCollection :
KeyCollection, SortedCollection {
// l o c a t i n g e l e m e n t s
boolean locate_first_element_with_key (
in any key,
in Iterator where)
raises (KeyInvalid, IteratorInvalid);
boolean locate_last_element_with_key(
in any key,
in Iterator where)
raises (KeyInvalid, IteratorInvalid);
boolean locate_previous_element_with_key (
in any key,
in Iterator where)
raises (KeyInvalid, IteratorInvalid);
boolean locate_previous_element_with_different_key(
in Iterator where)
raises (IteratorInBetween, IteratorInvalid);
};
// E q u a l i t y S o r t e d C o l l e c t i o n
interface EqualitySortedCollection :
EqualityCollection, SortedCollection {
// l o c a t i n g e l e m e n t s
boolean locate_first_element (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_last_element (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_previous_element (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_previous_different_element (in Iterator where)
raises (IteratorInvalid);
};
// E q u a l i t y K e y S o r t e d C o l l e c t i o n
interface EqualityKeySortedCollection :
EqualityCollection, KeyCollection, SortedCollection {};
// E q u a l i t y S e q u e n t i a l C o l l e c t i o n
interface EqualitySequentialCollection :
EqualityCollection, SequentialCollection {
// l o c a t i n g e l e m e n t s
boolean locate_first_element_with_value (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_last_element_with_value (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
boolean locate_previous_element_with_value (
in any element,
in Iterator where)
raises (ElementInvalid, IteratorInvalid);
};
// THE CONCRETE COLLECTION INTERFACES
// K e y S e t
interface KeySet: KeyCollection {};
// K e y B a g
interface KeyBag: KeyCollection {};
// M a p
interface Map : EqualityKeyCollection {
// s e t t h e o r e t i c a l o p e r a t i o n s
void difference_with (in Map collector)
raises (ElementInvalid);
void add_difference (
in Map collector1,
in Map collector2)
raises (ElementInvalid);
void intersection_with (in Map collector)
raises (ElementInvalid);
void add_intersection (
in Map collector1,
in Map collector2)
raises (ElementInvalid);
void union_with (in Map collector)
raises (ElementInvalid);
void add_union (
in Map collector1,
in Map collector2)
raises (ElementInvalid);
// t e s t i n g e q u a l i t y
boolean equal (in Map collector)
raises (ElementInvalid);
boolean not_equal (in Map collector)
raises(ElementInvalid);
};
// R e l a t i o n
interface Relation : EqualityKeyCollection {
// e q u a l , n o t _ e q u a l , a n d t h e
// s e t - t h e o r e t i c a l o p e r a t i o n s a s
// d e f i n e d f o r M a p
};
// S e t
interface Set : EqualityCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s a s
// d e f i n e d f o r M a p
};
// B a g
interface Bag : EqualityCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s a s d e f i n e d
// d e f i n e d f o r M a p
};
// K e y S o r t e d S e t
interface KeySortedSet : KeySortedCollection {
long compare ( in KeySortedSet collector,
in Comparator comparison);
};
// K e y S o r t e d B a g
interface KeySortedBag : KeySortedCollection {
long compare ( in KeySortedBag collector,
in Comparator comparison);
};
// S o r t e d M a p
interface SortedMap : EqualityKeySortedCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s
long compare ( in SortedMap collector,
in Comparator comparison);
};
// S o r t e d R e l a t i o n
interface SortedRelation : EqualityKeySortedCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s
long compare ( in SortedRelation collector,
in Comparator comparison);
};
// S o r t e d S e t
interface SortedSet : EqualitySortedCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s
long compare ( in SortedSet collector,
in Comparator comparison);
};
// S o r t e d B a g
interface SortedBag: EqualitySortedCollection {
// e q u a l , n o t _ e q u a l , a n d t h e s e t
// t h e o r e t i c a l o p e r a t i o n s
long compare ( in SortedBag collector,
in Comparator comparison);
};
// S e q u e n c e
interface CSequence : SequentialCollection {
// C o m p a r i s o n
long compare ( in CSequence collector,
in Comparator comparison);
};
// E q u a l i t y S e q u e n c e
interface EqualitySequence : EqualitySequentialCollection {
// t e s t o n e q u a l i t y
boolean equal (in EqualitySequence collector);
boolean not_equal (in EqualitySequence collector);
// c o m p a r i s o n
long compare ( in EqualitySequence collector,
in Comparator comparison);
};
// H e a p
interface Heap : Collection {};
// R e s t r i c t e d A c c e s s C o l l e c t i o n s
interface RestrictedAccessCollection {
// g e t t i n g i n f o r m a t i o n o n
// c o l l e c t i o n s t a t e
boolean unfilled ();
unsigned long size ();
// r e m o v i n g e l e m e n t s
void purge ();
};
// Q u e u e
interface Queue : RestrictedAccessCollection {
// a d d i n g e l e m e n t s
void enqueue (in any element) raises (ElementInvalid);
// r e m o v i n g e l e m e n t s
void dequeue () raises (EmptyCollection);
boolean element_dequeue (out any element)
raises (EmptyCollection);
};
// D e q u e
interface Deque : RestrictedAccessCollection {
// a d d i n g e l e m e n t s
void enqueue_as_first (in any element)
raises (ElementInvalid);
void enqueue_as_last (in any element)
raises(ElementInvalid);
// r e m o v i n g e l e m e n t s
void dequeue_first () raises (EmptyCollection);
boolean element_dequeue_first (out any element)
raises (EmptyCollection);
void dequeue_last () raises (EmptyCollection);
boolean element_dequeue_last (out any element)
raises (EmptyCollection);
};
// S t a c k
interface Stack: RestrictedAccessCollection {
// a d d i n g e l e m e n t s
void push (in any element) raises (ElementInvalid);
// r e m o v i n g a n d r e t r i e v i n g
// e l e m e n t s
void pop () raises (EmptyCollection);
boolean element_pop (out any element)
raises (EmptyCollection);
boolean top (out any element)
raises (EmptyCollection);
};
// P r i o r i t y Q u e u e
interface PriorityQueue: RestrictedAccessCollection {
// a d d i n g e l e m e n t s
void enqueue (in any element) raises (ElementInvalid);
// r e m o v i n g e l e m e n t s
void dequeue () raises (EmptyCollection);
boolean element_dequeue (out any element)
raises (EmptyCollection);
};
// COLLECTION FACTORIES
// C o l l e c t i o n F a c t o r y
interface CollectionFactory {
Collection generic_create (in ParameterList parameters)
raises (ParameterInvalid);
};
// C o l l e c t i o n F a c t o r i e s
interface CollectionFactories : CollectionFactory {
boolean add_factory (
in Istring collection_interface,
in Istring impl_category,
in Istring impl_interface,
in CollectionFactory c_factory);
boolean remove_factory (
in Istring collection_interface,
in Istring impl_category,
in Istring impl_interface);
Collection create (in ParameterList parameters)
raises (ParameterInvalid);
};
// R A C o l l e c t i o n F a ct o r y
interface RACollectionFactory {
RestrictedAccessCollection generic_create (
in ParameterList parameters)
raises (ParameterInvalid);
};
// R A C o l l e c t i o n F a c t o r i e s
interface RACollectionFactories : RACollectionFactory {
boolean add_factory (
in Istring collection_interface,
in Istring impl_category,
in Istring impl_interface,
in RACollectionFactory rac_factory);
boolean remove_factory (
in Istring collection_interface,
in Istring impl_category,
in Istring impl_interface);
Collection create ( in ParameterList parameters)
raises (ParameterInvalid);
};
// K e y S e t F a c t o r y
interface KeySetFactory : CollectionFactory {
KeySet create ( in Operations ops,
in unsigned long expected_size);
};
// K e y B a g F a c t o r y
interface KeyBagFactory : CollectionFactory {
KeyBag create ( in Operations ops,
in unsigned long expected_size);
};
// M a p F a c t o r y
interface MapFactory : CollectionFactory {
Map create (in Operations ops,
in unsigned long expected_size);
};
// R e l a t i o n F a c t o r y
interface RelationFactory : CollectionFactory {
Relation create ( in Operations ops,
in unsigned long expected_size);
};
// S e t F a c t o r y
interface SetFactory : CollectionFactory {
Set create (in Operations ops,
in unsigned long expected_size);
};
// B a g F a c t o r y
interface BagFactory {
Bag create (in Operations ops,
in unsigned long expected_size);
};
// K e y S o r t e d S e t F a c t o r y
interface KeySortedSetFactory {
KeySortedSet create (in Operations ops,
in unsigned long expected_size);
};
// K e y S o r t e d B a g F a c t o r y
interface KeySortedBagFactory : CollectionFactory {
KeySortedBag create (in Operations ops,
in unsigned long expected_size);
};
// S o r t e d M a p F a c t o r y
interface SortedMapFactory : CollectionFactory {
SortedMap create (in Operations ops,
in unsigned long expected_size);
};
// S o r t e d R e l a t i o n F a c t o r y
interface SortedRelationFactory : CollectionFactory {
SortedRelation create ( in Operations ops,
in unsigned long expected_size);
};
// S o r t e d S e t F a c t o r y
interface SortedSetFactory : CollectionFactory {
SortedSet create ( in Operations ops,
in unsigned long expected_size);
};
// S o r t e d B a g F a c t o r y
interface SortedBagFactory {
SortedBag create ( in Operations ops,
in unsigned long expected_size);
};
// S e q u e n c e F a c t o r y
interface SequenceFactory : CollectionFactory {
CSequence create ( in Operations ops,
in unsigned long expected_size);
};
// E q u a l i t y S e q u e n c e F a c t o r y
interface EqualitySequenceFactory : CollectionFactory {
EqualitySequence create (in Operations ops,
in unsigned long expected_size);
};
// H e a p F a c t o r y
interface HeapFactory : CollectionFactory {
Heap create (in Operations ops,
in unsigned long expected_size);
};
// Q u e u e F a c t o r y
interface QueueFactory : RACollectionFactory {
Queue create ( in Operations ops,
in unsigned long expected_size);
};
// S t a c k F a c t o r y
interface StackFactory : RACollectionFactory {
Stack create ( in Operations ops,
in unsigned long expected_size);
};
// D e q u e F a c t o r y
interface DequeFactory : RACollectionFactory {
Deque create ( in Operations ops,
in unsigned long expected_size);
};
// P r i o r i t y Q u e u e F a c t o r y
interface PriorityQueueFactory : RACollectionFactory {
PriorityQueue create ( in Operations ops,
in unsigned long expected_size);
};
};
#endif /* ifndef _COS_COLLECTION_IDL_ */
|