source: src/ControlStruct/LabelGenerator.cc @ 56c3935

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 56c3935 was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

licencing: seventh groups of files

  • Property mode set to 100644
File size: 1.1 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// LabelGenerator.cc --
8//
9// Author           : Rodolfo G. Esteves
10// Created On       : Mon May 18 07:44:20 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Tue May 19 15:32:04 2015
13// Update Count     : 2
14//
15
16#include <iostream>
17#include <strstream>
18
19#include "LabelGenerator.h"
20
21namespace ControlStruct {
22        LabelGenerator *LabelGenerator::labelGenerator = 0;
23
24        LabelGenerator *LabelGenerator::getGenerator() {
25                if ( LabelGenerator::labelGenerator == 0 )
26                        LabelGenerator::labelGenerator = new LabelGenerator();
27
28                return labelGenerator;
29        }
30
31        Label LabelGenerator::newLabel() {
32                std::ostrstream os;
33                os << "__L" << current++ << "__";// << std::ends;
34                os.freeze( false );
35                std::string ret = std::string (os.str(), os.pcount());
36                return Label( ret );
37        }
38} // namespace ControlStruct
39
40// Local Variables: //
41// tab-width: 4 //
42// mode: c++ //
43// compile-command: "make install" //
44// End: //
Note: See TracBrowser for help on using the repository browser.