union
case/member.
More...
#include <TypeCode_Case_Base_T.h>
Inheritance diagram for TAO::TypeCode::Case< StringType, TypeCodeType >:
Public Member Functions | |
Case (char const *name, TypeCodeType tc) | |
Constructor. | |
Case (void) | |
Constructor. | |
virtual | ~Case (void) |
Destructor. | |
virtual Case * | clone (void) const=0 |
Cloning/copying operation. | |
virtual CORBA::Any * | label (void) const=0 |
char const * | name (void) const |
Get the name of the union case/member. | |
void | name (char const *the_name) |
Set the name of the union case/member. | |
CORBA::TypeCode_ptr | type (void) const |
Get the CORBA::TypeCode of the union case/member. | |
void | type (CORBA::TypeCode_ptr tc) |
Set the CORBA::TypeCode of the union case/member. | |
bool | marshal (TAO_OutputCDR &cdr, CORBA::ULong offset) const |
bool | equal (CORBA::ULong index, CORBA::TypeCode_ptr tc) const |
bool | equivalent (CORBA::ULong index, CORBA::TypeCode_ptr tc) const |
Protected Member Functions | |
virtual bool | marshal_label (TAO_OutputCDR &cdr) const=0 |
virtual bool | equal_label (CORBA::ULong index, CORBA::TypeCode_ptr tc) const=0 |
Verify equality of member labels. | |
Private Attributes | |
StringType | name_ |
The name of the case. | |
TypeCodeType | type_ |
Pointer to the CORBA::TypeCode of the case. |
union
case/member.
This class hides the actual IDL union
member label value from the TAO::TypeCode::Union
class by relying on a CORBA::Any return value that corresponds to the CORBA::TypeCode::member_label()
return type. It also allows the TAO::TypeCode::Union
class to marshal the member label values into a CDR stream without knowledge of the underlying member label values.
Definition at line 56 of file TypeCode_Case_Base_T.h.
|
Constructor.
Constructor used when creating static Definition at line 12 of file TypeCode_Case_Base_T.inl.
|
|
Constructor.
Constructor used when creating dynamic Definition at line 22 of file TypeCode_Case_Base_T.inl.
|
|
Destructor.
Definition at line 16 of file TypeCode_Case_Base_T.cpp.
00017 { 00018 } |
|
Cloning/copying operation.
Implemented in TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >, and TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >. Referenced by ACE::VP_traits< TAO::TypeCode::Case_Dynamic >::clone(). |
|
Check for equality of the Definition at line 22 of file TypeCode_Case_Base_T.cpp. References TAO::TypeCode::Case< StringType, TypeCodeType >::equal_label(), TAO::TypeCode::Case< StringType, TypeCodeType >::name(), ACE_OS::strcmp(), and TAO::TypeCode::Case< StringType, TypeCodeType >::type(). Referenced by TAO::TypeCode::Union< StringType, TypeCodeType, CaseArrayType, RefCountPolicy >::equal_i().
00025 { 00026 // Check case names. 00027 char const * const lhs_name = this->name (); 00028 char const * const rhs_name = tc->member_name (index 00029 ); 00030 00031 if (ACE_OS::strcmp (lhs_name, rhs_name) != 0) 00032 return false; 00033 00034 // Check case TypeCodes. 00035 CORBA::TypeCode_ptr const lhs_tc = this->type (); 00036 CORBA::TypeCode_var const rhs_tc = 00037 tc->member_type (index 00038 ); 00039 00040 CORBA::Boolean const equal_members = 00041 lhs_tc->equal (rhs_tc.in () 00042 ); 00043 00044 if (!equal_members) 00045 return false; 00046 00047 // Check case label. 00048 return this->equal_label (index, 00049 tc 00050 ); 00051 } |
|
Verify equality of member labels.
Performing member label equality comparisons in the
Implemented in TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >, and TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >. Referenced by TAO::TypeCode::Case< StringType, TypeCodeType >::equal(), and TAO::TypeCode::Case< StringType, TypeCodeType >::equivalent(). |
|
Check for equivalence of the Definition at line 55 of file TypeCode_Case_Base_T.cpp. References TAO::TypeCode::Case< StringType, TypeCodeType >::equal_label(), and TAO::TypeCode::Case< StringType, TypeCodeType >::type(). Referenced by TAO::TypeCode::Union< StringType, TypeCodeType, CaseArrayType, RefCountPolicy >::equivalent_i().
00059 { 00060 // Member names are ignore when determining equivalence. 00061 00062 // Check case TypeCodes. 00063 CORBA::TypeCode_ptr const lhs_tc = this->type (); 00064 CORBA::TypeCode_var const rhs_tc = 00065 tc->member_type (index 00066 ); 00067 00068 CORBA::Boolean const equivalent_members = 00069 lhs_tc->equivalent (rhs_tc.in () 00070 ); 00071 00072 if (!equivalent_members) 00073 return 0; 00074 00075 // Check case label. 00076 // The label must be equal when determining equivalence, too. 00077 return this->equal_label (index, 00078 tc 00079 ); 00080 } |
|
Return the IDL Implemented in TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >, and TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >. |
|
Marshal this IDL Definition at line 32 of file TypeCode_Case_Base_T.inl. References TAO::TypeCode::Case< StringType, TypeCodeType >::marshal_label(), and ACE_OutputCDR::total_length(). Referenced by TAO::TypeCode::Union< StringType, TypeCodeType, CaseArrayType, RefCountPolicy >::tao_marshal().
00035 { 00036 return 00037 this->marshal_label (cdr) 00038 && (cdr << TAO_OutputCDR::from_string ( 00039 Traits<StringType>::get_string (this->name_), 0)) 00040 && TAO::TypeCode::marshal (cdr, 00041 Traits<StringType>::get_typecode (this->type_), 00042 offset + cdr.total_length ()); 00043 } |
|
Marshal the IDL Implemented in TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >, and TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >. Referenced by TAO::TypeCode::Case< StringType, TypeCodeType >::marshal(). |
|
Set the name of the
Definition at line 55 of file TypeCode_Case_Base_T.inl.
00057 { 00058 this->name_ = the_name; 00059 } |
|
Get the name of the
Definition at line 47 of file TypeCode_Case_Base_T.inl. Referenced by TAO::TypeCode::Case< StringType, TypeCodeType >::equal().
00048 {
00049 return
00050 Traits<StringType>::get_string (this->name_);
00051 }
|
|
Set the
Definition at line 71 of file TypeCode_Case_Base_T.inl. References CORBA::TypeCode::_duplicate().
00072 { 00073 // This assignment works since it is only used when TypeCodeType is 00074 // "CORBA::TypeCode_var", not in the "CORBA::TypeCode_ptr const *" 00075 // case. 00076 this->type_ = CORBA::TypeCode::_duplicate (tc); 00077 } |
|
Get the
Definition at line 63 of file TypeCode_Case_Base_T.inl. Referenced by TAO::TypeCode::Case< StringType, TypeCodeType >::equal(), and TAO::TypeCode::Case< StringType, TypeCodeType >::equivalent().
00064 {
00065 return
00066 Traits<StringType>::get_typecode (this->type_);
00067 }
|
|
The name of the case.
Definition at line 142 of file TypeCode_Case_Base_T.h. |
|
Pointer to the
A pointer to the
Definition at line 155 of file TypeCode_Case_Base_T.h. |