Path: blob/main/src/utils/distribution/DistributionCont.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file DistributionCont.h14/// @author Daniel Krajzewicz15/// @date Sept 200216///17// A container for distributions18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <map>24#include <utils/distribution/Distribution.h>252627// ===========================================================================28// class definitions29// ===========================================================================30/**31* @class DistributionCont32* A container for distributions of different type.33*/34class DistributionCont {35public:36/// Adds a distribution of the given type and name to the container37static bool dictionary(const std::string& type, const std::string& id,38Distribution* d);3940/// retrieves the distribution described by a type and a name from the container41static Distribution* dictionary(const std::string& type,42const std::string& id);4344/// delete all stored distributions45static void clear();4647private:48/// Definition of a map from distribution ids to distributions49typedef std::map<std::string, Distribution*> DistDict;5051/// Definition of a map from distribution types to distribution ids to distributions52typedef std::map<std::string, DistDict> TypedDistDict;5354/// Map from distribution types to distribution ids to distributions55static TypedDistDict myDict;5657};585960