Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

BonnMotionFileCache.h

00001 //
00002 // Copyright (C) 2005 Andras Varga
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 //
00018 
00019 #ifndef BONNMOTIONFILECACHE_H
00020 #define BONNMOTIONFILECACHE_H
00021 
00022 #include <list>
00023 #include <vector>
00024 #include <omnetpp.h>
00025 #include "BasicMobility.h"
00026 
00027 class BonnMotionFileCache;
00028 
00035 class  BonnMotionFile
00036 {
00037   public:
00038     typedef std::vector<double> Line;
00039   private:
00040     friend class BonnMotionFileCache;
00041     typedef std::list<Line> LineList;
00042     LineList lines;
00043   public:
00044     const Line *getLine(int nodeId) const;
00045 };
00046 
00047 
00056 class  BonnMotionFileCache
00057 {
00058   protected:
00059     typedef std::map<std::string,BonnMotionFile> BMFileMap;
00060     BMFileMap cache;
00061     static BonnMotionFileCache *inst;
00062     void parseFile(const char *filename, BonnMotionFile& bmFile);
00063     BonnMotionFileCache() {}
00064     virtual ~BonnMotionFileCache() {}
00065 
00066   public:
00070     static BonnMotionFileCache *instance();
00071 
00075     static void deleteInstance();
00076 
00080     virtual const BonnMotionFile *getFile(const char *filename);
00081 };
00082 
00083 #endif
00084 

Generated on Fri Jan 12 08:29:32 2007 for Mobility Framework by  doxygen 1.4.4