2 //=============================================================================
6 * @author Christopher Kohlhoff <chris@kohlhoff.com>
8 //=============================================================================
13 #include "ace/Bound_Ptr.h"
14 #include "Gadget_Part.h"
19 * @brief An interface for some high-level application object.
27 /// Add a new part to the gadget. The gadget automatically takes shared
28 /// responsibility for the ownership of the part object since we are passing
29 /// a Gadget_Part_var.
30 virtual void add_part (Gadget_Part_var part
) = 0;
32 /// Remove a random part from the gadget. Responsibility for ownership of the
33 /// part is automatically returned to the caller since we are returning a
35 virtual Gadget_Part_var
remove_part () = 0;
37 /// Ask the gadget to print information about the parts that it contains.
38 virtual void list_parts () = 0;
41 // The Gadget_var smart pointer has shared (reference counted) ownership
43 typedef ACE_Strong_Bound_Ptr
<Gadget
, ACE_SYNCH_MUTEX
> Gadget_var
;
45 // The Gadget_ptr smart pointer has no ownership semantics, but supports
46 // conversion back into a Gadget_var.
47 typedef ACE_Weak_Bound_Ptr
<Gadget
, ACE_SYNCH_MUTEX
> Gadget_ptr
;