Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / Smart_Pointers / Gadget_Part.h
blob958fb039f6355e0bf0d3d795f0c770230e6f0ecc
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Gadget_Part.h
6 * @author Christopher Kohlhoff <chris@kohlhoff.com>
7 */
8 //=============================================================================
10 #ifndef GADGET_PART_H
11 #define GADGET_PART_H
13 #include "ace/Bound_Ptr.h"
14 #include "ace/Synch_Traits.h"
15 #include "ace/Thread_Mutex.h"
17 /**
18 * @class Gadget_Part
20 * @brief An interface for some high-level application object.
22 class Gadget_Part
24 public:
25 /// Destructor.
26 virtual ~Gadget_Part ();
28 /// Ask the part to print information about itself.
29 virtual void print_info () = 0;
31 /// Ask the part to remove itself from the gadget that contains it.
32 virtual void remove_from_owner () = 0;
35 // The Gadget_Part_var smart pointer has shared (reference counted) ownership
36 // semantics.
37 typedef ACE_Strong_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_var;
39 // The Gadget_Part_ptr smart pointer has no ownership semantics, but supports
40 // conversion back into a Gadget_var.
41 typedef ACE_Weak_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_ptr;
43 #endif /* GADGET_PART_H */