Empty_Param_TypeCode.cpp

Go to the documentation of this file.
00001 // $Id: Empty_Param_TypeCode.cpp 76687 2007-01-29 19:18:13Z johnnyw $
00002 
00003 #include "tao/AnyTypeCode/Empty_Param_TypeCode.h"
00004 
00005 #ifndef __ACE_INLINE__
00006 # include "tao/AnyTypeCode/Empty_Param_TypeCode.inl"
00007 #endif  /* !__ACE_INLINE__ */
00008 
00009 
00010 ACE_RCSID (AnyTypeCode,
00011            Empty_Param_TypeCode,
00012            "$Id: Empty_Param_TypeCode.cpp 76687 2007-01-29 19:18:13Z johnnyw $")
00013 
00014 
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016 
00017 bool
00018 TAO::TypeCode::Empty_Param::tao_marshal (TAO_OutputCDR &, CORBA::ULong) const
00019 {
00020   // Empty parameter list.  Nothing to marshal.
00021 
00022   return true;
00023 }
00024 
00025 void
00026 TAO::TypeCode::Empty_Param::tao_duplicate (void)
00027 {
00028   // No-op since empty parameter TypeCodes are never created
00029   // dynamically, meaning there is no need to implement reference
00030   // counting.
00031 }
00032 
00033 void
00034 TAO::TypeCode::Empty_Param::tao_release (void)
00035 {
00036   // No-op since empty parameter TypeCodes are never created
00037   // dynamically, meaning there is no need to implement reference
00038   // counting.
00039 }
00040 
00041 CORBA::Boolean
00042 TAO::TypeCode::Empty_Param::equal_i (CORBA::TypeCode_ptr) const
00043 {
00044   // Equality has already been established in the
00045   // CORBA::TypeCode base class.
00046 
00047   return true;
00048 }
00049 
00050 CORBA::Boolean
00051 TAO::TypeCode::Empty_Param::equivalent_i (CORBA::TypeCode_ptr tc) const
00052 {
00053   // We could refactor this code to the CORBA::TypeCode::equivalent()
00054   // method but doing so would force us to determine the unaliased
00055   // kind of this TypeCode.  Since we already know the unaliased kind
00056   // of this TypeCode, choose to optimize away the additional kind
00057   // unaliasing operation rather than save space.
00058 
00059   CORBA::TCKind const tc_kind = TAO::unaliased_kind (tc);
00060 
00061   if (tc_kind != this->kind_)
00062     return false;
00063 
00064   return true;
00065 }
00066 
00067 CORBA::TypeCode_ptr
00068 TAO::TypeCode::Empty_Param::get_compact_typecode_i (void) const
00069 {
00070   // Already compact since parameter list is empty.
00071 
00072   // Since empty parameter TypeCodes are never created
00073   // dynamically, there is no need to manipulate a reference count.
00074 
00075   static TAO::TypeCode::Empty_Param compact_typecode (this->kind_);
00076 
00077   return &compact_typecode;
00078 }
00079 
00080 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Sun Jan 27 13:21:06 2008 for TAO_AnyTypeCode by doxygen 1.3.6