#include <DynCommon.h>
Inheritance diagram for TAO_DynCommon:
Definition at line 32 of file DynCommon.h.
|
Constructor.
Definition at line 28 of file DynCommon.cpp.
00029 { 00030 } |
|
Destructor.
Definition at line 32 of file DynCommon.cpp.
00033 { 00034 } |
|
Definition at line 48 of file DynCommon.cpp. References destroyed_, and DynamicAny::DynAny::from_any().
00049 { 00050 if (this->destroyed_) 00051 { 00052 throw ::CORBA::OBJECT_NOT_EXIST (); 00053 } 00054 00055 CORBA::TypeCode_var tc = dyn_any->type (); 00056 00057 CORBA::Boolean const equivalent = this->type_.in ()->equivalent (tc.in ()); 00058 00059 if (equivalent) 00060 { 00061 CORBA::Any_var any = dyn_any->to_any (); 00062 00063 this->from_any (any.in ()); 00064 } 00065 else 00066 { 00067 throw DynamicAny::DynAny::TypeMismatch (); 00068 } 00069 } |
|
Definition at line 1183 of file DynCommon.cpp. References DynamicAny::DynAny::current_component(), current_position_, is_basic_type_seq(), and TAO_DynAnyFactory::unalias(). Referenced by get_abstract(), get_any(), get_reference(), get_string(), get_typecode(), get_val(), TAO::DynAnyBasicTypeUtils< T >::get_value(), get_wchar(), get_wstring(), insert_abstract(), insert_reference(), insert_string(), insert_val(), TAO::DynAnyBasicTypeUtils< T >::insert_value(), and insert_wstring().
01184 { 01185 if (this->current_position_ == -1) 01186 { 01187 throw DynamicAny::DynAny::InvalidValue (); 01188 } 01189 01190 DynamicAny::DynAny_var cc = 01191 this->current_component (); 01192 01193 CORBA::TypeCode_var tc = cc->type (); 01194 01195 CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()); 01196 01197 // We are here because we are a component that is the target of 01198 // an insert_*() call on our container. It is 01199 // illegal to insert anything into a component that itself has 01200 // components. 01201 switch (kind) 01202 { 01203 case CORBA::tk_array: 01204 case CORBA::tk_except: 01205 case CORBA::tk_struct: 01206 case CORBA::tk_union: 01207 throw DynamicAny::DynAny::TypeMismatch (); 01208 case CORBA::tk_sequence: 01209 if (TAO_DynCommon::is_basic_type_seq (tc.in ())) 01210 { 01211 return cc._retn (); 01212 } 01213 else 01214 { 01215 throw DynamicAny::DynAny::TypeMismatch (); 01216 } 01217 default: 01218 return cc._retn (); 01219 } 01220 } |
|
Definition at line 1223 of file DynCommon.cpp. Referenced by check_type_and_unalias(), and TAO::DynAnyBasicTypeUtils< T >::insert_value().
01224 { 01225 CORBA::Boolean const equivalent = 01226 this->type_->equivalent (tc); 01227 01228 if (!equivalent) 01229 { 01230 throw DynamicAny::DynAny::TypeMismatch (); 01231 } 01232 } |
|
Definition at line 1283 of file DynCommon.cpp. References check_type(), and TAO_DynAnyFactory::strip_alias(). Referenced by get_wstring(), and insert_wstring().
01284 { 01285 this->check_type (tc); 01286 01287 return TAO_DynAnyFactory::strip_alias (tc); 01288 } |
|
Implements DynamicAny::DynAny. Definition at line 809 of file DynCommon.cpp. References component_count_, and destroyed_.
00810 { 00811 if (this->destroyed_) 00812 { 00813 throw ::CORBA::OBJECT_NOT_EXIST (); 00814 } 00815 00816 return this->component_count_; 00817 } |
|
Definition at line 1271 of file DynCommon.cpp. References container_is_destroying_.
01272 { 01273 this->container_is_destroying_ = val; 01274 } |
|
Implements DynamicAny::DynAny. Definition at line 791 of file DynCommon.cpp. References destroyed_, and DynamicAny::DynAny::to_any().
00792 { 00793 if (this->destroyed_) 00794 { 00795 throw ::CORBA::OBJECT_NOT_EXIST (); 00796 } 00797 00798 CORBA::Any_var any = this->to_any (); 00799 00800 DynamicAny::DynAny_ptr retval = 00801 TAO::MakeDynAnyUtils::make_dyn_any_t<const CORBA::Any&> ( 00802 any.in ()._tao_get_typecode (), 00803 any.in ()); 00804 00805 return retval; 00806 } |
|
Definition at line 1259 of file DynCommon.cpp. References destroyed_. Referenced by TAO::DynAnyBasicTypeUtils< T >::get_value(), and TAO::DynAnyBasicTypeUtils< T >::insert_value().
01260 { 01261 return this->destroyed_; 01262 } |
|
Implements DynamicAny::DynAny. Definition at line 895 of file DynCommon.cpp. References any_, check_component(), destroyed_, has_components_, and TAO_DynAnyFactory::unalias().
00896 { 00897 if (this->destroyed_) 00898 { 00899 throw ::CORBA::OBJECT_NOT_EXIST (); 00900 } 00901 00902 if (this->has_components_) 00903 { 00904 DynamicAny::DynAny_var cc = 00905 this->check_component (); 00906 00907 return cc->get_abstract (); 00908 } 00909 else 00910 { 00911 CORBA::TCKind kind = 00912 TAO_DynAnyFactory::unalias (this->type_.in ()); 00913 00914 if (kind != CORBA::tk_abstract_interface) 00915 { 00916 throw DynamicAny::DynAny::TypeMismatch (); 00917 } 00918 00919 CORBA::AbstractBase_var retval; 00920 TAO::Any_Impl *any_impl = this->any_.impl (); 00921 00922 if (any_impl == 0) 00923 { 00924 throw DynamicAny::DynAny::InvalidValue (); 00925 } 00926 00927 // This should always be non-zero for dynamic anys. 00928 TAO::Unknown_IDL_Type *unk = 00929 dynamic_cast<TAO::Unknown_IDL_Type *> (any_impl); 00930 00931 // Make a copy to extract from so we retain ownership of contents. 00932 TAO_InputCDR for_reading (unk->_tao_get_cdr ()); 00933 00934 // The CDR extraction operator for AbstractBase handles 00935 // all cases. 00936 if (!(for_reading >> retval.inout ())) 00937 { 00938 throw DynamicAny::DynAny::InvalidValue (); 00939 } 00940 00941 return retval._retn (); 00942 } 00943 } |
|
Implements DynamicAny::DynAny. Definition at line 625 of file DynCommon.cpp. References ACE_NEW_RETURN, any_, check_component(), destroyed_, and has_components_. Referenced by get_dyn_any().
00626 { 00627 if (this->destroyed_) 00628 { 00629 throw ::CORBA::OBJECT_NOT_EXIST (); 00630 } 00631 00632 if (this->has_components_) 00633 { 00634 DynamicAny::DynAny_var cc = 00635 this->check_component (); 00636 00637 return cc->get_any (); 00638 } 00639 else 00640 { 00641 const CORBA::Any *tmp = 0; 00642 00643 if ((this->any_ >>= tmp) == 0) 00644 { 00645 throw DynamicAny::DynAny::TypeMismatch (); 00646 } 00647 00648 CORBA::Any *retval = 0; 00649 ACE_NEW_RETURN (retval, 00650 CORBA::Any (*tmp), 00651 0); 00652 return retval; 00653 } 00654 } |
|
Implements DynamicAny::DynAny. Definition at line 393 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00394 { 00395 return TAO::DynAnyBasicTypeUtils<CORBA::Boolean>::get_value (this); 00396 } |
|
Implements DynamicAny::DynAny. Definition at line 1028 of file DynCommon.cpp. References CORBA::BooleanSeq, and TAO::DynAnyBasicTypeUtils< T >::get_value().
01029 { 01030 CORBA::BooleanSeq *owned = 01031 TAO::DynAnyBasicTypeUtils<CORBA::BooleanSeq>::get_value (this); 01032 return new CORBA::BooleanSeq (*owned); 01033 } |
|
Implements DynamicAny::DynAny. Definition at line 405 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00406 { 00407 return TAO::DynAnyBasicTypeUtils<CORBA::Char>::get_value (this); 00408 } |
|
Implements DynamicAny::DynAny. Definition at line 1044 of file DynCommon.cpp. References CORBA::CharSeq, and TAO::DynAnyBasicTypeUtils< T >::get_value().
01045 { 01046 CORBA::CharSeq *owned = 01047 TAO::DynAnyBasicTypeUtils<CORBA::CharSeq>::get_value (this); 01048 return new CORBA::CharSeq (*owned); 01049 } |
|
Implements DynamicAny::DynAny. Definition at line 441 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00442 { 00443 return TAO::DynAnyBasicTypeUtils<CORBA::Double>::get_value (this); 00444 } |
|
Implements DynamicAny::DynAny. Definition at line 1092 of file DynCommon.cpp. References CORBA::DoubleSeq, and TAO::DynAnyBasicTypeUtils< T >::get_value().
01093 { 01094 CORBA::DoubleSeq *owned = 01095 TAO::DynAnyBasicTypeUtils<CORBA::DoubleSeq>::get_value (this); 01096 return new CORBA::DoubleSeq (*owned); 01097 } |
|
Implements DynamicAny::DynAny. Definition at line 659 of file DynCommon.cpp. References destroyed_, and get_any().
00660 { 00661 if (this->destroyed_) 00662 { 00663 throw ::CORBA::OBJECT_NOT_EXIST (); 00664 } 00665 00666 CORBA::Any_var any = this->get_any (); 00667 00668 return 00669 TAO::MakeDynAnyUtils::make_dyn_any_t<const CORBA::Any&> ( 00670 any.in ()._tao_get_typecode (), 00671 any.in ()); 00672 } |
|
Implements DynamicAny::DynAny. Definition at line 435 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00436 { 00437 return TAO::DynAnyBasicTypeUtils<CORBA::Float>::get_value (this); 00438 } |
|
Implements DynamicAny::DynAny. Definition at line 1084 of file DynCommon.cpp. References CORBA::FloatSeq, and TAO::DynAnyBasicTypeUtils< T >::get_value().
01085 { 01086 CORBA::FloatSeq *owned = 01087 TAO::DynAnyBasicTypeUtils<CORBA::FloatSeq>::get_value (this); 01088 return new CORBA::FloatSeq (*owned); 01089 } |
|
Implements DynamicAny::DynAny. Definition at line 423 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00424 { 00425 return TAO::DynAnyBasicTypeUtils<CORBA::Long>::get_value (this); 00426 } |
|
Implements DynamicAny::DynAny. Definition at line 1068 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::LongSeq.
01069 { 01070 CORBA::LongSeq *owned = 01071 TAO::DynAnyBasicTypeUtils<CORBA::LongSeq>::get_value (this); 01072 return new CORBA::LongSeq (*owned); 01073 } |
|
Implements DynamicAny::DynAny. Definition at line 558 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00559 { 00560 return TAO::DynAnyBasicTypeUtils<CORBA::LongDouble>::get_value (this); 00561 } |
|
Implements DynamicAny::DynAny. Definition at line 1116 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::LongDoubleSeq.
01117 { 01118 CORBA::LongDoubleSeq *owned = 01119 TAO::DynAnyBasicTypeUtils<CORBA::LongDoubleSeq>::get_value (this); 01120 return new CORBA::LongDoubleSeq (*owned); 01121 } |
|
Implements DynamicAny::DynAny. Definition at line 546 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00547 { 00548 return TAO::DynAnyBasicTypeUtils<CORBA::LongLong>::get_value (this); 00549 } |
|
Implements DynamicAny::DynAny. Definition at line 1100 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::LongLongSeq.
01101 { 01102 CORBA::LongLongSeq *owned = 01103 TAO::DynAnyBasicTypeUtils<CORBA::LongLongSeq>::get_value (this); 01104 return new CORBA::LongLongSeq (*owned); 01105 } |
|
Implements DynamicAny::DynAny. Definition at line 399 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00400 { 00401 return TAO::DynAnyBasicTypeUtils<CORBA::Octet>::get_value (this); 00402 } |
|
Implements DynamicAny::DynAny. Definition at line 1036 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::OctetSeq.
01037 { 01038 CORBA::OctetSeq *owned = 01039 TAO::DynAnyBasicTypeUtils<CORBA::OctetSeq>::get_value (this); 01040 return new CORBA::OctetSeq (*owned); 01041 } |
|
Implements DynamicAny::DynAny. Definition at line 491 of file DynCommon.cpp. References any_, check_component(), destroyed_, and has_components_.
00492 { 00493 if (this->destroyed_) 00494 { 00495 throw ::CORBA::OBJECT_NOT_EXIST (); 00496 } 00497 00498 if (this->has_components_) 00499 { 00500 DynamicAny::DynAny_var cc = 00501 this->check_component (); 00502 00503 return cc->get_reference (); 00504 } 00505 else 00506 { 00507 CORBA::Object_var retval; 00508 00509 if ((this->any_ >>= CORBA::Any::to_object (retval.inout ())) == 0) 00510 { 00511 throw DynamicAny::DynAny::TypeMismatch (); 00512 } 00513 00514 return retval._retn (); 00515 } 00516 } |
|
Implements DynamicAny::DynAny. Definition at line 411 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00412 { 00413 return TAO::DynAnyBasicTypeUtils<CORBA::Short>::get_value (this); 00414 } |
|
Implements DynamicAny::DynAny. Definition at line 1052 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::ShortSeq.
01053 { 01054 CORBA::ShortSeq *owned = 01055 TAO::DynAnyBasicTypeUtils<CORBA::ShortSeq>::get_value (this); 01056 return new CORBA::ShortSeq (*owned); 01057 } |
|
Implements DynamicAny::DynAny. Definition at line 447 of file DynCommon.cpp. References any_, check_component(), destroyed_, has_components_, CORBA::string_dup(), and TAO_DynAnyFactory::strip_alias().
00448 { 00449 if (this->destroyed_) 00450 { 00451 throw ::CORBA::OBJECT_NOT_EXIST (); 00452 } 00453 00454 if (this->has_components_) 00455 { 00456 DynamicAny::DynAny_var cc = 00457 this->check_component (); 00458 00459 return cc->get_string (); 00460 } 00461 else 00462 { 00463 CORBA::TypeCode_var unaliased_tc = 00464 TAO_DynAnyFactory::strip_alias (this->type_.in ()); 00465 00466 CORBA::TCKind kind = 00467 unaliased_tc->kind (); 00468 00469 if (kind != CORBA::tk_string) 00470 { 00471 throw DynamicAny::DynAny::TypeMismatch (); 00472 } 00473 00474 char *retval = 0; 00475 00476 CORBA::ULong const bound = 00477 unaliased_tc->length (); 00478 00479 // We will have caught a type mismatch above, so if this fails, 00480 // it must be for some other reason. 00481 if ((this->any_ >>= CORBA::Any::to_string (retval, bound)) == 0) 00482 { 00483 throw DynamicAny::DynAny::InvalidValue (); 00484 } 00485 00486 return CORBA::string_dup (retval); 00487 } 00488 } |
|
Implements DynamicAny::DynAny. Definition at line 519 of file DynCommon.cpp. References any_, check_component(), destroyed_, and has_components_.
00520 { 00521 if (this->destroyed_) 00522 { 00523 throw ::CORBA::OBJECT_NOT_EXIST (); 00524 } 00525 00526 if (this->has_components_) 00527 { 00528 DynamicAny::DynAny_var cc = this->check_component (); 00529 00530 return cc->get_typecode (); 00531 } 00532 else 00533 { 00534 CORBA::TypeCode_ptr retval; 00535 00536 if ((this->any_ >>= retval) == 0) 00537 { 00538 throw DynamicAny::DynAny::TypeMismatch (); 00539 } 00540 00541 return CORBA::TypeCode::_duplicate (retval); 00542 } 00543 } |
|
Implements DynamicAny::DynAny. Definition at line 429 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00430 { 00431 return TAO::DynAnyBasicTypeUtils<CORBA::ULong>::get_value (this); 00432 } |
|
Implements DynamicAny::DynAny. Definition at line 1076 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::ULongSeq.
01077 { 01078 CORBA::ULongSeq *owned = 01079 TAO::DynAnyBasicTypeUtils<CORBA::ULongSeq>::get_value (this); 01080 return new CORBA::ULongSeq (*owned); 01081 } |
|
Implements DynamicAny::DynAny. Definition at line 552 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00553 { 00554 return TAO::DynAnyBasicTypeUtils<CORBA::ULongLong>::get_value (this); 00555 } |
|
Implements DynamicAny::DynAny. Definition at line 1108 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::ULongLongSeq.
01109 { 01110 CORBA::ULongLongSeq *owned = 01111 TAO::DynAnyBasicTypeUtils<CORBA::ULongLongSeq>::get_value (this); 01112 return new CORBA::ULongLongSeq (*owned); 01113 } |
|
Implements DynamicAny::DynAny. Definition at line 417 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value().
00418 { 00419 return TAO::DynAnyBasicTypeUtils<CORBA::UShort>::get_value (this); 00420 } |
|
Implements DynamicAny::DynAny. Definition at line 1060 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::UShortSeq.
01061 { 01062 CORBA::UShortSeq *owned = 01063 TAO::DynAnyBasicTypeUtils<CORBA::UShortSeq>::get_value (this); 01064 return new CORBA::UShortSeq (*owned); 01065 } |
|
Implements DynamicAny::DynAny. Definition at line 675 of file DynCommon.cpp. References any_, check_component(), destroyed_, has_components_, and TAO_DynAnyFactory::unalias().
00676 { 00677 if (this->destroyed_) 00678 { 00679 throw ::CORBA::OBJECT_NOT_EXIST (); 00680 } 00681 00682 if (this->has_components_) 00683 { 00684 DynamicAny::DynAny_var cc = 00685 this->check_component (); 00686 00687 return cc->get_val (); 00688 } 00689 else 00690 { 00691 CORBA::TCKind kind = 00692 TAO_DynAnyFactory::unalias (this->type_.in ()); 00693 00694 if (kind != CORBA::tk_value) 00695 { 00696 throw DynamicAny::DynAny::TypeMismatch (); 00697 } 00698 00699 CORBA::ValueBase_var retval; 00700 TAO::Any_Impl *any_impl = this->any_.impl (); 00701 00702 if (any_impl == 0) 00703 { 00704 throw DynamicAny::DynAny::InvalidValue (); 00705 } 00706 00707 // This should always be non-zero for dynamic anys. 00708 TAO::Unknown_IDL_Type *unk = 00709 dynamic_cast<TAO::Unknown_IDL_Type *> (any_impl); 00710 00711 // Demarshal from a copy so we can retain ownership of our contents. 00712 TAO_InputCDR for_reading (unk->_tao_get_cdr ()); 00713 00714 CORBA::Boolean good_extract = 00715 CORBA::ValueBase::_tao_unmarshal (for_reading, 00716 retval.inout ()); 00717 00718 if (!good_extract) 00719 { 00720 throw DynamicAny::DynAny::InvalidValue (); 00721 } 00722 00723 return retval._retn (); 00724 } 00725 } |
|
Implements DynamicAny::DynAny. Definition at line 564 of file DynCommon.cpp. References any_, check_component(), destroyed_, and has_components_.
00565 { 00566 if (this->destroyed_) 00567 { 00568 throw ::CORBA::OBJECT_NOT_EXIST (); 00569 } 00570 00571 if (this->has_components_) 00572 { 00573 DynamicAny::DynAny_var cc = this->check_component (); 00574 00575 return cc->get_wchar (); 00576 } 00577 else 00578 { 00579 CORBA::WChar retval; 00580 00581 if ((this->any_ >>= CORBA::Any::to_wchar (retval)) == 0) 00582 { 00583 throw DynamicAny::DynAny::TypeMismatch (); 00584 } 00585 00586 return retval; 00587 } 00588 } |
|
Implements DynamicAny::DynAny. Definition at line 1124 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::get_value(), and CORBA::WCharSeq.
01125 { 01126 CORBA::WCharSeq *owned = 01127 TAO::DynAnyBasicTypeUtils<CORBA::WCharSeq>::get_value (this); 01128 return new CORBA::WCharSeq (*owned); 01129 } |
|
Implements DynamicAny::DynAny. Definition at line 591 of file DynCommon.cpp. References any_, check_component(), check_type_and_unalias(), destroyed_, has_components_, and CORBA::wstring_dup().
00592 { 00593 if (this->destroyed_) 00594 { 00595 throw ::CORBA::OBJECT_NOT_EXIST (); 00596 } 00597 00598 if (this->has_components_) 00599 { 00600 DynamicAny::DynAny_var cc = 00601 this->check_component (); 00602 00603 return cc->get_wstring (); 00604 } 00605 else 00606 { 00607 // @@@ (JP) Someday try to find a way to avoid checking for 00608 // type code equivalence twice without risking a throw of 00609 // BadKind. 00610 CORBA::TypeCode_var unaliased_tc = 00611 this->check_type_and_unalias (CORBA::_tc_wstring); 00612 00613 CORBA::WChar *retval = 0; 00614 00615 CORBA::ULong bound = 00616 unaliased_tc->length (); 00617 00618 (void) (this->any_ >>= CORBA::Any::to_wstring (retval, bound)); 00619 00620 return CORBA::wstring_dup (retval); 00621 } 00622 } |
|
Definition at line 1253 of file DynCommon.cpp. References has_components_. Referenced by TAO::DynAnyBasicTypeUtils< T >::get_value(), and TAO::DynAnyBasicTypeUtils< T >::insert_value().
01254 { 01255 return this->has_components_; 01256 } |
|
Definition at line 822 of file DynCommon.cpp. References ACE_NEW, any_, check_component(), destroyed_, has_components_, CORBA::is_nil(), ACE_OS::strcmp(), and TAO_DynAnyFactory::unalias().
00823 { 00824 if (this->destroyed_) 00825 { 00826 throw ::CORBA::OBJECT_NOT_EXIST (); 00827 } 00828 00829 if (this->has_components_) 00830 { 00831 DynamicAny::DynAny_var cc = 00832 this->check_component (); 00833 00834 cc->insert_abstract (value); 00835 } 00836 else 00837 { 00838 CORBA::Boolean good_type = true; 00839 CORBA::TCKind kind = 00840 TAO_DynAnyFactory::unalias (this->type_.in ()); 00841 00842 if (kind != CORBA::tk_abstract_interface) 00843 { 00844 good_type = false; 00845 } 00846 else if (!CORBA::is_nil (value)) 00847 { 00848 const char *value_id = value->_interface_repository_id (); 00849 int cmp = 00850 ACE_OS::strcmp (value_id, "IDL:omg.org/CORBA/AbstractBase:1.0"); 00851 00852 if (cmp != 0) 00853 { 00854 const char *my_id = 00855 this->type_->id (); 00856 00857 if (ACE_OS::strcmp (value_id, my_id) != 0) 00858 { 00859 // If 'value' is an objref, this will be a virtual 00860 // call. If not, it will just compare to the repo id 00861 // above, which we already know won't match. We see 00862 // in insert_val() (see comment there) that there 00863 // is no way to check for derived valuetypes w/o 00864 // type knowledge at compile time. 00865 good_type = value->_is_a (my_id); 00866 } 00867 } 00868 } 00869 00870 if (good_type) 00871 { 00872 TAO_OutputCDR out; 00873 00874 // The CDR insertion operator for AbstractBase handles 00875 // all cases - nil, objref and valuetype - polymorphically. 00876 if (!(out << value)) 00877 { 00878 throw DynamicAny::DynAny::InvalidValue (); 00879 } 00880 00881 TAO_InputCDR in (out); 00882 TAO::Unknown_IDL_Type *unk = 0; 00883 ACE_NEW (unk, 00884 TAO::Unknown_IDL_Type (this->type_.in (), in)); 00885 this->any_.replace (unk); 00886 } 00887 else 00888 { 00889 throw DynamicAny::DynAny::TypeMismatch (); 00890 } 00891 } 00892 } |
|
Definition at line 305 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value(). Referenced by insert_dyn_any().
00306 { 00307 TAO::DynAnyBasicTypeUtils<CORBA::Any>::insert_value (value, 00308 this); 00309 } |
|
Definition at line 72 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00073 { 00074 TAO::DynAnyBasicTypeUtils<CORBA::Boolean>::insert_value (value, this); 00075 } |
|
Definition at line 948 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00949 { 00950 TAO::DynAnyBasicTypeUtils<CORBA::BooleanSeq>::insert_value (value, this); 00951 } |
|
Definition at line 84 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00085 { 00086 TAO::DynAnyBasicTypeUtils<CORBA::Char>::insert_value (value, this); 00087 } |
|
Definition at line 960 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00961 { 00962 TAO::DynAnyBasicTypeUtils<CORBA::CharSeq>::insert_value (value, this); 00963 } |
|
Definition at line 120 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00121 { 00122 TAO::DynAnyBasicTypeUtils<CORBA::Double>::insert_value (value, this); 00123 } |
|
Definition at line 996 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00997 { 00998 TAO::DynAnyBasicTypeUtils<CORBA::DoubleSeq>::insert_value (value, this); 00999 } |
|
Definition at line 314 of file DynCommon.cpp. References destroyed_, and insert_any().
00315 { 00316 if (this->destroyed_) 00317 { 00318 throw ::CORBA::OBJECT_NOT_EXIST (); 00319 } 00320 00321 CORBA::Any_var any = value->to_any (); 00322 00323 this->insert_any (any.in ()); 00324 } |
|
Definition at line 114 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00115 { 00116 TAO::DynAnyBasicTypeUtils<CORBA::Float>::insert_value (value, this); 00117 } |
|
Definition at line 990 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00991 { 00992 TAO::DynAnyBasicTypeUtils<CORBA::FloatSeq>::insert_value (value, this); 00993 } |
|
Definition at line 102 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00103 { 00104 TAO::DynAnyBasicTypeUtils<CORBA::Long>::insert_value (value, this); 00105 } |
|
Definition at line 978 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00979 { 00980 TAO::DynAnyBasicTypeUtils<CORBA::LongSeq>::insert_value (value, this); 00981 } |
|
Definition at line 259 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00260 { 00261 TAO::DynAnyBasicTypeUtils<CORBA::LongDouble>::insert_value (value, 00262 this); 00263 } |
|
Definition at line 1014 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
01015 { 01016 TAO::DynAnyBasicTypeUtils<CORBA::LongDoubleSeq>::insert_value (value, this); 01017 } |
|
Definition at line 247 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00248 { 00249 TAO::DynAnyBasicTypeUtils<CORBA::LongLong>::insert_value (value, this); 00250 } |
|
Definition at line 1002 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
01003 { 01004 TAO::DynAnyBasicTypeUtils<CORBA::LongLongSeq>::insert_value (value, this); 01005 } |
|
Definition at line 78 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00079 { 00080 TAO::DynAnyBasicTypeUtils<CORBA::Octet>::insert_value (value, this); 00081 } |
|
Definition at line 954 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00955 { 00956 TAO::DynAnyBasicTypeUtils<CORBA::OctetSeq>::insert_value (value, this); 00957 } |
|
Definition at line 167 of file DynCommon.cpp. References ACE_NEW, any_, check_component(), destroyed_, has_components_, CORBA::is_nil(), ACE_OS::strcmp(), TAO_DynAnyFactory::unalias(), ACE_OutputCDR::write_char(), and ACE_OutputCDR::write_ulong().
00168 { 00169 if (this->destroyed_) 00170 { 00171 throw ::CORBA::OBJECT_NOT_EXIST (); 00172 } 00173 00174 if (this->has_components_) 00175 { 00176 DynamicAny::DynAny_var cc = 00177 this->check_component (); 00178 00179 cc->insert_reference (value); 00180 } 00181 else 00182 { 00183 CORBA::Boolean good_type = true; 00184 CORBA::TCKind const kind = 00185 TAO_DynAnyFactory::unalias (this->type_.in ()); 00186 00187 if (kind != CORBA::tk_objref) 00188 { 00189 good_type = false; 00190 } 00191 else if (!CORBA::is_nil (value)) 00192 { 00193 const char *value_id = value->_interface_repository_id (); 00194 00195 if (ACE_OS::strcmp (value_id, "IDL:omg.org/CORBA/Object:1.0") != 0) 00196 { 00197 const char *my_id = 00198 this->type_->id (); 00199 00200 if (ACE_OS::strcmp (value_id, my_id) != 0) 00201 { 00202 good_type = value->_is_a (my_id); 00203 } 00204 } 00205 } 00206 00207 if (good_type) 00208 { 00209 TAO_OutputCDR cdr; 00210 00211 if (CORBA::is_nil (value)) 00212 { 00213 // Empty type hint, no profile. 00214 cdr.write_ulong (1); 00215 cdr.write_char ('\0'); 00216 cdr.write_ulong (0); 00217 } 00218 else 00219 { 00220 if (!value->marshal (cdr)) 00221 { 00222 throw DynamicAny::DynAny::InvalidValue (); 00223 } 00224 } 00225 00226 TAO_InputCDR in (cdr); 00227 TAO::Unknown_IDL_Type *unk = 0; 00228 ACE_NEW (unk, 00229 TAO::Unknown_IDL_Type (this->type_.in (), 00230 in)); 00231 this->any_.replace (unk); 00232 } 00233 else 00234 { 00235 throw DynamicAny::DynAny::TypeMismatch (); 00236 } 00237 } 00238 } |
|
Definition at line 90 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00091 { 00092 TAO::DynAnyBasicTypeUtils<CORBA::Short>::insert_value (value, this); 00093 } |
|
Definition at line 966 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00967 { 00968 TAO::DynAnyBasicTypeUtils<CORBA::ShortSeq>::insert_value (value, this); 00969 } |
|
Definition at line 126 of file DynCommon.cpp. References check_component(), destroyed_, has_components_, TAO_DynAnyFactory::strip_alias(), and ACE_OS::strlen().
00127 { 00128 if (this->destroyed_) 00129 { 00130 throw ::CORBA::OBJECT_NOT_EXIST (); 00131 } 00132 00133 if (this->has_components_) 00134 { 00135 DynamicAny::DynAny_var cc = 00136 this->check_component (); 00137 00138 cc->insert_string (value); 00139 } 00140 else 00141 { 00142 CORBA::TypeCode_var unaliased_tc = 00143 TAO_DynAnyFactory::strip_alias (this->type_.in ()); 00144 00145 CORBA::TCKind const kind = 00146 unaliased_tc->kind (); 00147 00148 if (kind != CORBA::tk_string) 00149 { 00150 throw DynamicAny::DynAny::TypeMismatch (); 00151 } 00152 00153 CORBA::ULong const bound = 00154 unaliased_tc->length (); 00155 00156 if (bound > 0 && bound < ACE_OS::strlen (value)) 00157 { 00158 throw DynamicAny::DynAny::InvalidValue (); 00159 } 00160 00161 this->any_ <<= CORBA::Any::from_string (const_cast<char *> (value), 00162 bound); 00163 } 00164 } |
|
Definition at line 241 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00242 { 00243 TAO::DynAnyBasicTypeUtils<CORBA::TypeCode_ptr>::insert_value (value, this); 00244 } |
|
Definition at line 108 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00109 { 00110 TAO::DynAnyBasicTypeUtils<CORBA::ULong>::insert_value (value, this); 00111 } |
|
Definition at line 984 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00985 { 00986 TAO::DynAnyBasicTypeUtils<CORBA::ULongSeq>::insert_value (value, this); 00987 } |
|
Definition at line 253 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00254 { 00255 TAO::DynAnyBasicTypeUtils<CORBA::ULongLong>::insert_value (value, this); 00256 } |
|
Definition at line 1008 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
01009 { 01010 TAO::DynAnyBasicTypeUtils<CORBA::ULongLongSeq>::insert_value (value, this); 01011 } |
|
Definition at line 96 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00097 { 00098 TAO::DynAnyBasicTypeUtils<CORBA::UShort>::insert_value (value, this); 00099 } |
|
Definition at line 972 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00973 { 00974 TAO::DynAnyBasicTypeUtils<CORBA::UShortSeq>::insert_value (value, this); 00975 } |
|
Definition at line 327 of file DynCommon.cpp. References ACE_NEW, any_, check_component(), destroyed_, has_components_, ACE_OS::strcmp(), and TAO_DynAnyFactory::unalias().
00328 { 00329 if (this->destroyed_) 00330 { 00331 throw ::CORBA::OBJECT_NOT_EXIST (); 00332 } 00333 00334 if (this->has_components_) 00335 { 00336 DynamicAny::DynAny_var cc = 00337 this->check_component (); 00338 00339 cc->insert_val (value); 00340 } 00341 else 00342 { 00343 CORBA::TCKind kind = 00344 TAO_DynAnyFactory::unalias (this->type_.in ()); 00345 00346 if (kind != CORBA::tk_value) 00347 { 00348 throw DynamicAny::DynAny::TypeMismatch (); 00349 } 00350 00351 // If the arg is 0 we can't do this kind of type checking, 00352 // and the call to _tao_marshal() below will handle the 00353 // null value correctly. 00354 if (value != 0) 00355 { 00356 const char *value_id = value->_tao_obv_repository_id (); 00357 const char *my_id = 00358 this->type_->id (); 00359 00360 // Valuetypes, unlike interfaces, don't have a virtual 00361 // method to check for a more derived type when the 00362 // repo ids don't match. Valuetypes have only 00363 // a static _downcast() method, which can't be used 00364 // here, so if the repo ids don't match, we're hosed. 00365 if (ACE_OS::strcmp (value_id, my_id) != 0) 00366 { 00367 throw DynamicAny::DynAny::TypeMismatch (); 00368 } 00369 } 00370 00371 // This will handle null values correctly, or otherwise 00372 // make a virtual call to marshal the state. 00373 TAO_OutputCDR out; 00374 CORBA::Boolean const good_insert = 00375 CORBA::ValueBase::_tao_marshal (out, value); 00376 00377 if (!good_insert) 00378 { 00379 throw DynamicAny::DynAny::InvalidValue (); 00380 } 00381 00382 TAO_InputCDR in (out); 00383 TAO::Unknown_IDL_Type *unk = 0; 00384 ACE_NEW (unk, 00385 TAO::Unknown_IDL_Type (this->type_.in (), in)); 00386 this->any_.replace (unk); 00387 } 00388 } |
|
Definition at line 266 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
00267 { 00268 TAO::DynAnyBasicTypeUtils<CORBA::WChar>::insert_value (value, 00269 this); 00270 } |
|
Definition at line 1020 of file DynCommon.cpp. References TAO::DynAnyBasicTypeUtils< T >::insert_value().
01021 { 01022 TAO::DynAnyBasicTypeUtils<CORBA::WCharSeq>::insert_value (value, this); 01023 } |
|
Definition at line 273 of file DynCommon.cpp. References check_component(), check_type_and_unalias(), destroyed_, has_components_, and ACE_OS::wslen().
00274 { 00275 if (this->destroyed_) 00276 { 00277 throw ::CORBA::OBJECT_NOT_EXIST (); 00278 } 00279 00280 if (this->has_components_) 00281 { 00282 DynamicAny::DynAny_var cc = 00283 this->check_component (); 00284 00285 cc->insert_wstring (value); 00286 } 00287 else 00288 { 00289 CORBA::TypeCode_var unaliased_tc = 00290 this->check_type_and_unalias (CORBA::_tc_wstring); 00291 00292 CORBA::ULong const bound = unaliased_tc->length (); 00293 00294 if (bound > 0 && bound < ACE_OS::wslen (value)) 00295 { 00296 throw DynamicAny::DynAny::InvalidValue (); 00297 } 00298 00299 this->any_ <<= CORBA::Any::from_wstring (const_cast<CORBA::WChar *> (value), 00300 bound); 00301 } 00302 } |
|
Definition at line 1235 of file DynCommon.cpp. Referenced by check_component(), TAO::MakeDynAnyUtils::make_dyn_any_t(), and set_flag().
01236 {
01237 return (tc == CORBA::_tc_BooleanSeq
01238 || tc == CORBA::_tc_OctetSeq
01239 || tc == CORBA::_tc_CharSeq
01240 || tc == CORBA::_tc_WCharSeq
01241 || tc == CORBA::_tc_ShortSeq
01242 || tc == CORBA::_tc_UShortSeq
01243 || tc == CORBA::_tc_LongSeq
01244 || tc == CORBA::_tc_ULongSeq
01245 || tc == CORBA::_tc_LongLongSeq
01246 || tc == CORBA::_tc_ULongLongSeq
01247 || tc == CORBA::_tc_FloatSeq
01248 || tc == CORBA::_tc_DoubleSeq
01249 || tc == CORBA::_tc_LongDoubleSeq);
01250 }
|
|
Implements DynamicAny::DynAny. Definition at line 768 of file DynCommon.cpp. References component_count_, current_position_, destroyed_, and has_components_.
00769 { 00770 if (this->destroyed_) 00771 { 00772 throw ::CORBA::OBJECT_NOT_EXIST (); 00773 } 00774 00775 CORBA::Long component_count = static_cast<CORBA::Long> (this->component_count_); 00776 00777 if (this->has_components_ == 0 00778 || this->current_position_ + 1 >= component_count) 00779 { 00780 this->current_position_ = -1; 00781 return false; 00782 } 00783 else 00784 { 00785 ++this->current_position_; 00786 return true; 00787 } 00788 } |
|
Definition at line 1277 of file DynCommon.cpp. References ref_to_component_.
01278 { 01279 this->ref_to_component_ = val; 01280 } |
|
Implements DynamicAny::DynAny. Definition at line 757 of file DynCommon.cpp. References destroyed_, and seek().
00758 { 00759 if (this->destroyed_) 00760 { 00761 throw ::CORBA::OBJECT_NOT_EXIST (); 00762 } 00763 00764 (void) this->seek (0); 00765 } |
|
Definition at line 730 of file DynCommon.cpp. References component_count_, current_position_, destroyed_, and has_components_. Referenced by rewind().
00732 { 00733 if (this->destroyed_) 00734 { 00735 throw ::CORBA::OBJECT_NOT_EXIST (); 00736 } 00737 00738 if (this->has_components_ == 0) 00739 { 00740 ACE_UNUSED_ARG (slot); 00741 this->current_position_ = -1; 00742 return false; 00743 } 00744 else if (slot < 0 || slot >= static_cast<CORBA::Long> (this->component_count_)) 00745 { 00746 this->current_position_ = -1; 00747 return false; 00748 } 00749 else 00750 { 00751 this->current_position_ = slot; 00752 return true; 00753 } 00754 } |
|
This sets one of two flags in this base class. CORBA 2.4.2 requires that destroy() do nothing if it is called on the result of current_component(), the only non-deep-copying method in the Dynamic Any API. If the boolean arg below is 0, the call is from inside current_component(), and the flag ref_to_component_ is set. If the boolean arg is 1, the call is from inside destroy(), and the container_is_destroying_ flag is set, overriding the first flag in the component's destroy() method. Definition at line 1134 of file DynCommon.cpp. References is_basic_type_seq(), TAO::DynAnyFlagUtils< T >::set_flag_t(), and TAO_DynAnyFactory::unalias(). Referenced by TAO_DynUnion_i::current_component(), TAO_DynStruct_i::current_component(), TAO_DynSequence_i::current_component(), TAO_DynArray_i::current_component(), TAO_DynUnion_i::destroy(), TAO_DynStruct_i::destroy(), TAO_DynSequence_i::destroy(), TAO_DynArray_i::destroy(), TAO_DynUnion_i::get_discriminator(), TAO_DynSequence_i::get_elements_as_dyn_any(), TAO_DynArray_i::get_elements_as_dyn_any(), TAO_DynStruct_i::get_members_as_dyn_any(), and TAO_DynUnion_i::member().
01136 { 01137 CORBA::TypeCode_var tc = component->type (); 01138 01139 CORBA::TCKind tk = TAO_DynAnyFactory::unalias (tc.in ()); 01140 01141 switch (tk) 01142 { 01143 case CORBA::tk_array: 01144 TAO::DynAnyFlagUtils<TAO_DynArray_i>::set_flag_t (component, 01145 destroying); 01146 break; 01147 case CORBA::tk_enum: 01148 TAO::DynAnyFlagUtils<TAO_DynEnum_i>::set_flag_t (component, 01149 destroying); 01150 break; 01151 case CORBA::tk_sequence: 01152 if (TAO_DynCommon::is_basic_type_seq (tc.in ())) 01153 { 01154 TAO::DynAnyFlagUtils<TAO_DynAny_i>::set_flag_t (component, 01155 destroying); 01156 } 01157 else 01158 { 01159 TAO::DynAnyFlagUtils<TAO_DynSequence_i>::set_flag_t (component, 01160 destroying); 01161 } 01162 break; 01163 case CORBA::tk_struct: 01164 TAO::DynAnyFlagUtils<TAO_DynStruct_i>::set_flag_t (component, 01165 destroying); 01166 break; 01167 case CORBA::tk_union: 01168 TAO::DynAnyFlagUtils<TAO_DynUnion_i>::set_flag_t (component, 01169 destroying); 01170 break; 01171 case CORBA::tk_fixed: 01172 case CORBA::tk_value: 01173 case CORBA::tk_value_box: 01174 throw ::CORBA::NO_IMPLEMENT (); 01175 default: 01176 TAO::DynAnyFlagUtils<TAO_DynAny_i>::set_flag_t (component, 01177 destroying); 01178 break; 01179 } 01180 } |
|
Definition at line 1265 of file DynCommon.cpp. References any_. Referenced by TAO::DynAnyBasicTypeUtils< T >::get_value(), and TAO::DynAnyBasicTypeUtils< T >::insert_value().
01266 { 01267 return this->any_; 01268 } |
|
Implements DynamicAny::DynAny. Definition at line 37 of file DynCommon.cpp. References destroyed_.
00038 { 00039 if (this->destroyed_) 00040 { 00041 throw ::CORBA::OBJECT_NOT_EXIST (); 00042 } 00043 00044 return CORBA::TypeCode::_duplicate (this->type_.in ()); 00045 } |
|
Gets a value only for basic types, but used in insert_* and get_*, defined in this base class. Definition at line 246 of file DynCommon.h. Referenced by TAO_DynAny_i::equal(), get_abstract(), get_any(), get_reference(), get_string(), get_typecode(), get_val(), get_wchar(), get_wstring(), insert_abstract(), insert_reference(), insert_val(), and the_any(). |
|
Number of components, as defined by CORBA 2.4.2.
Definition at line 239 of file DynCommon.h. Referenced by component_count(), next(), and seek(). |
|
Flag to let destroy() call by container override the flag above.
Definition at line 227 of file DynCommon.h. Referenced by container_is_destroying(). |
|
Slot of the current component (if any).
Definition at line 236 of file DynCommon.h. Referenced by check_component(), next(), and seek(). |
|
Has destroy() been called on us yet?
Definition at line 233 of file DynCommon.h. Referenced by assign(), component_count(), copy(), destroyed(), get_abstract(), get_any(), get_dyn_any(), get_reference(), get_string(), get_typecode(), get_val(), get_wchar(), get_wstring(), insert_abstract(), insert_dyn_any(), insert_reference(), insert_string(), insert_val(), insert_wstring(), next(), rewind(), seek(), and type(). |
|
Do we contain other Dynamic Anys?
Definition at line 230 of file DynCommon.h. Referenced by get_abstract(), get_any(), get_reference(), get_string(), get_typecode(), get_val(), get_wchar(), get_wstring(), has_components(), insert_abstract(), insert_reference(), insert_string(), insert_val(), insert_wstring(), next(), and seek(). |
|
Were we created by current_component()?
Definition at line 224 of file DynCommon.h. Referenced by ref_to_component(). |
|
Holder for our type code.
Definition at line 242 of file DynCommon.h. Referenced by TAO_DynUnion_i::equal(), and TAO_DynAny_i::equal(). |