2 //=============================================================================
4 * @file widget_test.cpp
6 * @author Christopher Kohlhoff <chris@kohlhoff.com>
8 //=============================================================================
10 #include "ace/OS_main.h"
12 #include "Widget_Factory.h"
13 #include "Widget_Part.h"
14 #include "Widget_Part_Factory.h"
17 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
19 ACE_UNUSED_ARG (argc
);
20 ACE_UNUSED_ARG (argv
);
22 std::unique_ptr
<Widget
> w1 (Widget_Factory::create_widget ());
23 w1
->add_part (Widget_Part_Factory::create_widget_part (w1
.get(), "part1", 1));
24 w1
->add_part (Widget_Part_Factory::create_widget_part (w1
.get(), "part2", 2));
25 w1
->add_part (Widget_Part_Factory::create_widget_part (w1
.get(), "part3", 3));
29 std::unique_ptr
<Widget_Part
> p1 (w1
->remove_part ());
31 std::unique_ptr
<Widget_Part
> p2 (w1
->remove_part ());
35 std::unique_ptr
<Widget
> w2 (Widget_Factory::create_widget ());
36 w2
->add_part (Widget_Part_Factory::create_widget_part (w2
.get(), "part4", 4));
37 Widget_Part
*p3
= Widget_Part_Factory::create_widget_part (w2
.get(), "part5", 5);
39 p3
->remove_from_owner ();