Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Servant_var.h
blob76735a54e206755c57c65f8440babb932423757d
1 /**
2 * @file Servant_var.h
4 * @author Jody Hagins <jody@atdesk.com>
5 * @author Carlos O'Ryan <coryan@uci.edu>
6 */
7 #ifndef TAO_PERF_RTEC_SERVANT_VAR_H
8 #define TAO_PERF_RTEC_SERVANT_VAR_H
10 #include "tao/corba.h"
12 /**
13 * @class Servant_var
15 * @brief Implement a smart pointer class for Servants
17 * All servants, are reference counted objects.
18 * Unfortunately the specification lacks such an useful smart pointer
19 * class to manage their life-cycle.
21 template<class SERVANT>
22 class Servant_var
24 public:
25 /// Constructor
26 /**
27 * @param s The contained servant. The constructor assumes
28 * ownership.
30 explicit Servant_var (SERVANT *s = 0);
32 /// Copy constructor
33 Servant_var (const Servant_var<SERVANT> &rhs);
35 /// Assignment
36 Servant_var<SERVANT>& operator= (const Servant_var<SERVANT> &rhs);
38 /// Assignment
39 Servant_var<SERVANT>& operator= (SERVANT *s);
41 /// Destructor
42 ~Servant_var ();
44 /// Helper method to increase the reference count on a servant.
45 static SERVANT *duplicate (SERVANT *servart);
47 //@{
48 /** @name Smart pointer operations
50 const SERVANT * operator->() const;
51 SERVANT * operator->();
53 operator SERVANT *();
54 operator const SERVANT * () const;
55 //@}
57 //@{
58 /** @name Canonical CORBA T_var methods
60 SERVANT *in () const;
61 SERVANT *&out ();
62 SERVANT *&inout ();
63 //@}
65 private:
66 /// The owned object
67 SERVANT *ptr_;
70 #if defined(__ACE_INLINE__)
71 #include "Servant_var.inl"
72 #endif /* __ACE_INLINE__ */
74 #include "Servant_var.cpp"
76 #endif /* TAO_PERF_RTEC_SERVANT_VAR_H */