summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/activate_with_id.h
blob: be09a2870a5b910b56fa037d2d873f425603c4a5 (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
// -*- C++ -*-
//=============================================================================
/**
 *  @file   activate_with_id.h
 *
 *  $Id$
 *
 *  @author Huang-Ming Huang <hh1@cse.wustl.edu>
 */
//=============================================================================
#ifndef ACTIVATE_WITH_ID_H
#define ACTIVATE_WITH_ID_H

template<class T>
void
activate_object_with_id (T * &result,
                         PortableServer::POA_ptr poa,
                         PortableServer::ServantBase *servant,
                         const FtRtecEventComm::ObjectId &oid
                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
{
  const PortableServer::ObjectId& id = reinterpret_cast<const PortableServer::ObjectId&> (oid);
  poa->activate_object_with_id(id,
    servant ACE_ENV_ARG_PARAMETER);

  ACE_CHECK;

  CORBA::Object_var object = poa->
    id_to_reference(id ACE_ENV_ARG_PARAMETER);
  ACE_CHECK;

  result = T::_narrow(object.in() ACE_ENV_ARG_PARAMETER);
}
#endif