diff options
author | bala <balanatarajan@users.noreply.github.com> | 1999-08-19 21:31:46 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 1999-08-19 21:31:46 +0000 |
commit | c8633d97ff9f30587429924b62fc852eba7e3dcc (patch) | |
tree | 34d0799fa0af40193fbac5d26f888c25cc805085 | |
parent | b5c4c12d72f2860d2c3a842fbecdf7adb25c32d8 (diff) | |
download | ATCD-c8633d97ff9f30587429924b62fc852eba7e3dcc.tar.gz |
Added support for CORBA::Bounds
-rw-r--r-- | TAO/tao/BoundsC.cpp | 130 | ||||
-rw-r--r-- | TAO/tao/BoundsC.h | 80 | ||||
-rw-r--r-- | TAO/tao/BoundsC.i | 35 | ||||
-rw-r--r-- | TAO/tao/Makefile | 3 | ||||
-rw-r--r-- | TAO/tao/corba.h | 2 | ||||
-rw-r--r-- | TAO/tao/corbafwd.h | 6 |
6 files changed, 255 insertions, 1 deletions
diff --git a/TAO/tao/BoundsC.cpp b/TAO/tao/BoundsC.cpp new file mode 100644 index 00000000000..e8700b87d7c --- /dev/null +++ b/TAO/tao/BoundsC.cpp @@ -0,0 +1,130 @@ +/* -*- C++ -*- */ +//$Id$ +// ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* +// TAO and the TAO IDL Compiler have been developed by the Center for +// Distributed Object Computing at Washington University, St. Louis. +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#include "tao/BoundsC.h" + +#if !defined (__ACE_INLINE__) +#include "BoundsC.i" +#endif /* !defined INLINE */ + +// default constructor +CORBA_Bounds::CORBA_Bounds (void) + : CORBA_UserException (CORBA::_tc_Bounds) +{ +} + +// destructor - all members are of self managing types +CORBA_Bounds::~CORBA_Bounds (void) +{ +} + +// copy constructor +CORBA_Bounds::CORBA_Bounds (const CORBA::Bounds &_tao_excp) + : CORBA_UserException (_tao_excp._type ()) +{ + } + +// assignment operator +CORBA_Bounds& +CORBA_Bounds::operator= (const CORBA_Bounds &_tao_excp) +{ + + this->CORBA_UserException::operator= (_tao_excp); + return *this; +} + +// narrow +CORBA_Bounds_ptr +CORBA_Bounds::_narrow (CORBA_Exception *exc) +{ + if (!ACE_OS::strcmp ("IDL:omg.org/CORBA/Bounds:1.0", exc->_id ())) // same type + return ACE_dynamic_cast (CORBA_Bounds_ptr, exc); + else + return 0; +} + + +void CORBA_Bounds::_raise () +{ + TAO_RAISE(*this); +} + +// TAO extension - the _alloc method +CORBA::Exception *CORBA_Bounds::_alloc (void) +{ + return new CORBA_Bounds; +} + + + +void operator<<= (CORBA::Any &_tao_any, const CORBA::Bounds &_tao_elem) // copying +{ + CORBA::Bounds *_tao_any_val = new CORBA::Bounds (_tao_elem); + if (!_tao_any_val) return; + ACE_TRY_NEW_ENV + { + _tao_any.replace (CORBA::_tc_Bounds, _tao_any_val, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + delete _tao_any_val; + } + ACE_ENDTRY; +} + +void operator<<= (CORBA::Any &_tao_any, CORBA::Bounds *_tao_elem) // non copying +{ + ACE_TRY_NEW_ENV + { + _tao_any.replace (CORBA::_tc_Bounds, _tao_elem, 1, ACE_TRY_ENV); // consume it + ACE_TRY_CHECK; + } + ACE_CATCHANY {} + ACE_ENDTRY; +} + +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, CORBA::Bounds *&_tao_elem) +{ + ACE_TRY_NEW_ENV + { + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equal (CORBA::_tc_Bounds, ACE_TRY_ENV)) return 0; // not equal + ACE_TRY_CHECK; + if (_tao_any.any_owns_data ()) + { + _tao_elem = (CORBA::Bounds *)_tao_any.value (); + return 1; + } + else + { + ACE_NEW_RETURN (_tao_elem, CORBA::Bounds, 0); + TAO_InputCDR stream (_tao_any._tao_get_cdr ()); + if (stream.decode (CORBA::_tc_Bounds, _tao_elem, 0, ACE_TRY_ENV) + == CORBA::TypeCode::TRAVERSE_CONTINUE) + { + ((CORBA::Any *)&_tao_any)->replace (CORBA::_tc_Bounds, _tao_elem, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + return 1; + } + else + { + delete _tao_elem; + } + } + } + ACE_CATCHANY + { + delete _tao_elem; + return 0; + } + ACE_ENDTRY; + return 0; +} + diff --git a/TAO/tao/BoundsC.h b/TAO/tao/BoundsC.h new file mode 100644 index 00000000000..bd4084ff428 --- /dev/null +++ b/TAO/tao/BoundsC.h @@ -0,0 +1,80 @@ +/* -*- C++ -*- */ +//$Id$ +// ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* +// TAO and the TAO IDL Compiler have been developed by the Center for +// Distributed Object Computing at Washington University, St. Louis. +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +#ifndef _TAO_IDL_BOUNDSC_H_ +#define _TAO_IDL_BOUNDSC_H_ + +#include "tao/corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO +#if defined (TAO_EXPORT_NESTED_CLASSES) +# if defined (TAO_EXPORT_NESTED_MACRO) +# undef TAO_EXPORT_NESTED_MACRO +# endif /* defined (TAO_EXPORT_NESTED_MACRO) */ +# define TAO_EXPORT_NESTED_MACRO +#endif /* TAO_EXPORT_NESTED_CLASSES */ +#if defined(_MSC_VER) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if !defined (_CORBA_BOUNDS_CH_) +#define _CORBA_BOUNDS_CH_ + + class TAO_Export CORBA_Bounds : public CORBA::UserException + { + public: + + CORBA_Bounds (void); // default ctor + CORBA_Bounds (const CORBA_Bounds &); // copy ctor + ~CORBA_Bounds (void); // dtor + CORBA_Bounds &operator= (const CORBA_Bounds &); + + + virtual void _raise (void); + + static CORBA_Bounds *_narrow (CORBA::Exception *); + + + // = TAO extension + static CORBA::Exception *_alloc (void); + + }; // exception CORBA::Bounds + +#endif /* end #if !defined */ + + +void operator<<= (CORBA::Any &, const CORBA::Bounds &); // copying version +void operator<<= (CORBA::Any &, CORBA::Bounds*); // noncopying version +CORBA::Boolean operator>>= (const CORBA::Any &, CORBA::Bounds *&); + +#ifndef __ACE_INLINE__ + +CORBA::Boolean operator<< (TAO_OutputCDR &, const CORBA::Bounds &); // +CORBA::Boolean operator>> (TAO_InputCDR &, CORBA::Bounds &); + +#endif /* __ACE_INLINE__ */ + + +#if defined (__ACE_INLINE__) +#include "BoundsC.i" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) +#pragma warning(default:4250) +#endif /* _MSC_VER */ + +#endif /* ifndef */ diff --git a/TAO/tao/BoundsC.i b/TAO/tao/BoundsC.i new file mode 100644 index 00000000000..40e552e3e13 --- /dev/null +++ b/TAO/tao/BoundsC.i @@ -0,0 +1,35 @@ +/* -*- C++ -*- */ +//$Id$ +// ****** Code generated by the The ACE ORB (TAO) IDL Compiler ******* +// TAO and the TAO IDL Compiler have been developed by the Center for +// Distributed Object Computing at Washington University, St. Louis. +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// ************************************************************* +// Inline operations for exception CORBA::Bounds +// ************************************************************* + +ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, const CORBA::Bounds &_tao_aggregate) +{ + // first marshal the repository ID + if (strm << _tao_aggregate._id ()) + return 1; + else + return 0; +} + +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, CORBA::Bounds &_tao_aggregate) +{ + // retrieve RepoID and verify if we are of that type + char *_tao_repoID; + if ((strm >> _tao_repoID) && + (_tao_aggregate._is_a (_tao_repoID))) + { + return 1; + } + else + return 0; +} + diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index ccf756ec94c..60c418d03b9 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -40,7 +40,8 @@ PUB_HDRS = \ Reply_Dispatcher \ IORC \ IORS \ - IORManipulation + IORManipulation \ + BoundC POA_FILES = \ Object_Adapter \ diff --git a/TAO/tao/corba.h b/TAO/tao/corba.h index 43378fc5704..c66d75be83d 100644 --- a/TAO/tao/corba.h +++ b/TAO/tao/corba.h @@ -89,6 +89,8 @@ #endif /*TAO_HAS_INTERFACE_REPOSITORY */ +#include "tao/BoundsC.h" + #if !defined (ACE_NESTED_CLASS) #if defined (ACE_WIN32) #define ACE_NESTED_CLASS(SCOPE,CLASS) CLASS diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index af87a7baf36..b080d1c6b90 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -606,6 +606,9 @@ class CORBA_EnumMemberSeq_var; typedef CORBA_EnumMemberSeq *CORBA_EnumMemberSeq_ptr; #endif /* TAO_HAS_INTERFACE_REPOSITORY*/ +class CORBA_Bounds; +typedef CORBA_Bounds *CORBA_Bounds_ptr; + // enum values defined in tao/NVList.h, bitwise ORed. typedef u_int CORBA_Flags; @@ -1066,6 +1069,8 @@ TAO_NAMESPACE CORBA typedef CORBA_EnumMemberSeq_var EnumMemberSeq_var; #endif /* TAO_HAS_INTERFACE_REPOSITORY */ + typedef CORBA_Bounds Bounds; + typedef CORBA_Bounds *Bounds_ptr; #ifdef TAO_HAS_VALUETYPE typedef CORBA_ValueBase ValueBase; typedef CORBA_ValueFactoryBase ValueFactoryBase; @@ -1227,6 +1232,7 @@ TAO_NAMESPACE CORBA TAO_NAMESPACE_STORAGE_CLASS TypeCode_ptr _tc_UnknownUserException; + TAO_NAMESPACE_STORAGE_CLASS CORBA::TypeCode_ptr _tc_Bounds; TAO_NAMESPACE_STORAGE_CLASS TypeCode_ptr _tc_Current; #if !defined (TAO_HAS_MINIMUM_CORBA) |