summaryrefslogtreecommitdiff
path: root/TAO/tao/DynamicInterface/Unknown_User_Exception.cpp
blob: ab3d333e1cf634b43a31c0e331060201ef7f5062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// $Id$

#include "Unknown_User_Exception.h"

#include "tao/Any.h"
#include "tao/Environment.h"
#include "tao/TypeCode_Constants.h"
#include "tao/Null_RefCount_Policy.h"
#include "tao/TypeCode_Struct_Field.h"
#include "tao/Struct_TypeCode.h"
#include "tao/SystemException.h"

#include "ace/OS_NS_string.h"
#include "ace/OS_Memory.h"


ACE_RCSID (DynamicInterface,
           Unknown_User_Exception,
           "$Id$")


CORBA::UnknownUserException::UnknownUserException (void)
  : CORBA::UserException ("IDL:omg.org/CORBA/UnknownUserException:1.0",
                          "UnknownUserException"),
    exception_ (0)
{
}

CORBA::UnknownUserException::UnknownUserException (CORBA::Any &ex)
  : CORBA::UserException ("IDL:omg.org/CORBA/UnknownUserException:1.0",
                         "UnknownUserException")
{
  ACE_NEW (this->exception_,
           CORBA::Any (ex));
}

CORBA::UnknownUserException::UnknownUserException (
    const CORBA::UnknownUserException& e
  )
  : CORBA::UserException (e._rep_id (),
                         e._name ())
{
  ACE_NEW (this->exception_,
           CORBA::Any (*e.exception_));
}

CORBA::UnknownUserException::~UnknownUserException (void)
{
  delete this->exception_;
}

CORBA::Any &
CORBA::UnknownUserException::exception (void)
{
  return *this->exception_;
}

int
CORBA::UnknownUserException::_is_a (const char *interface_id) const
{
  return
    ((ACE_OS::strcmp (interface_id,
                      "IDL:omg.org/CORBA/UnknownUserException:1.0")
        == 0)
      || UserException::_is_a (interface_id));
}

CORBA::UnknownUserException *
CORBA::UnknownUserException::_downcast (CORBA::Exception *ex)
{
  return dynamic_cast<CORBA::UnknownUserException *> (ex);
}

CORBA::UnknownUserException const *
CORBA::UnknownUserException::_downcast (CORBA::Exception const * ex)
{
  return dynamic_cast<CORBA::UnknownUserException const *> (ex);
}

void
CORBA::UnknownUserException::_raise (void) const
{
  TAO_RAISE (*this);
}

CORBA::Exception *
CORBA::UnknownUserException::_tao_duplicate (void) const
{
  CORBA::Exception *result;
  ACE_NEW_RETURN (
      result,
      CORBA::UnknownUserException (*this),
      0
    );
  return result;
}

void
CORBA::UnknownUserException::_tao_encode (
    TAO_OutputCDR &
    ACE_ENV_ARG_DECL
  ) const
{
  ACE_THROW (CORBA::MARSHAL ());
}

void
CORBA::UnknownUserException::_tao_decode (TAO_InputCDR &
                                         ACE_ENV_ARG_DECL)
{
  ACE_THROW (CORBA::MARSHAL ());
}

CORBA::TypeCode_ptr
CORBA::UnknownUserException::_type (void) const
{
  return CORBA::_tc_UnknownUserException;
}

namespace TAO
{
  namespace TypeCode
  {
    Struct_Field<char const *> const fields_CORBA_UnknownUserException[] =
      {
        { "exception", &CORBA::_tc_any }
      };

    Struct<char const *,
           Struct_Field<char const *> const *,
           CORBA::tk_except,
           TAO::Null_RefCount_Policy> tc_UnknownUserException (
             "IDL:omg.org/CORBA/UnknownUserException:1.0",
             "UnknownUserException",
             TAO::TypeCode::fields_CORBA_UnknownUserException,
             1 /* # of fields */);
  }
}

namespace CORBA
{
  CORBA::TypeCode_ptr const _tc_UnknownUserException =
    &TAO::TypeCode::tc_UnknownUserException;
}