00001 // ---------------------------------------------------------------------------- 00002 // CERTI - HLA RunTime Infrastructure 00003 // Copyright (C) 2002, 2003 ONERA 00004 // 00005 // This file is part of CERTI-libCERTI 00006 // 00007 // CERTI-libCERTI is free software ; you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License 00009 // as published by the Free Software Foundation ; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this program ; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 // USA 00021 // 00022 // $Id: FederateLevelList.cc,v 3.11 2007/07/06 09:25:18 erk Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 00026 #include "FederateLevelList.hh" 00027 00028 namespace certi { 00029 00030 // ---------------------------------------------------------------------------- 00032 00035 void 00036 FederateLevelList::addFederate(const std::string &the_name, 00037 SecurityLevelID the_level_id) 00038 { 00039 tuple[the_name] = the_level_id ; 00040 } 00041 00043 FederateLevelList::FederateLevelList() { } 00044 00046 FederateLevelList::~FederateLevelList() { } 00047 00048 // getLevel returns the level id associated the federate name given. 00049 SecurityLevelID 00050 FederateLevelList::getLevel(const std::string &theName) const 00051 { 00052 std::map<std::string, SecurityLevelID>::const_iterator i = tuple.find( 00053 theName); 00054 00055 if (i != tuple.end()) 00056 return i->second ; 00057 00058 return PublicLevelID ; 00059 } 00060 00061 } 00062 00063 // $Id: FederateLevelList.cc,v 3.11 2007/07/06 09:25:18 erk Exp $