Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
genfunc.cpp
Go to the documentation of this file.
1/*
2 GenFunc - generic identification functions (raw)
3
4 Copyright (C)
5 2015, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
20#include "lib/idi/genfunc.hpp"
21#include "lib/format-string.hpp"
22#include "lib/format-obj.hpp"
23#include "lib/util.hpp"
24
25#include <string>
26#include <boost/functional/hash.hpp>
27
28
29using util::_Fmt;
30using std::string;
31
32
33namespace lib {
34namespace idi {
35
36
37 namespace format { // generic entry points / integration helpers...
38
39 string
40 instance_format (string const& prefix, size_t instanceNr)
41 {
42 return _Fmt("%s.%03d")
43 % prefix % instanceNr;
44 }
45
46 string
47 instance_hex_format (string const& prefix, size_t instanceNr)
48 {
49 return _Fmt("%s.%04X")
50 % prefix % instanceNr;
51 }
52
53 } //(End)integration helpers...
54
55
58 { // Meyer's Singleton
59 static TypedCounter instanceCounter;
60 return instanceCounter;
61 }
62
63}} // namespace lib::idi
Utility providing a set of counters, each tied to a specific type.
A front-end for using printf-style formatting.
Simple functions to represent objects, for debugging and diagnostics.
Front-end for printf-style string template interpolation.
Generic functions to build identification schemes.
string instance_format(string const &prefix, size_t instanceNr)
Definition genfunc.cpp:40
string instance_hex_format(string const &prefix, size_t instanceNr)
Definition genfunc.cpp:47
TypedCounter & sharedInstanceCounter()
Definition genfunc.cpp:57
Implementation namespace for support and library code.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...