PolicyC.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: PolicyC.cpp 80140 2007-11-30 00:40:17Z jtc $
00004 
00005 // ****  Code generated by the The ACE ORB (TAO) IDL Compiler ****
00006 // TAO and the TAO IDL Compiler have been developed by:
00007 //       Center for Distributed Object Computing
00008 //       Washington University
00009 //       St. Louis, MO
00010 //       USA
00011 //       http://www.cs.wustl.edu/~schmidt/doc-center.html
00012 // and
00013 //       Distributed Object Computing Laboratory
00014 //       University of California at Irvine
00015 //       Irvine, CA
00016 //       USA
00017 //       http://doc.ece.uci.edu/
00018 // and
00019 //       Institute for Software Integrated Systems
00020 //       Vanderbilt University
00021 //       Nashville, TN
00022 //       USA
00023 //       http://www.isis.vanderbilt.edu/
00024 //
00025 // Information about TAO is available at:
00026 //     http://www.cs.wustl.edu/~schmidt/TAO.html
00027 
00028 // TAO_IDL - Generated from
00029 // be\be_codegen.cpp:291
00030 
00031 
00032 #include "tao/PolicyC.h"
00033 #include "tao/CDR.h"
00034 #include "tao/SystemException.h"
00035 #include "tao/Invocation_Adapter.h"
00036 #include "tao/Object_T.h"
00037 #include "tao/Basic_Arguments.h"
00038 #include "tao/Object_Argument_T.h"
00039 #include "ace/OS_NS_string.h"
00040 #include "tao/AnyTypeCode_Adapter.h"
00041 #include "ace/Dynamic_Service.h"
00042 
00043 #if !defined (__ACE_INLINE__)
00044 #include "tao/PolicyC.inl"
00045 #endif /* !defined INLINE */
00046 
00047 // TAO_IDL - Generated from
00048 // be\be_visitor_arg_traits.cpp:70
00049 
00050 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00051 
00052 // TAO specific stuff.
00053 namespace CORBA
00054 {
00055   class Policy;
00056   typedef Policy *Policy_ptr;
00057   typedef TAO_Objref_Var_T<Policy> Policy_var;
00058   typedef TAO_Objref_Out_T<Policy> Policy_out;
00059 }
00060 
00061 namespace TAO
00062 {
00063 
00064 #if TAO_HAS_INTERCEPTORS == 1
00065 
00066 #endif /* TAO_HAS_INTERCEPTORS */
00067 
00068 }
00069 
00070 // Arg traits specializations.
00071 namespace TAO
00072 {
00073 
00074 #if !defined (_CORBA_POLICY__ARG_TRAITS_CS_)
00075 #define _CORBA_POLICY__ARG_TRAITS_CS_
00076 
00077   template<>
00078   class  Arg_Traits<CORBA::Policy>
00079     : public
00080         Object_Arg_Traits_T<
00081             CORBA::Policy_ptr,
00082             CORBA::Policy_var,
00083             CORBA::Policy_out,
00084             TAO::Objref_Traits<CORBA::Policy>,
00085             TAO::Any_Insert_Policy_AnyTypeCode_Adapter <CORBA::Policy_ptr>
00086           >
00087   {
00088   };
00089 
00090 #endif /* end #if !defined */
00091 }
00092 
00093 
00094 // TAO_IDL - Generated from
00095 // be\be_visitor_exception/exception_cs.cpp:63
00096 
00097 CORBA::PolicyError::PolicyError (void)
00098   : CORBA::UserException (
00099         "IDL:omg.org/CORBA/PolicyError:1.0",
00100         "PolicyError"
00101       )
00102 {
00103 }
00104 
00105 CORBA::PolicyError::~PolicyError (void)
00106 {
00107 }
00108 
00109 CORBA::PolicyError::PolicyError (const ::CORBA::PolicyError &_tao_excp)
00110   : CORBA::UserException (
00111         _tao_excp._rep_id (),
00112         _tao_excp._name ()
00113       )
00114 {
00115   this->reason = _tao_excp.reason;
00116 }
00117 
00118 CORBA::PolicyError&
00119 CORBA::PolicyError::operator= (const ::CORBA::PolicyError &_tao_excp)
00120 {
00121   this->::CORBA::UserException::operator= (_tao_excp);
00122   this->reason = _tao_excp.reason;
00123   return *this;
00124 }
00125 
00126 void CORBA::PolicyError::_tao_any_destructor (void *_tao_void_pointer)
00127 {
00128   PolicyError *_tao_tmp_pointer =
00129     static_cast<PolicyError *> (_tao_void_pointer);
00130   delete _tao_tmp_pointer;
00131 }
00132 
00133 CORBA::PolicyError *
00134 CORBA::PolicyError::_downcast (CORBA::Exception *_tao_excp)
00135 {
00136   return dynamic_cast<PolicyError *> (_tao_excp);
00137 }
00138 
00139 const CORBA::PolicyError *
00140 CORBA::PolicyError::_downcast (CORBA::Exception const *_tao_excp)
00141 {
00142   return dynamic_cast<const PolicyError *> (_tao_excp);
00143 }
00144 
00145 CORBA::Exception *CORBA::PolicyError::_alloc (void)
00146 {
00147   CORBA::Exception *retval = 0;
00148   ACE_NEW_RETURN (retval, ::CORBA::PolicyError, 0);
00149   return retval;
00150 }
00151 
00152 CORBA::Exception *
00153 CORBA::PolicyError::_tao_duplicate (void) const
00154 {
00155   CORBA::Exception *result = 0;
00156   ACE_NEW_RETURN (
00157       result,
00158       ::CORBA::PolicyError (*this),
00159       0
00160     );
00161   return result;
00162 }
00163 
00164 void CORBA::PolicyError::_raise (void) const
00165 {
00166   throw *this;
00167 }
00168 
00169 void CORBA::PolicyError::_tao_encode (
00170     TAO_OutputCDR &cdr
00171 
00172   ) const
00173 {
00174   if (cdr << *this)
00175     {
00176       return;
00177     }
00178 
00179   throw ::CORBA::MARSHAL ();
00180 }
00181 
00182 void CORBA::PolicyError::_tao_decode (
00183     TAO_InputCDR &cdr
00184 
00185   )
00186 {
00187   if (cdr >> *this)
00188     {
00189       return;
00190     }
00191 
00192   throw ::CORBA::MARSHAL ();
00193 }
00194 
00195 
00196 
00197 // TAO_IDL - Generated from
00198 // be\be_visitor_exception/exception_ctor.cpp:66
00199 
00200 CORBA::PolicyError::PolicyError (
00201     CORBA::PolicyErrorCode _tao_reason
00202   )
00203   : CORBA::UserException (
00204         "IDL:omg.org/CORBA/PolicyError:1.0",
00205         "PolicyError"
00206       )
00207 {
00208   this->reason = _tao_reason;
00209 }
00210 
00211 // TAO extension - the virtual _type method.
00212 CORBA::TypeCode_ptr CORBA::PolicyError::_tao_type (void) const
00213 {
00214   TAO_AnyTypeCode_Adapter *adapter =
00215     ACE_Dynamic_Service<TAO_AnyTypeCode_Adapter>::instance (
00216         "AnyTypeCode_Adapter"
00217       );
00218   if (adapter != 0)
00219     return adapter->_tao_type_PolicyError ();
00220   else
00221     {
00222       ACE_ERROR ((LM_ERROR,
00223                   ACE_TEXT ("(%P|%t) %p\n"),
00224                   ACE_TEXT ("Unable to find the ")
00225                   ACE_TEXT ("AnyTypeCode Adapter instance")));
00226       return 0;
00227     }
00228 }
00229 
00230 // TAO_IDL - Generated from
00231 // be\be_visitor_exception/exception_cs.cpp:63
00232 
00233 CORBA::InvalidPolicies::InvalidPolicies (void)
00234   : CORBA::UserException (
00235         "IDL:omg.org/CORBA/InvalidPolicies:1.0",
00236         "InvalidPolicies"
00237       )
00238 {
00239 }
00240 
00241 CORBA::InvalidPolicies::~InvalidPolicies (void)
00242 {
00243 }
00244 
00245 CORBA::InvalidPolicies::InvalidPolicies (const ::CORBA::InvalidPolicies &_tao_excp)
00246   : CORBA::UserException (
00247         _tao_excp._rep_id (),
00248         _tao_excp._name ()
00249       )
00250 {
00251   this->indices = _tao_excp.indices;
00252 }
00253 
00254 CORBA::InvalidPolicies&
00255 CORBA::InvalidPolicies::operator= (const ::CORBA::InvalidPolicies &_tao_excp)
00256 {
00257   this->::CORBA::UserException::operator= (_tao_excp);
00258   this->indices = _tao_excp.indices;
00259   return *this;
00260 }
00261 
00262 void CORBA::InvalidPolicies::_tao_any_destructor (void *_tao_void_pointer)
00263 {
00264   InvalidPolicies *_tao_tmp_pointer =
00265     static_cast<InvalidPolicies *> (_tao_void_pointer);
00266   delete _tao_tmp_pointer;
00267 }
00268 
00269 CORBA::InvalidPolicies *
00270 CORBA::InvalidPolicies::_downcast (CORBA::Exception *_tao_excp)
00271 {
00272   return dynamic_cast<InvalidPolicies *> (_tao_excp);
00273 }
00274 
00275 const CORBA::InvalidPolicies *
00276 CORBA::InvalidPolicies::_downcast (CORBA::Exception const *_tao_excp)
00277 {
00278   return dynamic_cast<const InvalidPolicies *> (_tao_excp);
00279 }
00280 
00281 CORBA::Exception *CORBA::InvalidPolicies::_alloc (void)
00282 {
00283   CORBA::Exception *retval = 0;
00284   ACE_NEW_RETURN (retval, ::CORBA::InvalidPolicies, 0);
00285   return retval;
00286 }
00287 
00288 CORBA::Exception *
00289 CORBA::InvalidPolicies::_tao_duplicate (void) const
00290 {
00291   CORBA::Exception *result = 0;
00292   ACE_NEW_RETURN (
00293       result,
00294       ::CORBA::InvalidPolicies (*this),
00295       0
00296     );
00297   return result;
00298 }
00299 
00300 void CORBA::InvalidPolicies::_raise (void) const
00301 {
00302   throw *this;
00303 }
00304 
00305 void CORBA::InvalidPolicies::_tao_encode (TAO_OutputCDR &cdr) const
00306 {
00307   if (cdr << *this)
00308     {
00309       return;
00310     }
00311 
00312   throw ::CORBA::MARSHAL ();
00313 }
00314 
00315 void CORBA::InvalidPolicies::_tao_decode (TAO_InputCDR &cdr)
00316 {
00317   if (cdr >> *this)
00318     {
00319       return;
00320     }
00321 
00322   throw ::CORBA::MARSHAL ();
00323 }
00324 
00325 
00326 
00327 // TAO_IDL - Generated from
00328 // be\be_visitor_exception/exception_ctor.cpp:66
00329 
00330 CORBA::InvalidPolicies::InvalidPolicies (
00331     const CORBA::UShortSeq & _tao_indices
00332   )
00333   : CORBA::UserException (
00334         "IDL:omg.org/CORBA/InvalidPolicies:1.0",
00335         "InvalidPolicies"
00336       )
00337 {
00338   this->indices = _tao_indices;
00339 }
00340 
00341 // TAO extension - the virtual _type method.
00342 CORBA::TypeCode_ptr CORBA::InvalidPolicies::_tao_type (void) const
00343 {
00344   TAO_AnyTypeCode_Adapter *adapter =
00345     ACE_Dynamic_Service<TAO_AnyTypeCode_Adapter>::instance (
00346         "AnyTypeCode_Adapter"
00347       );
00348   if (adapter != 0)
00349     return adapter->_tao_type_InvalidPolicies ();
00350   else
00351     {
00352       ACE_ERROR ((LM_ERROR,
00353                   ACE_TEXT ("(%P|%t) %p\n"),
00354                   ACE_TEXT ("Unable to find the ")
00355                   ACE_TEXT ("AnyTypeCode Adapter instance")));
00356       return 0;
00357     }
00358 }
00359 
00360 // TAO_IDL - Generated from
00361 // be\be_visitor_interface/interface_cs.cpp:60
00362 
00363 // Traits specializations for CORBA::Policy.
00364 
00365 CORBA::Policy_ptr
00366 TAO::Objref_Traits<CORBA::Policy>::duplicate (
00367     CORBA::Policy_ptr p
00368   )
00369 {
00370   return CORBA::Policy::_duplicate (p);
00371 }
00372 
00373 void
00374 TAO::Objref_Traits<CORBA::Policy>::release (
00375     CORBA::Policy_ptr p
00376   )
00377 {
00378   ::CORBA::release (p);
00379 }
00380 
00381 CORBA::Policy_ptr
00382 TAO::Objref_Traits<CORBA::Policy>::nil (void)
00383 {
00384   return CORBA::Policy::_nil ();
00385 }
00386 
00387 CORBA::Boolean
00388 TAO::Objref_Traits<CORBA::Policy>::marshal (
00389     const CORBA::Policy_ptr p,
00390     TAO_OutputCDR & cdr
00391   )
00392 {
00393   return CORBA::Object::marshal (p, cdr);
00394 }
00395 
00396 // Function pointer for collocation factory initialization.
00397 TAO::Collocation_Proxy_Broker *
00398 (*CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer) (
00399     CORBA::Object_ptr obj
00400   ) = 0;
00401 
00402 // TAO_IDL - Generated from
00403 // be\be_visitor_operation/operation_cs.cpp:78
00404 
00405 CORBA::PolicyType CORBA::Policy::policy_type (
00406 
00407   )
00408 {
00409   if (!this->is_evaluated ())
00410     {
00411       ::CORBA::Object::tao_object_initialize (this);
00412     }
00413 
00414   if (this->the_TAO_Policy_Proxy_Broker_ == 0)
00415     {
00416       CORBA_Policy_setup_collocation ();
00417     }
00418 
00419   TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val _tao_retval;
00420 
00421   TAO::Argument *_the_tao_operation_signature [] =
00422     {
00423       &_tao_retval
00424     };
00425 
00426   TAO::Invocation_Adapter _tao_call (
00427       this,
00428       _the_tao_operation_signature,
00429       1,
00430       "_get_policy_type",
00431       16,
00432       this->the_TAO_Policy_Proxy_Broker_
00433     );
00434 
00435   _tao_call.invoke (0, 0);
00436 
00437   return _tao_retval.retn ();
00438 }
00439 
00440 // TAO_IDL - Generated from
00441 // be\be_visitor_operation/operation_cs.cpp:78
00442 
00443 ::CORBA::Policy_ptr CORBA::Policy::copy (
00444 
00445   )
00446 {
00447   if (!this->is_evaluated ())
00448     {
00449       ::CORBA::Object::tao_object_initialize (this);
00450     }
00451 
00452   if (this->the_TAO_Policy_Proxy_Broker_ == 0)
00453     {
00454       CORBA_Policy_setup_collocation ();
00455     }
00456 
00457   TAO::Arg_Traits< ::CORBA::Policy>::ret_val _tao_retval;
00458 
00459   TAO::Argument *_the_tao_operation_signature [] =
00460     {
00461       &_tao_retval
00462     };
00463 
00464   TAO::Invocation_Adapter _tao_call (
00465       this,
00466       _the_tao_operation_signature,
00467       1,
00468       "copy",
00469       4,
00470       this->the_TAO_Policy_Proxy_Broker_
00471     );
00472 
00473   _tao_call.invoke (0, 0);
00474 
00475   return _tao_retval.retn ();
00476 }
00477 
00478 // TAO_IDL - Generated from
00479 // be\be_visitor_operation/operation_cs.cpp:78
00480 
00481 void CORBA::Policy::destroy (
00482 
00483   )
00484 {
00485   if (!this->is_evaluated ())
00486     {
00487       ::CORBA::Object::tao_object_initialize (this);
00488     }
00489 
00490   if (this->the_TAO_Policy_Proxy_Broker_ == 0)
00491     {
00492       CORBA_Policy_setup_collocation ();
00493     }
00494 
00495   TAO::Arg_Traits< void>::ret_val _tao_retval;
00496 
00497   TAO::Argument *_the_tao_operation_signature [] =
00498     {
00499       &_tao_retval
00500     };
00501 
00502   TAO::Invocation_Adapter _tao_call (
00503       this,
00504       _the_tao_operation_signature,
00505       1,
00506       "destroy",
00507       7,
00508       this->the_TAO_Policy_Proxy_Broker_
00509     );
00510 
00511   _tao_call.invoke (0, 0);
00512 }
00513 
00514 CORBA::Policy::Policy (void)
00515  : the_TAO_Policy_Proxy_Broker_ (0)
00516 {
00517   this->CORBA_Policy_setup_collocation ();
00518 }
00519 
00520 void
00521 CORBA::Policy::CORBA_Policy_setup_collocation ()
00522 {
00523   if (::CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer)
00524     {
00525       this->the_TAO_Policy_Proxy_Broker_ =
00526         ::CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer (this);
00527     }
00528 }
00529 
00530 CORBA::Policy::~Policy (void)
00531 {}
00532 
00533 void
00534 CORBA::Policy::_tao_any_destructor (void *_tao_void_pointer)
00535 {
00536   Policy *_tao_tmp_pointer =
00537     static_cast<Policy *> (_tao_void_pointer);
00538   ::CORBA::release (_tao_tmp_pointer);
00539 }
00540 
00541 CORBA::Policy_ptr
00542 CORBA::Policy::_narrow (
00543     CORBA::Object_ptr _tao_objref
00544 
00545   )
00546 {
00547   return
00548     TAO::Narrow_Utils<Policy>::narrow (
00549         _tao_objref,
00550         "IDL:omg.org/CORBA/Policy:1.0",
00551         CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
00552 
00553       );
00554 }
00555 
00556 CORBA::Policy_ptr
00557 CORBA::Policy::_unchecked_narrow (
00558     CORBA::Object_ptr _tao_objref
00559 
00560   )
00561 {
00562   return
00563     TAO::Narrow_Utils<Policy>::unchecked_narrow (
00564         _tao_objref,
00565         "IDL:omg.org/CORBA/Policy:1.0",
00566         CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
00567 
00568       );
00569 }
00570 
00571 CORBA::Policy_ptr
00572 CORBA::Policy::_duplicate (Policy_ptr obj)
00573 {
00574   if (! ::CORBA::is_nil (obj))
00575     {
00576       obj->_add_ref ();
00577     }
00578 
00579   return obj;
00580 }
00581 
00582 void
00583 CORBA::Policy::_tao_release (Policy_ptr obj)
00584 {
00585   ::CORBA::release (obj);
00586 }
00587 
00588 CORBA::Boolean
00589 CORBA::Policy::_is_a (
00590     const char *value
00591 
00592   )
00593 {
00594   if (
00595       !ACE_OS::strcmp (
00596           value,
00597           "IDL:omg.org/CORBA/Policy:1.0"
00598         ) ||
00599       !ACE_OS::strcmp (
00600           value,
00601           "IDL:omg.org/CORBA/Object:1.0"
00602         )
00603     )
00604     {
00605       return true; // success using local knowledge
00606     }
00607   else
00608     {
00609       return this->::CORBA::Object::_is_a (
00610           value
00611 
00612         );
00613     }
00614 }
00615 
00616 const char* CORBA::Policy::_interface_repository_id (void) const
00617 {
00618   return "IDL:omg.org/CORBA/Policy:1.0";
00619 }
00620 
00621 CORBA::Boolean
00622 CORBA::Policy::marshal (TAO_OutputCDR &cdr)
00623 {
00624   return (cdr << this);
00625 }
00626 
00627 // TAO_IDL - Generated from
00628 // be\be_visitor_exception/cdr_op_cs.cpp:60
00629 
00630 CORBA::Boolean operator<< (
00631     TAO_OutputCDR &strm,
00632     const CORBA::PolicyError &_tao_aggregate
00633   )
00634 {
00635   // First marshal the repository ID.
00636   if (strm << _tao_aggregate._rep_id ())
00637     {
00638       // Now marshal the members (if any).
00639       return (
00640         (strm << _tao_aggregate.reason)
00641        );
00642     }
00643   else
00644     {
00645       return false;
00646     }
00647 }
00648 
00649 CORBA::Boolean operator>> (
00650     TAO_InputCDR &strm,
00651     CORBA::PolicyError &_tao_aggregate
00652   )
00653 {
00654   // Demarshal the members.
00655   return (
00656     (strm >> _tao_aggregate.reason)
00657   );
00658 }
00659 
00660 // TAO_IDL - Generated from
00661 // be\be_visitor_exception/cdr_op_cs.cpp:60
00662 
00663 CORBA::Boolean operator<< (
00664     TAO_OutputCDR &strm,
00665     const CORBA::InvalidPolicies &_tao_aggregate
00666   )
00667 {
00668   // First marshal the repository ID.
00669   if (strm << _tao_aggregate._rep_id ())
00670     {
00671       // Now marshal the members (if any).
00672       return (
00673         (strm << _tao_aggregate.indices)
00674        );
00675     }
00676   else
00677     {
00678       return false;
00679     }
00680 }
00681 
00682 CORBA::Boolean operator>> (
00683     TAO_InputCDR &strm,
00684     CORBA::InvalidPolicies &_tao_aggregate
00685   )
00686 {
00687   // Demarshal the members.
00688   return (
00689     (strm >> _tao_aggregate.indices)
00690   );
00691 }
00692 
00693 // Hand crafted.
00694 //
00695 // ****************************************************************
00696 CORBA::Boolean
00697 CORBA::Policy::_tao_encode (TAO_OutputCDR &)
00698 {
00699   return false;
00700 }
00701 
00702 CORBA::Boolean
00703 CORBA::Policy::_tao_decode (TAO_InputCDR &)
00704 {
00705   return false;
00706 }
00707 
00708 TAO_Cached_Policy_Type
00709 CORBA::Policy::_tao_cached_type (void) const
00710 {
00711   return TAO_CACHED_POLICY_UNCACHED;
00712 }
00713 
00714 TAO_Policy_Scope
00715 CORBA::Policy::_tao_scope (void) const
00716 {
00717   return TAO_POLICY_DEFAULT_SCOPE;
00718 }
00719 // ****************************************************************
00720 
00721 // TAO_IDL - Generated from
00722 // be\be_visitor_interface/cdr_op_cs.cpp:63
00723 
00724 CORBA::Boolean operator<< (
00725     TAO_OutputCDR &strm,
00726     const CORBA::Policy_ptr _tao_objref
00727   )
00728 {
00729   CORBA::Object_ptr _tao_corba_obj = _tao_objref;
00730   return (strm << _tao_corba_obj);
00731 }
00732 
00733 CORBA::Boolean operator>> (
00734     TAO_InputCDR &strm,
00735     CORBA::Policy_ptr &_tao_objref
00736   )
00737 {
00738   CORBA::Object_var obj;
00739 
00740   if (!(strm >> obj.inout ()))
00741     {
00742       return false;
00743     }
00744 
00745   typedef ::CORBA::Policy RHS_SCOPED_NAME;
00746 
00747   // Narrow to the right type.
00748   _tao_objref =
00749     TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
00750         obj.in (),
00751         CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
00752       );
00753 
00754   return 1;
00755 }
00756 
00757 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7