TAO_AnyTypeCode 4.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType > Class Template Reference

Representation of an OMG IDL defined union case. More...

#include <TypeCode_Case_T.h>

Inheritance diagram for TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >:
Inheritance graph
[legend]
Collaboration diagram for TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >:
Collaboration graph
[legend]

Public Member Functions

 Case_T (DiscriminatorType member_label, char const *member_name, TypeCodeType member_type)
 Constructor.
 
 Case_T (DiscriminatorType member_label)
 Constructor.
 
- Public Member Functions inherited from TAO::TypeCode::Case< StringType, TypeCodeType >
 Case (char const *name, TypeCodeType tc)
 Constructor.
 
 Case ()
 Constructor.
 
virtual ~Case ()
 Destructor.
 
char const * name () 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 () 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
 

@c TAO::TypeCode::Case Methods

Methods required by the TAO::TypeCode::Case abstract base class.

See also
TAO::TypeCode::Case
DiscriminatorType const label_
 IDL union case/member label value.
 
Case< StringType, TypeCodeType > * clone () const
 IDL union case/member label value.
 
virtual CORBA::Anylabel () const
 IDL union case/member label value.
 
virtual bool marshal_label (TAO_OutputCDR &cdr) const
 IDL union case/member label value.
 
virtual bool equal_label (CORBA::ULong index, CORBA::TypeCode_ptr tc) const
 IDL union case/member label value.
 

Additional Inherited Members

Detailed Description

template<typename DiscriminatorType, typename StringType, typename TypeCodeType>
class TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >

Representation of an OMG IDL defined union case.

A Case_T contains the corresponding case label value, name and pointer to the CORBA::TypeCode for a given OMG IDL union case. For example, the cases in following OMG IDL union:

union Foo switch (short)
{
case 0:
case 1: short a;
case 2: long b;
default: octet c;
};

would be represented using the following statically instantiated TAO::TypeCode::Case_T array:

Foo_Case _tao_cases_Foo[] =
{
Foo_Case (0, "a", &CORBA::_tc_short),
Foo_Case (1, "a", &CORBA::_tc_short),
Foo_Case (2, "b", &CORBA::_tc_long),
Foo_Case (0, "c", &CORBA::_tc_octet)
};
TypeCode_ptr const _tc_octet
Definition TypeCode_Constants.cpp:93
TypeCode_ptr const _tc_long
Definition TypeCode_Constants.cpp:86
TypeCode_ptr const _tc_short
Definition TypeCode_Constants.cpp:82
Representation of an OMG IDL defined union case.
Definition TypeCode_Case_T.h:87

The default index is passed directly to the TAO::TypeCode::Union constructor.

The template parameter DISCRIMINATOR_TYPE is the corresponding C++ type for the IDL defined union discriminator type. For example, a union with an IDL short discriminator will have a corresponding CORBA::Short C++ type. This template parameter is necessary to allow the actual case label value to be stored as its actual type, which is particularly important when marshaling that value into a CDR stream.

The template parameter StringType is either char const * or CORBA::String_var. The latter is only used when creating CORBA::tk_union TypeCode dynamically, such as through the TypeCodeFactory.

Constructor & Destructor Documentation

◆ Case_T() [1/2]

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::Case_T ( DiscriminatorType member_label,
char const * member_name,
TypeCodeType member_type )

Constructor.

◆ Case_T() [2/2]

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::Case_T ( DiscriminatorType member_label)

Constructor.

Constructor only used in the dynamically constructed union TypeCode case.

Member Function Documentation

◆ clone()

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
TAO::TypeCode::Case< StringType, TypeCodeType > * TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::clone ( ) const
virtual

IDL union case/member label value.

Implements TAO::TypeCode::Case< StringType, TypeCodeType >.

◆ equal_label()

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
bool TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::equal_label ( CORBA::ULong index,
CORBA::TypeCode_ptr tc ) const
virtual

IDL union case/member label value.

Implements TAO::TypeCode::Case< StringType, TypeCodeType >.

◆ label()

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
CORBA::Any * TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::label ( ) const
virtual

IDL union case/member label value.

Implements TAO::TypeCode::Case< StringType, TypeCodeType >.

◆ marshal_label()

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
bool TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::marshal_label ( TAO_OutputCDR & cdr) const
virtual

IDL union case/member label value.

Implements TAO::TypeCode::Case< StringType, TypeCodeType >.

Member Data Documentation

◆ label_

template<typename DiscriminatorType , typename StringType , typename TypeCodeType >
DiscriminatorType const TAO::TypeCode::Case_T< DiscriminatorType, StringType, TypeCodeType >::label_
private

IDL union case/member label value.


The documentation for this class was generated from the following files: