Representation of an OMG IDL defined union
case
for unions with Enum discriminators.
More...
#include <TypeCode_Case_Enum_T.h>
Public Member Functions | |
Case_Enum_T (CORBA::TypeCode_ptr discriminator_tc, CORBA::ULong member_label, char const *member_name, TypeCodeType member_type) | |
Constructor. | |
Case_Enum_T (CORBA::TypeCode_ptr discriminator_tc, CORBA::ULong member_label) | |
Constructor. | |
@c TAO::TypeCode::Case Methods | |
Methods required by the
| |
Case< StringType, TypeCodeType > * | clone (void) const |
Cloning/copying operation. | |
virtual CORBA::Any * | label (void) const |
virtual bool | marshal_label (TAO_OutputCDR &cdr) const |
virtual bool | equal_label (CORBA::ULong index, CORBA::TypeCode_ptr tc) const |
Verify equality of member labels. | |
Private Attributes | |
::CORBA::ULong const | label_ |
IDL union case/member label value. | |
CORBA::TypeCode_var | discriminator_tc_ |
IDL union discriminator typecode. |
Representation of an OMG IDL defined union
case
for unions with Enum discriminators.
When dynamically creating a union type with a enum discriminator, there is not way that the template parameter DiscriminatorType can be specified at runtime.
Since enums are encoded as ULongs, DiscriminatorType has been replaced with CORBA::ULong.
Definition at line 49 of file TypeCode_Case_Enum_T.h.
TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::Case_Enum_T | ( | CORBA::TypeCode_ptr | discriminator_tc, | |
CORBA::ULong | member_label, | |||
char const * | member_name, | |||
TypeCodeType | member_type | |||
) |
Constructor.
Definition at line 12 of file TypeCode_Case_Enum_T.inl.
: Case<StringType, TypeCodeType> (member_name, member_type) , label_ (member_label) , discriminator_tc_( CORBA::TypeCode::_duplicate (discriminator_tc) ) { }
TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::Case_Enum_T | ( | CORBA::TypeCode_ptr | discriminator_tc, | |
CORBA::ULong | member_label | |||
) |
Constructor.
Constructor only used in the dynamically constructed union
TypeCode
case.
Definition at line 26 of file TypeCode_Case_Enum_T.inl.
: Case<StringType, TypeCodeType> () , label_ (member_label) , discriminator_tc_( CORBA::TypeCode::_duplicate (discriminator_tc) ) { }
TAO::TypeCode::Case< StringType, TypeCodeType > * TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::clone | ( | void | ) | const [virtual] |
Cloning/copying operation.
Implements TAO::TypeCode::Case< StringType, TypeCodeType >.
Definition at line 25 of file TypeCode_Case_Enum_T.cpp.
{ Case<StringType, TypeCodeType> * p = 0; typedef Case_Enum_T<StringType, TypeCodeType> case_type; // The compiler generated memberwise copy constructor is sufficient. ACE_NEW_RETURN (p, case_type (*this), p); return p; }
virtual bool TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::equal_label | ( | CORBA::ULong | index, | |
CORBA::TypeCode_ptr | tc | |||
) | const [virtual] |
Verify equality of member labels.
Performing member label equality comparisons in the Case
subclass allows us to avoid performing interpretive extraction of the value from the Any
returned from the "right hand side" operand TypeCode
since the Case
subclass already knows what type and value should be extracted from the Any
.
index | Member index of given TypeCode tc being tested. | |
tc | The TypeCode whose member "@a index" label is being tested. |
Implements TAO::TypeCode::Case< StringType, TypeCodeType >.
CORBA::Any * TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::label | ( | void | ) | const [virtual] |
Return the IDL union
case label value embedded within a CORBA::Any
.
Implements TAO::TypeCode::Case< StringType, TypeCodeType >.
Definition at line 81 of file TypeCode_Case_Enum_T.cpp.
{ TAO_OutputCDR out_cdr; out_cdr.write_ulong (this->label_); CORBA::Any *retval = 0; ACE_NEW_THROW_EX (retval, CORBA::Any, CORBA::NO_MEMORY ()); TAO_InputCDR in_cdr (out_cdr); TAO::Unknown_IDL_Type *unk = 0; ACE_NEW_THROW_EX (unk, TAO::Unknown_IDL_Type (this->discriminator_tc_.in (), in_cdr), CORBA::NO_MEMORY ()); CORBA::Any_var safe_value (retval); retval->replace (unk); return safe_value._retn (); }
bool TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::marshal_label | ( | TAO_OutputCDR & | cdr | ) | const [virtual] |
Marshal the IDL union
case
label value into the given output CDR stream.
Implements TAO::TypeCode::Case< StringType, TypeCodeType >.
Definition at line 44 of file TypeCode_Case_Enum_T.cpp.
{
return
(cdr << this->label_);
}
CORBA::TypeCode_var TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::discriminator_tc_ [private] |
IDL union
discriminator typecode.
Definition at line 90 of file TypeCode_Case_Enum_T.h.
::CORBA::ULong const TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::label_ [private] |
IDL union
case/member label value.
Definition at line 87 of file TypeCode_Case_Enum_T.h.