All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiTouch::ObjectIdFactory Class Reference

Tracked object type flags. More...

#include <MultiTouch/MultiTouch.hpp>

Public Types

typedef long Id
 Id data type.
 

Public Member Functions

Id generateId (unsigned count=1)
 Generate a unique id. More...
 
 ObjectIdFactory ()
 Constructor.
 
 ~ObjectIdFactory ()
 Destructor.
 

Static Public Member Functions

static ObjectIdFactory & instance ()
 Instance of the factory. More...
 

Detailed Description

Tracked object type flags.

This class is used to generate unique ids for tracked objects

Member Function Documentation

Id MultiTouch::ObjectIdFactory::generateId ( unsigned  count = 1)

Generate a unique id.

This function reserves the given number of ids. The returned id is the first reserved id. All ids from [id, id + count-1] are reserved. This function is thread-safe.

Returns
first reserved id
static ObjectIdFactory& MultiTouch::ObjectIdFactory::instance ( )
static

Instance of the factory.

Returns
Instance of factory