<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Great work]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=23</link>
		<description><![CDATA[The most recent posts in Great work.]]></description>
		<lastBuildDate>Thu, 10 Feb 2011 14:02:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Great work]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=72#p72</link>
			<description><![CDATA[<p>Hello,</p><p>I just discovered Maratis, and I am really impressed. You did a really great work.<br />I&#039;ll try to use it in a really near futur.</p><p>One suggestion: wouldn&#039;t it be better if you implement your singleton in a more secured way ?<br />I mean:<br /> - Have the constructor private.<br /> - Have a static instance set to null and instantiate it if needed.</p><p>A short sample:</p><p>In<br />class SingleObject<br />{<br />private:<br />&nbsp; static SingleObject*_instance;</p><p>private:<br />&nbsp; &nbsp; // Constructor/Destructor<br />&nbsp; &nbsp; SingleObject();<br />&nbsp; &nbsp; ~SingleObject();</p><p>public:<br />&nbsp; &nbsp; static SingleObject* getInstance ()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (NULL == _instance)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_instance =&nbsp; new SingleObject;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; return _instance;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; static void kill ()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (NULL != _instance)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete _instance;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _instance = NULL;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />};</p><p>In the .cpp file<br />SingleObject *SingleObject::_instance = NULL;</p><p>I think it&#039;s a better way to implement the singleton pattern, but it&#039;s just my opinion.</p><p>Great work, and best regards.</p>]]></description>
			<author><![CDATA[dummy@example.com (LaBigne)]]></author>
			<pubDate>Thu, 10 Feb 2011 14:02:44 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=72#p72</guid>
		</item>
	</channel>
</rss>
