2 #include "tao/Exception.h"
3 #include "tao/SystemException.h"
4 #include "tao/Environment.h"
5 #include "tao/ORB_Constants.h"
6 #include "tao/CORBA_String.h"
10 #include "ace/Malloc.h"
11 #include "ace/SString.h"
12 #include "ace/OS_NS_string.h"
15 #if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
16 // Needed for ostream& operator<< (ostream &os, const CORBA::Exception &e)
17 // FUZZ: disable check_for_streams_include
18 #include "ace/streams.h"
19 #endif /* (ACE_LACKS_IOSTREAM_TOTALLY) */
21 #if !defined (__ACE_INLINE__)
22 # include "tao/Exception.inl"
23 #endif /* __ACE_INLINE__ */
25 #include "ace/OS_NS_stdio.h"
27 // ****************************************************************
29 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
31 CORBA::Exception::Exception (const char * repository_id
,
32 const char * local_name
)
33 : id_ (CORBA::string_dup (repository_id
)),
34 name_ (CORBA::string_dup (local_name
))
38 CORBA::Exception::Exception (const CORBA::Exception
&src
)
39 : id_ (CORBA::string_dup (src
.id_
)),
40 name_ (CORBA::string_dup (src
.name_
))
44 // NOTE: It's this code, not anything defined in a subclass, which is
45 // responsible for releasing any storage owned by the exception. It
46 // can do this because it's got the local name and the id.
49 CORBA::Exception::operator= (const CORBA::Exception
&src
)
53 this->id_
= CORBA::string_dup (src
.id_
);
54 this->name_
= CORBA::string_dup (src
.name_
);
61 CORBA::Exception::_rep_id () const
63 return this->id_
.in ();
67 CORBA::Exception::_name () const
69 return this->name_
.in ();
73 CORBA::Exception::_tao_print_exception (const char *user_provided_info
,
76 TAOLIB_ERROR ((LM_ERROR
,
77 ACE_TEXT ("(%P|%t) EXCEPTION, %C\n")
80 this->_info ().c_str ()));
83 #if defined (ACE_USES_WCHAR)
85 CORBA::Exception::_tao_print_exception (const ACE_WCHAR_T
*info
,
88 // Even though this call causes additional type conversions, this is
89 // better for the maintenance. Plus, this will occur only on
91 this->_tao_print_exception (ACE_TEXT_ALWAYS_CHAR (info
), f
);
93 #endif // ACE_USES_WCHAR
96 CORBA::Exception::_tao_any_destructor (void *x
)
98 CORBA::Exception
*tmp
= static_cast<CORBA::Exception
*> (x
);
102 #if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
106 ACE_OSTREAM_TYPE
& operator<< (ACE_OSTREAM_TYPE
&os
,
107 const CORBA::Exception
&e
)
109 os
<< e
._name () << " (" << e
._rep_id () << ')';
114 ACE_OSTREAM_TYPE
& operator<< (ACE_OSTREAM_TYPE
&os
,
115 const CORBA::Exception
*e
)
117 os
<< e
->_name () << " (" << e
->_rep_id () << ')';
123 #endif /* (ACE_LACKS_IOSTREAM_TOTALLY) */
125 TAO_END_VERSIONED_NAMESPACE_DECL