diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
commit | 3df4acfa816441fc28a95dee6d0191a927145d95 (patch) | |
tree | b5ae7ca44662cfd8e5c95f1826e4406021a606f5 /examples/Smart_Pointers/Widget_Impl.cpp | |
parent | 60a5612b83d856fc0adc52b9f39fac9960ec9818 (diff) | |
download | ATCD-pre-subset.tar.gz |
This commit was manufactured by cvs2svn to create tag 'pre-subset'.pre-subset
Diffstat (limited to 'examples/Smart_Pointers/Widget_Impl.cpp')
-rw-r--r-- | examples/Smart_Pointers/Widget_Impl.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/examples/Smart_Pointers/Widget_Impl.cpp b/examples/Smart_Pointers/Widget_Impl.cpp deleted file mode 100644 index 2d3ab404804..00000000000 --- a/examples/Smart_Pointers/Widget_Impl.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- 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 (); - } -} |