<?xml version="1.0" encoding="iso-8859-1"?>

<!--
	Copyright(c) 2006, by Pocomatic Software LLC, All Rights Reserved

	This example illustrates:

	1. How to use C++ standard template library (STL) container classes (such as std::map)
	   in Pococapsule/C++.
	2. How to call a non-member function as a post instantiation ioc and use <this-bean>.
-->

<!DOCTYPE poco-application-context SYSTEM "http://www.pocomatic.com/poco-application-context.dtd">

<poco-application-context id="my-map">

   <load library="./reader.$dll"/>

   <bean class="void"
	factory-method="::read_props"
        lazy-init="false"
   >
	<method-arg ref="props" pass="deref"/>
   </bean>
 
   <bean id="props"
	class="std::map{std::string, std::string}"
	destroy-method="delete"	 
   >
	<ioc method="add_to_map" target="none">
		<method-arg pass="deref"><this-bean/></method-arg>
		<method-arg type="string" value="hw-arch"/>
		<method-arg type="string" value="Intelx86"/>
	</ioc>
	<ioc method="add_to_map" target="none">
		<method-arg pass="deref"><this-bean/></method-arg>
		<method-arg type="string" value="op-system"/>
		<method-arg type="string" value="linux"/>
	</ioc>
	<ioc method="add_to_map" target="none">
		<method-arg pass="deref"><this-bean/></method-arg>
		<method-arg type="string" value="compiler"/>
		<method-arg type="string" value="gcc"/>
	</ioc>
	<ioc method="add_to_map" target="none">
		<method-arg pass="deref"><this-bean/></method-arg>
		<method-arg type="string" value="host-name"/>
		<method-arg type="string" value="pocomatic.com"/>
	</ioc>
	<ioc method="add_to_map" target="none">
		<method-arg pass="deref"><this-bean/></method-arg>
		<method-arg type="string" value="ip-addr"/>
		<method-arg type="string" value="192.168.2.2"/>
	</ioc>
   </bean>

   <load library="./reflx.$dll"/>

</poco-application-context>

