SUMO - Simulation of Urban MObility
IDSupplier.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A class that generates enumerated and prefixed string-ids
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef IDSupplier_h
00022 #define IDSupplier_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 #include <vector>
00036 
00037 
00038 // ===========================================================================
00039 // class definitions
00040 // ===========================================================================
00046 class IDSupplier {
00047 public:
00049     IDSupplier(const std::string& prefix = "", long begin = 0);
00050 
00056     IDSupplier(const std::string& prefix, const std::vector<std::string> &knownIDs);
00057 
00059     ~IDSupplier();
00060 
00062     std::string getNext();
00063 
00065     void avoid(const std::string& id);
00066 
00067 private:
00069     long myCurrent;
00070 
00072     std::string myPrefix;
00073 
00074 };
00075 
00076 
00077 #endif
00078 
00079 /****************************************************************************/
00080 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines