summaryrefslogtreecommitdiff
path: root/CIAO/connectors/dds4ccm/impl/LocalObject_T.h
blob: fb367ee4917a5301ab1523583301ae8fca45102e (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
// -*- C++ -*-
#ifndef DDS4CCM_LOCALOBJECT_T_H_
#define DDS4CCM_LOCALOBJECT_T_H_

#include "ace/Copy_Disabled.h"

namespace CIAO
{
  namespace DDS4CCM
  {
    /**
     * Helper template that allocates a new LOCAL_OBJECT from the heap and that
     * makes sure we call ::CORBA::release() at destruction
     */
    template <typename LOCAL_OBJECT>
    class LocalObject_Auto_Ptr_T : private ACE_Copy_Disabled
    {
    public:
      LocalObject_Auto_Ptr_T (void);

      ~LocalObject_Auto_Ptr_T (void);

      explicit LocalObject_Auto_Ptr_T (LOCAL_OBJECT* lobject);

      LOCAL_OBJECT* operator-> (void) const;

      operator LOCAL_OBJECT *& (void);
    private:
      LOCAL_OBJECT* l;
    };
  }
}

#include "dds4ccm/impl/LocalObject_T.cpp"

#endif /* DDS4CCM_LOCALOBJECT_T_H_ */