Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
frameid.hpp
Go to the documentation of this file.
1 /*
2  FRAMEID.hpp - distinct identification of a single data frame
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
36 #ifndef LUMIERA_FRAMEID_H
37 #define LUMIERA_FRAMEID_H
38 
39 
40 #include <boost/operators.hpp>
41 
42 namespace lumiera {
43 
44 
51  struct NodeID
52  {
54  ulong id;
55  ulong generation;
56  ulong childSum;
57 
59  : id (++currID),
60  generation(0),
61  childSum(0)
62  { }
63 
64  static ulong currID;
65  };
66 
67 
68 
69 
78  class FrameID : boost::totally_ordered<FrameID>
79  {
80  long dummy;
81  public:
82  FrameID(long dum=0) : dummy(dum) {}
83  operator long () { return dummy; }
84 
85  bool operator< (const FrameID& other) const { return dummy < other.dummy; }
86  bool operator== (const FrameID& other) const { return dummy == other.dummy; }
87  };
88 
89 
90 
91 
92 } // namespace lumiera
93 #endif
Identification tuple for addressing frames unambiguously.
Definition: frameid.hpp:78
bool operator==(const FrameID &other) const
Definition: frameid.hpp:86
ulong childSum
Definition: frameid.hpp:56
ulong generation
Definition: frameid.hpp:55
FrameID(long dum=0)
Definition: frameid.hpp:82
static ulong currID
storage for the unique node-ID counter
Definition: frameid.hpp:64
bool operator<(const FrameID &other) const
Definition: frameid.hpp:85
Lumiera public interface.
Identification tuple for denoting render nodes unambiguously.
Definition: frameid.hpp:51