summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/Smart_Pointers/Gadget.cpp16
-rw-r--r--examples/Smart_Pointers/Gadget.h51
-rw-r--r--examples/Smart_Pointers/Gadget_Factory.cpp18
-rw-r--r--examples/Smart_Pointers/Gadget_Factory.h32
-rw-r--r--examples/Smart_Pointers/Gadget_Impl.cpp47
-rw-r--r--examples/Smart_Pointers/Gadget_Impl.h51
-rw-r--r--examples/Smart_Pointers/Gadget_Part.cpp16
-rw-r--r--examples/Smart_Pointers/Gadget_Part.h43
-rw-r--r--examples/Smart_Pointers/Gadget_Part_Factory.cpp20
-rw-r--r--examples/Smart_Pointers/Gadget_Part_Factory.h35
-rw-r--r--examples/Smart_Pointers/Gadget_Part_Impl.cpp68
-rw-r--r--examples/Smart_Pointers/Gadget_Part_Impl.h64
-rw-r--r--examples/Smart_Pointers/Makefile619
-rw-r--r--examples/Smart_Pointers/Makefile.bor7
-rw-r--r--examples/Smart_Pointers/README29
-rw-r--r--examples/Smart_Pointers/Widget.cpp16
-rw-r--r--examples/Smart_Pointers/Widget.h40
-rw-r--r--examples/Smart_Pointers/Widget_Factory.cpp18
-rw-r--r--examples/Smart_Pointers/Widget_Factory.h30
-rw-r--r--examples/Smart_Pointers/Widget_Impl.cpp52
-rw-r--r--examples/Smart_Pointers/Widget_Impl.h64
-rw-r--r--examples/Smart_Pointers/Widget_Part.cpp16
-rw-r--r--examples/Smart_Pointers/Widget_Part.h33
-rw-r--r--examples/Smart_Pointers/Widget_Part_Factory.cpp20
-rw-r--r--examples/Smart_Pointers/Widget_Part_Factory.h31
-rw-r--r--examples/Smart_Pointers/Widget_Part_Impl.cpp73
-rw-r--r--examples/Smart_Pointers/Widget_Part_Impl.h49
-rw-r--r--examples/Smart_Pointers/gadget_test.bor22
-rw-r--r--examples/Smart_Pointers/gadget_test.cpp72
-rw-r--r--examples/Smart_Pointers/widget_test.bor22
-rw-r--r--examples/Smart_Pointers/widget_test.cpp77
31 files changed, 1751 insertions, 0 deletions
diff --git a/examples/Smart_Pointers/Gadget.cpp b/examples/Smart_Pointers/Gadget.cpp
new file mode 100644
index 00000000000..180fe0107cc
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget.cpp
@@ -0,0 +1,16 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget.h"
+
+Gadget::~Gadget (void)
+{
+}
diff --git a/examples/Smart_Pointers/Gadget.h b/examples/Smart_Pointers/Gadget.h
new file mode 100644
index 00000000000..65b1fb0a34e
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_H
+#define GADGET_H
+
+#include "ace/Bound_Ptr.h"
+#include "Gadget_Part.h"
+
+/**
+ * @class Gadget
+ *
+ * @brief An interface for some high-level application object.
+ */
+class Gadget
+{
+public:
+ /// Destructor.
+ virtual ~Gadget (void);
+
+ /// Add a new part to the gadget. The gadget automatically takes shared
+ /// responsibility for the ownership of the part object since we are passing
+ /// a Gadget_Part_var.
+ virtual void add_part (Gadget_Part_var part) = 0;
+
+ /// Remove a random part from the gadget. Responsibility for ownership of the
+ /// part is automatically returned to the caller since we are returning a
+ /// Gadget_Part_var.
+ virtual Gadget_Part_var remove_part (void) = 0;
+
+ /// Ask the gadget to print information about the parts that it contains.
+ virtual void list_parts (void) = 0;
+};
+
+// The Gadget_var smart pointer has shared (reference counted) ownership
+// semantics.
+typedef ACE_Strong_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX> Gadget_var;
+
+// The Gadget_ptr smart pointer has no ownership semantics, but supports
+// conversion back into a Gadget_var.
+typedef ACE_Weak_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX> Gadget_ptr;
+
+#endif /* GADGET_H */
diff --git a/examples/Smart_Pointers/Gadget_Factory.cpp b/examples/Smart_Pointers/Gadget_Factory.cpp
new file mode 100644
index 00000000000..054237169f2
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Factory.cpp
@@ -0,0 +1,18 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Factory.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget_Factory.h"
+#include "Gadget_Impl.h"
+
+Gadget_var Gadget_Factory::create_gadget (void)
+{
+ return Gadget_var (new Gadget_Impl);
+}
diff --git a/examples/Smart_Pointers/Gadget_Factory.h b/examples/Smart_Pointers/Gadget_Factory.h
new file mode 100644
index 00000000000..dd3c17e7975
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Factory.h
@@ -0,0 +1,32 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Factory.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_FACTORY_H
+#define GADGET_FACTORY_H
+
+#include "Gadget.h"
+
+/**
+ * @class Gadget_Factory
+ *
+ * @brief Used to create Gadget instances.
+ */
+class Gadget_Factory
+{
+public:
+ /// Create an instance of a gadget. Ownership of the object is automatically
+ /// transferred to the caller since we return a Gadget_var. This also means
+ /// that the object will be deleted automatically if the caller "forgets" to
+ /// collect the return value.
+ static Gadget_var create_gadget (void);
+};
+
+#endif /* GADGET_FACTORY_H */
diff --git a/examples/Smart_Pointers/Gadget_Impl.cpp b/examples/Smart_Pointers/Gadget_Impl.cpp
new file mode 100644
index 00000000000..03dd94f8838
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Impl.cpp
@@ -0,0 +1,47 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Impl.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget_Impl.h"
+#include "ace/Log_Msg.h"
+
+Gadget_Impl::Gadget_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Gadget_Impl constructor\n"));
+}
+
+Gadget_Impl::~Gadget_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Gadget_Impl destructor\n"));
+}
+
+void Gadget_Impl::add_part (Gadget_Part_var part)
+{
+ parts_.enqueue_tail (part);
+}
+
+Gadget_Part_var Gadget_Impl::remove_part (void)
+{
+ Gadget_Part_var removed_part;
+ if (parts_.dequeue_head (removed_part) == -1)
+ return Gadget_Part_var();
+ return removed_part;
+}
+
+void Gadget_Impl::list_parts (void)
+{
+ ACE_Unbounded_Queue_Iterator<Gadget_Part_var> iter (parts_);
+ Gadget_Part_var *current_part;
+ while (iter.next (current_part))
+ {
+ (*current_part)->print_info ();
+ iter.advance ();
+ }
+}
diff --git a/examples/Smart_Pointers/Gadget_Impl.h b/examples/Smart_Pointers/Gadget_Impl.h
new file mode 100644
index 00000000000..ed4faf27ca4
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Impl.h
@@ -0,0 +1,51 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Impl.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_IMPL_H
+#define GADGET_IMPL_H
+
+#include "ace/Unbounded_Queue.h"
+#include "Gadget.h"
+#include "Gadget_Part.h"
+
+/**
+ * @class Gadget_Impl
+ *
+ * @brief An implementation of the Gadget interface.
+ */
+class Gadget_Impl : public Gadget
+{
+public:
+ /// Constructor.
+ Gadget_Impl (void);
+
+ /// Destructor.
+ virtual ~Gadget_Impl (void);
+
+ /// Add a new part to the gadget. The gadget takes ownership of the part
+ /// object.
+ virtual void add_part (Gadget_Part_var part);
+
+ /// Remove a random part from the gadget. Ownership of the part is returned
+ /// to the caller.
+ virtual Gadget_Part_var remove_part (void);
+
+ /// Ask the gadget to print information about the parts that it contains.
+ virtual void list_parts (void);
+
+private:
+ /// The parts which make up this gadget. The set actually contains instances
+ /// of Gadget_Part_var to automatically manage the lifetimes of the
+ /// constituent parts.
+ ACE_Unbounded_Queue<Gadget_Part_var> parts_;
+};
+
+#endif /* GADGET_IMPL_H */
diff --git a/examples/Smart_Pointers/Gadget_Part.cpp b/examples/Smart_Pointers/Gadget_Part.cpp
new file mode 100644
index 00000000000..9f08f2a61e7
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part.cpp
@@ -0,0 +1,16 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget_Part.h"
+
+Gadget_Part::~Gadget_Part (void)
+{
+}
diff --git a/examples/Smart_Pointers/Gadget_Part.h b/examples/Smart_Pointers/Gadget_Part.h
new file mode 100644
index 00000000000..bc78c49666f
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part.h
@@ -0,0 +1,43 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_PART_H
+#define GADGET_PART_H
+
+#include "ace/Bound_Ptr.h"
+
+/**
+ * @class Gadget_Part
+ *
+ * @brief An interface for some high-level application object.
+ */
+class Gadget_Part
+{
+public:
+ /// Destructor.
+ virtual ~Gadget_Part (void);
+
+ /// Ask the part to print information about itself.
+ virtual void print_info (void) = 0;
+
+ /// Ask the part to remove itself from the gadget that contains it.
+ virtual void remove_from_owner (void) = 0;
+};
+
+// The Gadget_Part_var smart pointer has shared (reference counted) ownership
+// semantics.
+typedef ACE_Strong_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_var;
+
+// The Gadget_Part_ptr smart pointer has no ownership semantics, but supports
+// conversion back into a Gadget_var.
+typedef ACE_Weak_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX> Gadget_Part_ptr;
+
+#endif /* GADGET_PART_H */
diff --git a/examples/Smart_Pointers/Gadget_Part_Factory.cpp b/examples/Smart_Pointers/Gadget_Part_Factory.cpp
new file mode 100644
index 00000000000..caf546fffce
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part_Factory.cpp
@@ -0,0 +1,20 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part_Factory.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget_Part_Factory.h"
+#include "Gadget_Part_Impl.h"
+
+Gadget_Part_var Gadget_Part_Factory::create_gadget_part (Gadget_ptr owner,
+ const char* name,
+ int size)
+{
+ return Gadget_Part_var (new Gadget_Part_Impl (owner, name, size));
+}
diff --git a/examples/Smart_Pointers/Gadget_Part_Factory.h b/examples/Smart_Pointers/Gadget_Part_Factory.h
new file mode 100644
index 00000000000..a7bc5cb38bd
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part_Factory.h
@@ -0,0 +1,35 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part_Factory.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_PART_FACTORY_H
+#define GADGET_PART_FACTORY_H
+
+#include "Gadget_Part.h"
+#include "Gadget.h"
+
+/**
+ * @class Gadget_Part_Factory
+ *
+ * @brief Used to create Gadget_Part instances.
+ */
+class Gadget_Part_Factory
+{
+public:
+ /// Create an instance of a gadget. Ownership of the object is automatically
+ /// transferred to the caller since we return a Gadget_Part_var. This also
+ /// means that the object will be deleted automatically if the caller
+ /// "forgets" to collect the return value.
+ static Gadget_Part_var create_gadget_part (Gadget_ptr owner,
+ const char *name,
+ int size);
+};
+
+#endif /* GADGET_PART_FACTORY_H */
diff --git a/examples/Smart_Pointers/Gadget_Part_Impl.cpp b/examples/Smart_Pointers/Gadget_Part_Impl.cpp
new file mode 100644
index 00000000000..aeda00711bb
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part_Impl.cpp
@@ -0,0 +1,68 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part_Impl.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Gadget_Part_Impl.h"
+#include "ace/ACE.h"
+#include "ace/Log_Msg.h"
+#include "ace/Unbounded_Queue.h"
+
+Gadget_Part_Impl::Gadget_Part_Impl (Gadget_ptr owner,
+ const char* name,
+ int size)
+ : owner_ (owner),
+ name_ (ACE::strnew (name)),
+ size_ (size)
+{
+ ACE_DEBUG ((LM_DEBUG, "Gadget_Part_Impl constructor\n"));
+}
+
+Gadget_Part_Impl::~Gadget_Part_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Gadget_Part_Impl destructor\n"));
+
+ delete [] name_;
+}
+
+void Gadget_Part_Impl::print_info (void)
+{
+ ACE_DEBUG ((LM_INFO, "Gadget part: name=%s size=%d\n", name_, size_));
+}
+
+void Gadget_Part_Impl::remove_from_owner (void)
+{
+ // Need to guarantee the existence of the owner for the duration of this call.
+ Gadget_var owner = owner_;
+
+ // Weak pointers are automatically set to NULL if the object they refer to
+ // is deleted. We can use this fact to check that our owner still exists.
+ if (owner == 0)
+ return;
+
+ // Take all existing parts from the owner and build up a temporary list. If
+ // we find ourselves then we won't add ourselves to the list.
+ ACE_Unbounded_Queue<Gadget_Part_var> parts;
+ for (;;)
+ {
+ Gadget_Part_var part = owner->remove_part ();
+ if (part == 0)
+ break;
+ if (part != this)
+ parts.enqueue_tail (part);
+ }
+
+ // Add the remaining parts back to the gadget.
+ while (!parts.is_empty ())
+ {
+ Gadget_Part_var part;
+ parts.dequeue_head (part);
+ owner->add_part (part);
+ }
+}
diff --git a/examples/Smart_Pointers/Gadget_Part_Impl.h b/examples/Smart_Pointers/Gadget_Part_Impl.h
new file mode 100644
index 00000000000..bcacb84f0c9
--- /dev/null
+++ b/examples/Smart_Pointers/Gadget_Part_Impl.h
@@ -0,0 +1,64 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Gadget_Part_Impl.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef GADGET_PART_IMPL_H
+#define GADGET_PART_IMPL_H
+
+#include "Gadget_Part.h"
+#include "Gadget.h"
+
+/**
+ * @class Gadget_Part_Impl
+ *
+ * @brief An implementation of the Gadget_Part interface.
+ */
+class Gadget_Part_Impl : public Gadget_Part
+{
+public:
+ /// Constructor.
+ Gadget_Part_Impl (Gadget_ptr owner, const char* name, int size);
+
+ /// Destructor.
+ virtual ~Gadget_Part_Impl (void);
+
+ /// Ask the part to print information about itself.
+ virtual void print_info (void);
+
+ /// Ask the part to remove itself from the gadget that contains it.
+ virtual void remove_from_owner (void);
+
+private:
+ /// The gadget that contains this part.
+ ///
+ /// Some things to note about the choice of ACE_Weak_Bound_Ptr (from the
+ /// typedef for Gadget_ptr):
+ /// - We cannot use an ACE_Strong_Bound_Ptr (Gadget_var) since that would
+ /// result in circular ownership.
+ /// - If we use a raw pointer we have no circular ownership problems, but we
+ /// are unable to guarantee the lifetime of the owner object for the
+ /// duration of the remove_from_owner call. This may not be a problem in
+ /// this limited example, but in multithreaded programs remove_from_owner
+ /// may be called from a different thread to the thread which manages the
+ /// owner's lifetime.
+ /// - ACE_Weak_Bound_Ptr (Gadget_ptr) has no ownership semantics, so we have
+ /// no circular ownership problems. Weak pointers can also be converted
+ /// back into strong ones, so it is possible to guarantee the lifetime of
+ /// the owner object for the duration of the remove_from_owner call.
+ Gadget_ptr owner_;
+
+ /// The name of this part.
+ char *name_;
+
+ /// The size of this part.
+ int size_;
+};
+
+#endif /* GADGET_PART_IMPL_H */
diff --git a/examples/Smart_Pointers/Makefile b/examples/Smart_Pointers/Makefile
new file mode 100644
index 00000000000..c77485764c7
--- /dev/null
+++ b/examples/Smart_Pointers/Makefile
@@ -0,0 +1,619 @@
+#----------------------------------------------------------------------------
+# $Id$
+#
+# Makefile for the Smart_Pointers examples.
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# Local macros
+#----------------------------------------------------------------------------
+
+BIN = widget_test gadget_test
+
+WIDGET_SRC = Widget \
+ Widget_Factory \
+ Widget_Impl \
+ Widget_Part \
+ Widget_Part_Factory \
+ Widget_Part_Impl \
+ widget_test
+
+WIDGET_OBJ = $(addsuffix .o,$(WIDGET_SRC))
+
+GADGET_SRC = Gadget \
+ Gadget_Factory \
+ Gadget_Impl \
+ Gadget_Part \
+ Gadget_Part_Factory \
+ Gadget_Part_Impl \
+ gadget_test
+
+GADGET_OBJ = $(addsuffix .o,$(GADGET_SRC))
+
+LSRC = $(addsuffix .cpp,$(WIDGET_SRC)) \
+ $(addsuffix .cpp,$(WIDGET_SRC))
+
+BUILD = $(BIN)
+VLDLIBS = $(LDLIBS:%=%$(VAR))
+VBIN = $(BIN:%=%$(VAR))
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
+
+#----------------------------------------------------------------------------
+# Local targets
+#----------------------------------------------------------------------------
+
+widget_test: $(addprefix $(VDIR),$(WIDGET_OBJ))
+ $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS)
+
+gadget_test: $(addprefix $(VDIR),$(GADGET_OBJ))
+ $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS)
+
+#----------------------------------------------------------------------------
+# Dependencies
+#----------------------------------------------------------------------------
+
+# DO NOT DELETE THIS LINE -- g++dep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+
+.obj/Widget.o .obj/Widget.so .shobj/Widget.o .shobj/Widget.so: Widget.cpp Widget.h Widget_Part.h
+
+.obj/Widget_Factory.o .obj/Widget_Factory.so .shobj/Widget_Factory.o .shobj/Widget_Factory.so: Widget_Factory.cpp Widget_Factory.h Widget.h \
+ Widget_Part.h Widget_Impl.h \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp
+
+.obj/Widget_Impl.o .obj/Widget_Impl.so .shobj/Widget_Impl.o .shobj/Widget_Impl.so: Widget_Impl.cpp Widget_Impl.h \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp Widget.h Widget_Part.h
+
+.obj/Widget_Part.o .obj/Widget_Part.so .shobj/Widget_Part.o .shobj/Widget_Part.so: Widget_Part.cpp Widget_Part.h
+
+.obj/Widget_Part_Factory.o .obj/Widget_Part_Factory.so .shobj/Widget_Part_Factory.o .shobj/Widget_Part_Factory.so: Widget_Part_Factory.cpp Widget_Part_Factory.h \
+ Widget_Part.h Widget.h Widget_Part_Impl.h
+
+.obj/Widget_Part_Impl.o .obj/Widget_Part_Impl.so .shobj/Widget_Part_Impl.o .shobj/Widget_Part_Impl.so: Widget_Part_Impl.cpp Widget_Part_Impl.h \
+ Widget_Part.h Widget.h $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/pre.h $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h
+
+.obj/widget_test.o .obj/widget_test.so .shobj/widget_test.o .shobj/widget_test.so: widget_test.cpp $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h Widget.h Widget_Part.h \
+ Widget_Factory.h Widget_Part_Factory.h
+
+.obj/Widget.o .obj/Widget.so .shobj/Widget.o .shobj/Widget.so: Widget.cpp Widget.h Widget_Part.h
+
+.obj/Widget_Factory.o .obj/Widget_Factory.so .shobj/Widget_Factory.o .shobj/Widget_Factory.so: Widget_Factory.cpp Widget_Factory.h Widget.h \
+ Widget_Part.h Widget_Impl.h \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp
+
+.obj/Widget_Impl.o .obj/Widget_Impl.so .shobj/Widget_Impl.o .shobj/Widget_Impl.so: Widget_Impl.cpp Widget_Impl.h \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp Widget.h Widget_Part.h
+
+.obj/Widget_Part.o .obj/Widget_Part.so .shobj/Widget_Part.o .shobj/Widget_Part.so: Widget_Part.cpp Widget_Part.h
+
+.obj/Widget_Part_Factory.o .obj/Widget_Part_Factory.so .shobj/Widget_Part_Factory.o .shobj/Widget_Part_Factory.so: Widget_Part_Factory.cpp Widget_Part_Factory.h \
+ Widget_Part.h Widget.h Widget_Part_Impl.h
+
+.obj/Widget_Part_Impl.o .obj/Widget_Part_Impl.so .shobj/Widget_Part_Impl.o .shobj/Widget_Part_Impl.so: Widget_Part_Impl.cpp Widget_Part_Impl.h \
+ Widget_Part.h Widget.h $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/pre.h $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h
+
+.obj/widget_test.o .obj/widget_test.so .shobj/widget_test.o .shobj/widget_test.so: widget_test.cpp $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/pre.h \
+ $(ACE_ROOT)/ace/post.h \
+ $(ACE_ROOT)/ace/ACE_export.h \
+ $(ACE_ROOT)/ace/svc_export.h \
+ $(ACE_ROOT)/ace/ace_wchar.h \
+ $(ACE_ROOT)/ace/ace_wchar.inl \
+ $(ACE_ROOT)/ace/OS_Errno.h \
+ $(ACE_ROOT)/ace/OS_Export.h \
+ $(ACE_ROOT)/ace/OS_Errno.inl \
+ $(ACE_ROOT)/ace/OS_Dirent.h \
+ $(ACE_ROOT)/ace/OS_Dirent.inl \
+ $(ACE_ROOT)/ace/OS_String.h \
+ $(ACE_ROOT)/ace/OS_String.inl \
+ $(ACE_ROOT)/ace/OS_Memory.h \
+ $(ACE_ROOT)/ace/OS_Memory.inl \
+ $(ACE_ROOT)/ace/OS_TLI.h \
+ $(ACE_ROOT)/ace/OS_TLI.inl \
+ $(ACE_ROOT)/ace/Min_Max.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Auto_Ptr.cpp \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.h \
+ $(ACE_ROOT)/ace/Refcounted_Auto_Ptr.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/Flag_Manip.h \
+ $(ACE_ROOT)/ace/Flag_Manip.i \
+ $(ACE_ROOT)/ace/Handle_Ops.h \
+ $(ACE_ROOT)/ace/Handle_Ops.i \
+ $(ACE_ROOT)/ace/Lib_Find.h \
+ $(ACE_ROOT)/ace/Lib_Find.i \
+ $(ACE_ROOT)/ace/Init_ACE.h \
+ $(ACE_ROOT)/ace/Init_ACE.i \
+ $(ACE_ROOT)/ace/Sock_Connect.h \
+ $(ACE_ROOT)/ace/Sock_Connect.i \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread_Adapter.h \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \
+ $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \
+ $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread_Adapter.inl \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/Unbounded_Queue.h \
+ $(ACE_ROOT)/ace/Node.h \
+ $(ACE_ROOT)/ace/Node.cpp \
+ $(ACE_ROOT)/ace/Unbounded_Queue.inl \
+ $(ACE_ROOT)/ace/Unbounded_Queue.cpp \
+ $(ACE_ROOT)/ace/Malloc_Base.h Widget.h Widget_Part.h \
+ Widget_Factory.h Widget_Part_Factory.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/examples/Smart_Pointers/Makefile.bor b/examples/Smart_Pointers/Makefile.bor
new file mode 100644
index 00000000000..d24ce76163e
--- /dev/null
+++ b/examples/Smart_Pointers/Makefile.bor
@@ -0,0 +1,7 @@
+#
+# Makefile for building the Smart_Pointers examples
+#
+
+MAKEFILES = widget_test.bor gadget_test.bor
+
+!include <$(ACE_ROOT)\include\makeinclude\recurse.bor>
diff --git a/examples/Smart_Pointers/README b/examples/Smart_Pointers/README
new file mode 100644
index 00000000000..a23ea1eb828
--- /dev/null
+++ b/examples/Smart_Pointers/README
@@ -0,0 +1,29 @@
+$Id$
+
+Smart Pointers Example
+----------------------
+
+This example shows the use of the various smart pointer classes
+available in ACE.
+
+There are two programs in this example. Each program implements a
+similar set of classes, but with a different style of using smart
+pointers.
+
+The Widget example is written such that objects may only pass raw
+pointers between them, and use smart pointers to manage the object
+lifetimes. An advantage of this style is the fine-grained control
+over the type of smart pointer used in each situation. For example,
+if you know that in a particular section of code there is no
+concurrency involved, you can strategise ACE_Refcounted_Auto_Ptr on
+ACE_Null_Mutex to eliminate locking overhead. Disadvantages of this
+style include greater programming complexity and certain ownership
+use cases not being easily supported.
+
+The Gadget example is written such that objects are always passed
+around using one of the ACE_Strong_Bound_Ptr/ACE_Weak_Bound_Ptr
+pair of smart pointers. The advantage of this style is the
+reduction in complexity of object lifetime management (almost as
+"good" as Java ;-) The disadvantage is that you pay a cost for the
+reference counting and locking overhead even in situations where it
+may not be strictly necessary.
diff --git a/examples/Smart_Pointers/Widget.cpp b/examples/Smart_Pointers/Widget.cpp
new file mode 100644
index 00000000000..28d01b54461
--- /dev/null
+++ b/examples/Smart_Pointers/Widget.cpp
@@ -0,0 +1,16 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget.h"
+
+Widget::~Widget (void)
+{
+}
diff --git a/examples/Smart_Pointers/Widget.h b/examples/Smart_Pointers/Widget.h
new file mode 100644
index 00000000000..a38245ca999
--- /dev/null
+++ b/examples/Smart_Pointers/Widget.h
@@ -0,0 +1,40 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include "Widget_Part.h"
+
+/**
+ * @class Widget
+ *
+ * @brief An interface for some high-level application object.
+ */
+class Widget
+{
+public:
+ /// Destructor.
+ virtual ~Widget (void);
+
+ /// Add a new part to the widget. The widget takes ownership of the part
+ /// object.
+ virtual void add_part (Widget_Part *part) = 0;
+
+ /// Remove a random part from the widget. Ownership of the part is returned
+ /// to the caller.
+ virtual Widget_Part *remove_part (void) = 0;
+
+ /// Ask the widget to print information about the parts that it contains.
+ virtual void list_parts (void) = 0;
+};
+
+#endif /* WIDGET_H */
diff --git a/examples/Smart_Pointers/Widget_Factory.cpp b/examples/Smart_Pointers/Widget_Factory.cpp
new file mode 100644
index 00000000000..18fec0c23f4
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Factory.cpp
@@ -0,0 +1,18 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Factory.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget_Factory.h"
+#include "Widget_Impl.h"
+
+Widget *Widget_Factory::create_widget (void)
+{
+ return new Widget_Impl;
+}
diff --git a/examples/Smart_Pointers/Widget_Factory.h b/examples/Smart_Pointers/Widget_Factory.h
new file mode 100644
index 00000000000..adf0613a3fe
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Factory.h
@@ -0,0 +1,30 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Factory.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_FACTORY_H
+#define WIDGET_FACTORY_H
+
+#include "Widget.h"
+
+/**
+ * @class Widget_Factory
+ *
+ * @brief Used to create Widget instances.
+ */
+class Widget_Factory
+{
+public:
+ /// Create an instance of a widget. Ownership of the newly created object is
+ /// transferred to the caller.
+ static Widget *create_widget (void);
+};
+
+#endif /* WIDGET_FACTORY_H */
diff --git a/examples/Smart_Pointers/Widget_Impl.cpp b/examples/Smart_Pointers/Widget_Impl.cpp
new file mode 100644
index 00000000000..2d3ab404804
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Impl.cpp
@@ -0,0 +1,52 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Impl.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget_Impl.h"
+#include "ace/Log_Msg.h"
+
+Widget_Impl::Widget_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Widget_Impl constructor\n"));
+}
+
+Widget_Impl::~Widget_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Widget_Impl destructor\n"));
+}
+
+void Widget_Impl::add_part (Widget_Part *part)
+{
+ // Take ownership of the part object using a ACE_Refcounted_Auto_Ptr.
+ ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> new_part (part);
+
+ parts_.enqueue_tail (new_part);
+}
+
+Widget_Part *Widget_Impl::remove_part (void)
+{
+ ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> removed_part;
+ if (parts_.dequeue_head (removed_part) == -1)
+ return 0;
+
+ // Ownership of the part object is released and transferred to the caller.
+ return removed_part.release();
+}
+
+void Widget_Impl::list_parts (void)
+{
+ ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> > iter (parts_);
+ ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> *current_part;
+ while (iter.next (current_part))
+ {
+ (*current_part)->print_info ();
+ iter.advance ();
+ }
+}
diff --git a/examples/Smart_Pointers/Widget_Impl.h b/examples/Smart_Pointers/Widget_Impl.h
new file mode 100644
index 00000000000..a31fff3d224
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Impl.h
@@ -0,0 +1,64 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Impl.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_IMPL_H
+#define WIDGET_IMPL_H
+
+#include "ace/Unbounded_Queue.h"
+#include "ace/Refcounted_Auto_Ptr.h"
+#include "Widget.h"
+#include "Widget_Part.h"
+
+/**
+ * @class Widget_Impl
+ *
+ * @brief An implementation of the Widget interface.
+ */
+class Widget_Impl : public Widget
+{
+public:
+ /// Constructor.
+ Widget_Impl (void);
+
+ /// Destructor.
+ virtual ~Widget_Impl (void);
+
+ /// Add a new part to the widget. The widget takes ownership of the part
+ /// object.
+ virtual void add_part (Widget_Part *part);
+
+ /// Remove a random part from the widget. Ownership of the part is returned
+ /// to the caller.
+ virtual Widget_Part *remove_part (void);
+
+ /// Ask the widget to print information about the parts that it contains.
+ virtual void list_parts (void);
+
+private:
+ /// The parts which make up this widget. The set actually contains instances
+ /// of ACE_Refcounted_Auto_Ptr to automatically manage the lifetimes of the
+ /// constituent parts.
+ ///
+ /// Some things to note about the choice of ACE_Refcounted_Auto_Ptr:
+ /// - We cannot use auto_ptr to manage the objects, since auto_ptr does not
+ /// support the copying and assignment semantics necessary for storage in
+ /// a container.
+ /// - The ACE_Strong_Bound_Ptr reference counted pointer could be used to
+ /// store objects in a container, however (for reasons of safety) it
+ /// provides no way to release ownership of the object from the smart
+ /// pointer. We need to be able to release ownership to implement the
+ /// remove_part method.
+ /// - ACE_Refcounted_Ptr can both be stored in containers and allows us to
+ /// release ownership of the pointer that it contains.
+ ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> > parts_;
+};
+
+#endif /* WIDGET_IMPL_H */
diff --git a/examples/Smart_Pointers/Widget_Part.cpp b/examples/Smart_Pointers/Widget_Part.cpp
new file mode 100644
index 00000000000..7a74447cff9
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part.cpp
@@ -0,0 +1,16 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget_Part.h"
+
+Widget_Part::~Widget_Part (void)
+{
+}
diff --git a/examples/Smart_Pointers/Widget_Part.h b/examples/Smart_Pointers/Widget_Part.h
new file mode 100644
index 00000000000..7e1f0b575a9
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part.h
@@ -0,0 +1,33 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_PART_H
+#define WIDGET_PART_H
+
+/**
+ * @class Widget_Part
+ *
+ * @brief An interface for some high-level application object.
+ */
+class Widget_Part
+{
+public:
+ /// Destructor.
+ virtual ~Widget_Part (void);
+
+ /// Ask the part to print information about itself.
+ virtual void print_info (void) = 0;
+
+ /// Ask the part to remove itself from the widget that contains it.
+ virtual void remove_from_owner (void) = 0;
+};
+
+#endif /* WIDGET_PART_H */
diff --git a/examples/Smart_Pointers/Widget_Part_Factory.cpp b/examples/Smart_Pointers/Widget_Part_Factory.cpp
new file mode 100644
index 00000000000..501cdbc745c
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part_Factory.cpp
@@ -0,0 +1,20 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part_Factory.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget_Part_Factory.h"
+#include "Widget_Part_Impl.h"
+
+Widget_Part *Widget_Part_Factory::create_widget_part (Widget *owner,
+ const char* name,
+ int size)
+{
+ return new Widget_Part_Impl (owner, name, size);
+}
diff --git a/examples/Smart_Pointers/Widget_Part_Factory.h b/examples/Smart_Pointers/Widget_Part_Factory.h
new file mode 100644
index 00000000000..4902ab91c40
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part_Factory.h
@@ -0,0 +1,31 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part_Factory.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_PART_FACTORY_H
+#define WIDGET_PART_FACTORY_H
+
+#include "Widget_Part.h"
+#include "Widget.h"
+
+/**
+ * @class Widget_Part_Factory
+ *
+ * @brief Used to create Widget_Part instances.
+ */
+class Widget_Part_Factory
+{
+public:
+ /// Create an instance of a widget part. Ownership of the newly created
+ /// object is transferred to the caller.
+ static Widget_Part *create_widget_part (Widget *owner, const char *name, int size);
+};
+
+#endif /* WIDGET_PART_FACTORY_H */
diff --git a/examples/Smart_Pointers/Widget_Part_Impl.cpp b/examples/Smart_Pointers/Widget_Part_Impl.cpp
new file mode 100644
index 00000000000..ffb42fe3a43
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part_Impl.cpp
@@ -0,0 +1,73 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part_Impl.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "Widget_Part_Impl.h"
+#include "ace/ACE.h"
+#include "ace/Log_Msg.h"
+#include "ace/Refcounted_Auto_Ptr.h"
+#include "ace/Unbounded_Queue.h"
+
+Widget_Part_Impl::Widget_Part_Impl (Widget *owner, const char* name, int size)
+ : owner_ (owner),
+ name_ (ACE::strnew (name)),
+ size_ (size)
+{
+ ACE_DEBUG ((LM_DEBUG, "Widget_Part_Impl constructor\n"));
+}
+
+Widget_Part_Impl::~Widget_Part_Impl (void)
+{
+ ACE_DEBUG ((LM_DEBUG, "Widget_Part_Impl destructor\n"));
+
+ delete [] name_;
+}
+
+void Widget_Part_Impl::print_info (void)
+{
+ ACE_DEBUG ((LM_INFO, "Widget part: name=%s size=%d\n", name_, size_));
+}
+
+void Widget_Part_Impl::remove_from_owner (void)
+{
+ // Since we only have a raw pointer to refer to the owner, we have no way of
+ // checking whether the owner still exists, and if it does guaranteeing that
+ // it will continue to exist for the duration of this call. This is not an
+ // issue in this limited example program, but in multithreaded applications
+ // this function may be called from a different thread to that managing the
+ // lifetime of the owner object. See the Gadget example for how
+ // ACE_Strong_Bound_Ptr/ACE_Weak_Bound_Ptr can be used to address the problem.
+
+ // Take all existing parts from the owner and build up a temporary queue. If
+ // we find ourselves then we won't add ourselves to the queue. We will
+ // actually store ACE_Refcounted_Auto_Ptr instances in the queue, and since we
+ // know that there is only one thread involved we can use ACE_Null_Mutex to
+ // eliminate the locking overhead.
+ ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> > parts;
+ for (;;)
+ {
+ ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> part (owner_->remove_part ());
+ if (part.null ())
+ break;
+ if (part.get () == this)
+ // Someone else will be responsible for our lifetime.
+ part.release();
+ else
+ parts.enqueue_tail (part);
+ }
+
+ // Add the remaining parts back to the gadget.
+ while (!parts.is_empty ())
+ {
+ ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> part;
+ parts.dequeue_head (part);
+ owner_->add_part (part.release ());
+ }
+}
diff --git a/examples/Smart_Pointers/Widget_Part_Impl.h b/examples/Smart_Pointers/Widget_Part_Impl.h
new file mode 100644
index 00000000000..dbb1d4c714c
--- /dev/null
+++ b/examples/Smart_Pointers/Widget_Part_Impl.h
@@ -0,0 +1,49 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Widget_Part_Impl.h
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#ifndef WIDGET_PART_IMPL_H
+#define WIDGET_PART_IMPL_H
+
+#include "Widget_Part.h"
+#include "Widget.h"
+
+/**
+ * @class Widget_Part_Impl
+ *
+ * @brief An implementation of the Widget_Part interface.
+ */
+class Widget_Part_Impl : public Widget_Part
+{
+public:
+ /// Constructor.
+ Widget_Part_Impl (Widget *owner, const char* name, int size);
+
+ /// Destructor.
+ virtual ~Widget_Part_Impl (void);
+
+ /// Ask the part to print information about itself.
+ virtual void print_info (void);
+
+ /// Ask the part to remove itself from the widget that contains it.
+ virtual void remove_from_owner (void);
+
+private:
+ /// The widget that contains this part.
+ Widget *owner_;
+
+ /// The name of this part.
+ char *name_;
+
+ /// The size of this part.
+ int size_;
+};
+
+#endif /* WIDGET_PART_IMPL_H */
diff --git a/examples/Smart_Pointers/gadget_test.bor b/examples/Smart_Pointers/gadget_test.bor
new file mode 100644
index 00000000000..c3aa4184b8a
--- /dev/null
+++ b/examples/Smart_Pointers/gadget_test.bor
@@ -0,0 +1,22 @@
+#
+# Makefile for building the Gadget example
+#
+
+NAME = gadget_test
+
+OBJFILES = \
+ $(OBJDIR)\Gadget.obj \
+ $(OBJDIR)\Gadget_Factory.obj \
+ $(OBJDIR)\Gadget_Impl.obj \
+ $(OBJDIR)\Gadget_Part.obj \
+ $(OBJDIR)\Gadget_Part_Factory.obj \
+ $(OBJDIR)\Gadget_Part_Impl.obj \
+ $(OBJDIR)\gadget_test.obj
+
+CFLAGS = $(ACE_CFLAGS)
+
+CPPDIR = .
+
+LIBFILES = $(ACE_LIB)
+
+!include <$(ACE_ROOT)\include\makeinclude\build_exe.bor>
diff --git a/examples/Smart_Pointers/gadget_test.cpp b/examples/Smart_Pointers/gadget_test.cpp
new file mode 100644
index 00000000000..95fd5d89b87
--- /dev/null
+++ b/examples/Smart_Pointers/gadget_test.cpp
@@ -0,0 +1,72 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file gadget_test.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "ace/OS.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Refcounted_Auto_Ptr.h"
+#include "ace/Unbounded_Queue.h"
+#include "Gadget.h"
+#include "Gadget_Factory.h"
+#include "Gadget_Part.h"
+#include "Gadget_Part_Factory.h"
+
+int main (int argc, char *argv[])
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+
+ Gadget_var g1 = Gadget_Factory::create_gadget ();
+ g1->add_part (Gadget_Part_Factory::create_gadget_part (g1, "part1", 1));
+ g1->add_part (Gadget_Part_Factory::create_gadget_part (g1, "part2", 2));
+ g1->add_part (Gadget_Part_Factory::create_gadget_part (g1, "part3", 3));
+
+ g1->list_parts ();
+
+ Gadget_Part_var p1 = g1->remove_part ();
+ p1->print_info ();
+
+ // Oops, we forgot to collect the return value! No worries, the temporary
+ // Gadget_var returned by the function call will clean it up automatically.
+ g1->remove_part ();
+
+ g1->list_parts ();
+
+ Gadget_var g2 = Gadget_Factory::create_gadget ();
+ g2->add_part (Gadget_Part_Factory::create_gadget_part (g2, "part4", 4));
+ Gadget_Part_var p2 = Gadget_Part_Factory::create_gadget_part (g2, "part5", 5);
+ g2->add_part (p2);
+ p2->remove_from_owner ();
+
+ g2->list_parts ();
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class ACE_Bound_Ptr_Counter<ACE_SYNCH_MUTEX>;
+template class ACE_Strong_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX>;
+template class ACE_Weak_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX>;
+template class ACE_Strong_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX>;
+template class ACE_Weak_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX>;
+template class ACE_Node<Gadget_Part_var>;
+template class ACE_Unbounded_Queue<Gadget_Part_var>;
+template class ACE_Unbounded_Queue_Iterator<Gadget_Part_var>;
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+#pragma instantiate ACE_Bound_Ptr_Counter<ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Strong_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Weak_Bound_Ptr<Gadget, ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Strong_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Weak_Bound_Ptr<Gadget_Part, ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Node<Gadget_Part_var>
+#pragma instantiate ACE_Unbounded_Queue<Gadget_Part_var>
+#pragma instantiate ACE_Unbounded_Queue_Iterator<Gadget_Part_var>
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+
diff --git a/examples/Smart_Pointers/widget_test.bor b/examples/Smart_Pointers/widget_test.bor
new file mode 100644
index 00000000000..4335f2cda73
--- /dev/null
+++ b/examples/Smart_Pointers/widget_test.bor
@@ -0,0 +1,22 @@
+#
+# Makefile for building the Widget example
+#
+
+NAME = widget_test
+
+OBJFILES = \
+ $(OBJDIR)\Widget.obj \
+ $(OBJDIR)\Widget_Factory.obj \
+ $(OBJDIR)\Widget_Impl.obj \
+ $(OBJDIR)\Widget_Part.obj \
+ $(OBJDIR)\Widget_Part_Factory.obj \
+ $(OBJDIR)\Widget_Part_Impl.obj \
+ $(OBJDIR)\widget_test.obj
+
+CFLAGS = $(ACE_CFLAGS)
+
+CPPDIR = .
+
+LIBFILES = $(ACE_LIB)
+
+!include <$(ACE_ROOT)\include\makeinclude\build_exe.bor>
diff --git a/examples/Smart_Pointers/widget_test.cpp b/examples/Smart_Pointers/widget_test.cpp
new file mode 100644
index 00000000000..d90692371ee
--- /dev/null
+++ b/examples/Smart_Pointers/widget_test.cpp
@@ -0,0 +1,77 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file widget_test.cpp
+ *
+ * $Id$
+ *
+ * @author Christopher Kohlhoff <chris@kohlhoff.com>
+ */
+//=============================================================================
+
+#include "ace/OS.h"
+#include "ace/Auto_Ptr.h"
+#include "ace/Refcounted_Auto_Ptr.h"
+#include "ace/Unbounded_Queue.h"
+#include "Widget.h"
+#include "Widget_Factory.h"
+#include "Widget_Part.h"
+#include "Widget_Part_Factory.h"
+
+int main (int argc, char *argv[])
+{
+ ACE_UNUSED_ARG (argc);
+ ACE_UNUSED_ARG (argv);
+
+ auto_ptr<Widget> w1 (Widget_Factory::create_widget ());
+ w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part1", 1));
+ w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part2", 2));
+ w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part3", 3));
+
+ w1->list_parts ();
+
+ auto_ptr<Widget_Part> p1 (w1->remove_part ());
+ p1->print_info ();
+ auto_ptr<Widget_Part> p2 (w1->remove_part ());
+
+ w1->list_parts ();
+
+ auto_ptr<Widget> w2 (Widget_Factory::create_widget ());
+ w2->add_part (Widget_Part_Factory::create_widget_part (w2.get(), "part4", 4));
+ Widget_Part *p3 = Widget_Part_Factory::create_widget_part (w2.get(), "part5", 5);
+ w2->add_part (p3);
+ p3->remove_from_owner ();
+
+ w2->list_parts ();
+
+ return 0;
+}
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+template class ACE_Auto_Basic_Ptr<Widget>;
+template class auto_ptr<Widget>;
+template class ACE_Auto_Basic_Ptr<Widget_Part>;
+template class auto_ptr<Widget_Part>;
+template class ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX>;
+template class ACE_Node<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >;
+template class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >;
+template class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >;
+template class ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex>;
+template class ACE_Node<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >;
+template class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >;
+template class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >;
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+#pragma instantiate ACE_Auto_Basic_Ptr<Widget>
+#pragma instantiate auto_ptr<Widget>
+#pragma instantiate ACE_Auto_Basic_Ptr<Widget_Part>
+#pragma instantiate auto_ptr<Widget_Part>
+#pragma instantiate ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX>
+#pragma instantiate ACE_Node<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >
+#pragma instantiate ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >
+#pragma instantiate ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_SYNCH_MUTEX> >
+#pragma instantiate ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex>
+#pragma instantiate ACE_Node<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >
+#pragma instantiate ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >
+#pragma instantiate ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<Widget_Part, ACE_Null_Mutex> >
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
+