summaryrefslogtreecommitdiff
path: root/TAO/tao/CurrentS.cpp
blob: faa403a31aa14b215c1b1cd22a34894e4dd2fe54 (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
/* -*- C++ -*- */
// $Id$
// ******  Code generated by the The ACE ORB (TAO) IDL Compiler *******
// TAO ORB and the TAO IDL Compiler have been developed by Washington
// University Computer Science's Distributed Object Computing Group.
//
// Information on TAO is available at
//                 http://www.cs.wustl.edu/~schmidt/TAO.html

#include "tao/CurrentC.h"
#include "tao/Operation_Table.h"
#include "tao/POA_CORBA.h"
#include "tao/Server_Request.h"
#include "tao/Environment.h"
#include "tao/Typecode.h"

ACE_RCSID(tao, CurrentS, "$Id$")

POA_CORBA::Current::Current (void)
{
}

// skeleton destructor
POA_CORBA::Current::~Current (void)
{
}

CORBA::Boolean POA_CORBA::Current::_is_a (
    const char* value,
    CORBA::Environment &_tao_environment
  )
{
  if (
    (!ACE_OS::strcmp ((char *)value, "IDL:CORBA/Current:1.0")) ||
    (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (_tao_environment))))
      return 1;
    else
      return 0;
}

void* POA_CORBA::Current::_downcast (
    const char* logical_type_id
  )
{
  if (ACE_OS::strcmp (logical_type_id, "IDL:CORBA/Current:1.0") == 0)
    return ACE_static_cast (POA_CORBA::Current_ptr, this);
  if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0)
    return ACE_static_cast(PortableServer::Servant, this);
  return 0;
}

void POA_CORBA::Current::_dispatch (CORBA::ServerRequest &req, void *context, CORBA::Environment &env)
{
  TAO_Skeleton skel; // pointer to skeleton for operation
  const char *opname = req.operation (); // retrieve operation name
  // find the skeleton corresponding to this opname
  if (this->_find (opname, skel) == -1)
  {
    env.exception (new CORBA_BAD_OPERATION ());
    ACE_ERROR ((LM_ERROR, "Bad operation <%s>\n", opname));
  }
else
    skel (req, this, context, env);
}

const char* POA_CORBA::Current::_interface_repository_id (void) const
{
  return "IDL:CORBA/Current:1.0";
}

POA_CORBA::_tao_collocated_Current::_tao_collocated_Current (
    POA_CORBA::Current_ptr  servant,
    TAO_Stub *stub
  )
  : CORBA_Current (stub, servant, 1),
    CORBA_Object (stub, servant, 1),
    servant_ (servant)
{
}

POA_CORBA::Current_ptr POA_CORBA::_tao_collocated_Current::_get_servant (void) const
{
  return this->servant_;
}

CORBA::Boolean POA_CORBA::_tao_collocated_Current::_is_a (
    const char* logical_type_id,
    CORBA::Environment &_tao_environment
  )
{
  return this->servant_->_is_a (
      logical_type_id,
      _tao_environment
    );
}


CORBA::Current*
POA_CORBA::Current::_this (CORBA_Environment &TAO_IN_ENV)
{
  TAO_Stub *stub = this->_create_stub (TAO_IN_ENV);
  if (TAO_IN_ENV.exception () != 0)
    return 0;
  return new POA_CORBA::_tao_collocated_Current (this, stub);
}