/* -*- C++ -*- */ //============================================================================= /** * @file widget_test.cpp * * $Id$ * * @author Christopher Kohlhoff */ //============================================================================= #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 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 p1 (w1->remove_part ()); p1->print_info (); auto_ptr p2 (w1->remove_part ()); w1->list_parts (); auto_ptr 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; template class auto_ptr; template class ACE_Auto_Basic_Ptr; template class auto_ptr; template class ACE_Refcounted_Auto_Ptr; template class ACE_Node >; template class ACE_Unbounded_Queue >; template class ACE_Unbounded_Queue_Iterator >; template class ACE_Refcounted_Auto_Ptr; template class ACE_Node >; template class ACE_Unbounded_Queue >; template class ACE_Unbounded_Queue_Iterator >; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Auto_Basic_Ptr #pragma instantiate auto_ptr #pragma instantiate ACE_Auto_Basic_Ptr #pragma instantiate auto_ptr #pragma instantiate ACE_Refcounted_Auto_Ptr #pragma instantiate ACE_Node > #pragma instantiate ACE_Unbounded_Queue > #pragma instantiate ACE_Unbounded_Queue_Iterator > #pragma instantiate ACE_Refcounted_Auto_Ptr #pragma instantiate ACE_Node > #pragma instantiate ACE_Unbounded_Queue > #pragma instantiate ACE_Unbounded_Queue_Iterator > #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */