<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SFML - Simple and Fast Multimedia Library</title> <meta http-equiv="Content-Type" content="text/html;"/> <meta charset="utf-8"/> <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>--> <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> </head> <body> <div id="banner-container"> <div id="banner"> <span id="sfml">SFML 2.5.1</span> </div> </div> <div id="content"> <!-- Generated by Doxygen 1.8.14 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1NonCopyable.html">NonCopyable</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pro-methods">Protected Member Functions</a> | <a href="classsf_1_1NonCopyable-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">sf::NonCopyable Class Reference<div class="ingroups"><a class="el" href="group__system.html">System module</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Utility class that makes any derived class non-copyable. <a href="classsf_1_1NonCopyable.html#details">More...</a></p> <p><code>#include <<a class="el" href="NonCopyable_8hpp_source.html">NonCopyable.hpp</a>></code></p> <div class="dynheader"> Inheritance diagram for sf::NonCopyable:</div> <div class="dyncontent"> <div class="center"> <img src="classsf_1_1NonCopyable.png" usemap="#sf::NonCopyable_map" alt=""/> <map id="sf::NonCopyable_map" name="sf::NonCopyable_map"> <area href="classsf_1_1Context.html" title="Class holding a valid drawing context. " alt="sf::Context" shape="rect" coords="231,56,452,80"/> <area href="classsf_1_1Cursor.html" title="Cursor defines the appearance of a system cursor. " alt="sf::Cursor" shape="rect" coords="231,112,452,136"/> <area href="classsf_1_1FileInputStream.html" title="Implementation of input stream based on a file. " alt="sf::FileInputStream" shape="rect" coords="231,168,452,192"/> <area href="classsf_1_1Ftp.html" title="A FTP client. " alt="sf::Ftp" shape="rect" coords="231,224,452,248"/> <area href="classsf_1_1GlResource_1_1TransientContextLock.html" title="RAII helper class to temporarily lock an available context for use. " alt="sf::GlResource::TransientContextLock" shape="rect" coords="231,280,452,304"/> <area href="classsf_1_1Http.html" title="A HTTP client. " alt="sf::Http" shape="rect" coords="231,336,452,360"/> <area href="classsf_1_1InputSoundFile.html" title="Provide read access to sound files. " alt="sf::InputSoundFile" shape="rect" coords="231,392,452,416"/> <area href="classsf_1_1Lock.html" title="Automatic wrapper for locking and unlocking mutexes. " alt="sf::Lock" shape="rect" coords="231,448,452,472"/> <area href="classsf_1_1Mutex.html" title="Blocks concurrent access to shared resources from multiple threads. " alt="sf::Mutex" shape="rect" coords="231,504,452,528"/> <area href="classsf_1_1OutputSoundFile.html" title="Provide write access to sound files. " alt="sf::OutputSoundFile" shape="rect" coords="231,560,452,584"/> <area href="classsf_1_1RenderTarget.html" title="Base class for all render targets (window, texture, ...) " alt="sf::RenderTarget" shape="rect" coords="231,616,452,640"/> <area href="classsf_1_1Shader.html" title="Shader class (vertex, geometry and fragment) " alt="sf::Shader" shape="rect" coords="231,672,452,696"/> <area href="classsf_1_1Socket.html" title="Base class for all the socket types. " alt="sf::Socket" shape="rect" coords="231,728,452,752"/> <area href="classsf_1_1Thread.html" title="Utility class to manipulate threads. " alt="sf::Thread" shape="rect" coords="231,784,452,808"/> <area href="classsf_1_1ThreadLocal.html" title="Defines variables with thread-local storage. " alt="sf::ThreadLocal" shape="rect" coords="231,840,452,864"/> <area href="classsf_1_1Window.html" title="Window that serves as a target for OpenGL rendering. " alt="sf::Window" shape="rect" coords="231,896,452,920"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:a2110add170580fdb946f887719da6860"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1NonCopyable.html#a2110add170580fdb946f887719da6860">NonCopyable</a> ()</td></tr> <tr class="memdesc:a2110add170580fdb946f887719da6860"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a2110add170580fdb946f887719da6860">More...</a><br /></td></tr> <tr class="separator:a2110add170580fdb946f887719da6860"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8274ffbf46014f5f7f364befb52c7728"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1NonCopyable.html#a8274ffbf46014f5f7f364befb52c7728">~NonCopyable</a> ()</td></tr> <tr class="memdesc:a8274ffbf46014f5f7f364befb52c7728"><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. <a href="#a8274ffbf46014f5f7f364befb52c7728">More...</a><br /></td></tr> <tr class="separator:a8274ffbf46014f5f7f364befb52c7728"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Utility class that makes any derived class non-copyable. </p> <p>This class makes its instances non-copyable, by explicitly disabling its copy constructor and its assignment operator.</p> <p>To create a non-copyable class, simply inherit from <a class="el" href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. ">sf::NonCopyable</a>.</p> <p>The type of inheritance (public or private) doesn't matter, the copy constructor and assignment operator are declared private in <a class="el" href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. ">sf::NonCopyable</a> so they will end up being inaccessible in both cases. Thus you can use a shorter syntax for inheriting from it (see below).</p> <p>Usage example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>MyNonCopyableClass : <a class="code" href="classsf_1_1NonCopyable.html">sf::NonCopyable</a></div><div class="line">{</div><div class="line"> ...</div><div class="line">};</div></div><!-- fragment --><p>Deciding whether the instances of a class can be copied or not is a very important design choice. You are strongly encouraged to think about it before writing a class, and to use <a class="el" href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. ">sf::NonCopyable</a> when necessary to prevent many potential future errors when using it. This is also a very important indication to users of your class. </p> <p class="definition">Definition at line <a class="el" href="NonCopyable_8hpp_source.html#l00041">41</a> of file <a class="el" href="NonCopyable_8hpp_source.html">NonCopyable.hpp</a>.</p> </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="a2110add170580fdb946f887719da6860"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2110add170580fdb946f887719da6860">◆ </a></span>NonCopyable()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">sf::NonCopyable::NonCopyable </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default constructor. </p> <p>Because this class has a copy constructor, the compiler will not automatically generate the default constructor. That's why we must define it explicitly. </p> <p class="definition">Definition at line <a class="el" href="NonCopyable_8hpp_source.html#l00053">53</a> of file <a class="el" href="NonCopyable_8hpp_source.html">NonCopyable.hpp</a>.</p> </div> </div> <a id="a8274ffbf46014f5f7f364befb52c7728"></a> <h2 class="memtitle"><span class="permalink"><a href="#a8274ffbf46014f5f7f364befb52c7728">◆ </a></span>~NonCopyable()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">sf::NonCopyable::~NonCopyable </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default destructor. </p> <p>By declaring a protected destructor it's impossible to call delete on a pointer of <a class="el" href="classsf_1_1NonCopyable.html" title="Utility class that makes any derived class non-copyable. ">sf::NonCopyable</a>, thus preventing possible resource leaks. </p> <p class="definition">Definition at line <a class="el" href="NonCopyable_8hpp_source.html#l00063">63</a> of file <a class="el" href="NonCopyable_8hpp_source.html">NonCopyable.hpp</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="NonCopyable_8hpp_source.html">NonCopyable.hpp</a></li> </ul> </div><!-- contents --> </div> <div id="footer-container"> <div id="footer"> SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br> Copyright © Laurent Gomila :: Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> :: </div> </div> </body> </html>