summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/uniqueid.h
blob: 56cedb5672b3c412ccbcce320074e5e88427304a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2006                                                    *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef UNITQUEID_H
#define UNITQUEID_H

#include "umlnamespace.h"

namespace UniqueID {

    /**
     * MAIN FUNCTION: Return a new unique ID.
     */
    Uml::IDType gen();


    /////////// auxiliary functions ////////////////////////////////////
    // Only required by code that does special operations on unique IDs.
    // NB Try to avoid these functions if possible because their
    // implementation and/or programming interface may change.

    /**
     * Reinitialize the unique ID counter.
     * Should not normally be required because the ID counter is
     * initialized by default anyway.
     */
    void init();

    /**
     * Return the last generated unique ID without generating a new one.
     */
    Uml::IDType get();

    /**
     * Explicitly set a new ID value.
     */
    void set(Uml::IDType id);

}  // end namespace UniqueID

#endif