Ignore:
Timestamp:
01/03/08 15:53:44 (17 years ago)
Author:
bittner
Message:

big merge: preparation for havran ray caster, check if everything works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/ResourceManager.h

    r2542 r2575  
    44#include <vector> 
    55#include <string> 
     6#include <iterator> 
     7#include <fstream> 
     8#include <ostream> 
     9#include <iostream> 
    610 
    711//#include "Containers.h" 
     
    1317namespace GtpVisibilityPreprocessor { 
    1418 
     19using std::iterator; 
     20using std::map; 
     21   
    1522 
    1623/** Resource manager controlling loading and destroying of resources. 
     
    2532template <typename T> class ResourceManager 
    2633{ 
     34protected: 
     35  typedef map<unsigned int, T* > maptype; 
    2736 
     37  /// the resource container 
     38  maptype mEntries; 
     39   
    2840public: 
    2941 
     
    6577        T *FindEntry(const unsigned int id) const 
    6678        { 
    67                 std::map<unsigned int, T *>::const_iterator mit = mEntries.find(id); 
     79          typename maptype::const_iterator mit = mEntries.find(id); 
    6880 
    69                 if (mit != mEntries.end())  
    70                 { 
    71                         return (*mit).second; 
    72                 } 
     81          if (mit != mEntries.end())  
     82            { 
     83              return (*mit).second; 
     84            } 
    7385 
    7486                return NULL; 
     
    95107        bool ExportEntries(const std::string &filename) 
    96108        { 
    97                 ofstream stream(filename.c_str(), ios::binary); 
     109          std::ofstream stream(filename.c_str(), std::ios::binary); 
    98110         
    99111                if (!stream.is_open()) 
    100112                        return false; 
    101113 
    102                 std::map<unsigned int, T *>::const_iterator mit, mit_end = mEntries.end(); 
     114                typename std::map<unsigned int, T *>::const_iterator mit, mit_end = mEntries.end(); 
    103115 
    104116                for (mit = mEntries.begin(); mit != mit_end; ++ mit) 
     
    130142        ~ResourceManager<T>() 
    131143        { 
    132                 std::map<unsigned int, T *>::iterator mit, mit_end = mEntries.end(); 
     144          typename std::map<unsigned int, T *>::iterator mit, mit_end = mEntries.end(); 
    133145 
    134146                for (mit = mEntries.begin(); mit != mEntries.end(); ++ mit) 
     
    152164protected: 
    153165 
    154         /// the resource container 
    155         std::map<unsigned int, T *> mEntries; 
    156  
    157166private: 
    158167 
Note: See TracChangeset for help on using the changeset viewer.