Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / Smart_Pointers / Gadget_Impl.cpp
blobd7227c9461459f8f97e1eb28c9d2a8726724d80e
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file Gadget_Impl.cpp
6 * @author Christopher Kohlhoff <chris@kohlhoff.com>
7 */
8 //=============================================================================
10 #include "Gadget_Impl.h"
11 #include "ace/Log_Msg.h"
13 Gadget_Impl::Gadget_Impl ()
15 ACE_DEBUG ((LM_DEBUG, "Gadget_Impl constructor\n"));
18 Gadget_Impl::~Gadget_Impl ()
20 ACE_DEBUG ((LM_DEBUG, "Gadget_Impl destructor\n"));
23 void Gadget_Impl::add_part (Gadget_Part_var part)
25 parts_.enqueue_tail (part);
28 Gadget_Part_var Gadget_Impl::remove_part ()
30 Gadget_Part_var removed_part;
31 if (parts_.dequeue_head (removed_part) == -1)
32 return Gadget_Part_var();
33 return removed_part;
36 void Gadget_Impl::list_parts ()
38 ACE_Unbounded_Queue_Iterator<Gadget_Part_var> iter (parts_);
39 Gadget_Part_var *current_part;
40 while (iter.next (current_part))
42 (*current_part)->print_info ();
43 iter.advance ();