C++ - Where to store a global counter?
<p><img src="http://www.freeimagehosting.net/uploads/2fd3f4161c.png" alt="The diagram"></p>

<p>Here's the Minimalist-UML diagram of an app I've been working on. It's supposed to simulate the management of a bunch of sensors relating to different measurements.
<em>Please ignore the <code>House</code> class, the diagram is outdated...</em></p>

<p>However, I have trouble. Each sensor (sound, contact, heat, pressure, gas - All of these inherit from <code>sensor</code>) has an unique ID, starting at 0 for the first one and ending at the total number of sensors - 1.</p>

<p>For good practices' sake, where shall I store the total number of sensors, so the classes I'm using for input/output of files (saving and loading) and insertion of new sensors can access and increment that counter?</p>

<p>Thank you for your time!</p>
