diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-30 18:54:31 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-30 18:54:31 +0000 |
commit | 3d8d2624d60970fbcc893ceb1ebb64881ec0d94a (patch) | |
tree | 68cab60c60cb7f32de95d2801747d0ebbceb1caa | |
parent | 3a5d2ac58197d37b91414fc0c35d461265b2c0bc (diff) | |
download | ATCD-3d8d2624d60970fbcc893ceb1ebb64881ec0d94a.tar.gz |
added DS library
-rw-r--r-- | modules/TAO/tao/DiffServPolicy/DiffServPolicy.cpp | 48 | ||||
-rw-r--r-- | modules/TAO/tao/DiffServPolicy/DiffServPolicy.h | 50 |
2 files changed, 98 insertions, 0 deletions
diff --git a/modules/TAO/tao/DiffServPolicy/DiffServPolicy.cpp b/modules/TAO/tao/DiffServPolicy/DiffServPolicy.cpp new file mode 100644 index 00000000000..f1d6b910529 --- /dev/null +++ b/modules/TAO/tao/DiffServPolicy/DiffServPolicy.cpp @@ -0,0 +1,48 @@ +// @(#) $Id$ + +#include "tao/DiffServPolicy/DiffServPolicy.h" +#include "tao/DiffServEndpointPolicy/DiffServPolicy_ORBInitializer.h" +#include "tao/ORB_Core.h" +#include "tao/ORBInitializer_Registry.h" +#include "tao/PI/PI.h" + +ACE_RCSID (DiffServPolicy, DiffServPolicy, "$Id$") + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +int +TAO_DiffServPolicy_Initializer::init (void) +{ + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + PortableInterceptor::ORBInitializer_var orb_initializer; + + try + { + /// Register the EndpointPolicy ORBInitializer. + ACE_NEW_THROW_EX (temp_orb_initializer, + TAO_DiffServPolicy_ORBInitializer, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO::VMCID, + ENOMEM), + CORBA::COMPLETED_NO)); + + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in () + ); + } + catch (const ::CORBA::Exception& ex) + { + if (TAO_debug_level > 0) + { + ex._tao_print_exception ("Caught exception:"); + } + return -1; + } + + return 0; +} + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/modules/TAO/tao/DiffServPolicy/DiffServPolicy.h b/modules/TAO/tao/DiffServPolicy/DiffServPolicy.h new file mode 100644 index 00000000000..788e567e1ad --- /dev/null +++ b/modules/TAO/tao/DiffServPolicy/DiffServPolicy.h @@ -0,0 +1,50 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file DiffServPolicy.h + * + * $Id$ + * + * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_DIFFSERVPOLICY_H +#define TAO_DIFFSERVPOLICY_H + +#include /**/ "ace/pre.h" + +#include "tao/DiffServPolicy/DiffServPolicy_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PI/PI.h" +#include "tao/Versioned_Namespace.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +class TAO_DiffServPolicy_Export TAO_DiffServPolicy_Initializer +{ +public: + /// Used to force the initialization of the ORB code. + static int init (void); +}; + +static int +TAO_Requires_DiffServPolicy_Initializer = + TAO_DiffServPolicy_Initializer::init (); + +TAO_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#define TAO_DIFFSERVPOLICY_SAFE_INCLUDE +#include "tao/DiffServPolicy/DiffServPolicyC.h" +#undef TAO_DIFFSERVPOLICY_SAFE_INCLUDE + +#endif /* TAO_DIFFSERVPOLICY_H */ |