PolicyC.cpp

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

Generated on Sun Jan 27 13:07:35 2008 for TAO by doxygen 1.3.6