Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 25, 2006, 11:28:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: now it should also be possible, to cache the resources, by suppling a LoadString.
This is vital to loading Resources, when you only know the TypeName and a LoadString, but not the c++-type and the LoadParameters as is the case when loading over the internet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9801 r9823  
    6161  public:
    6262    Type(const std::string& typeName);
    63     ~Type();
     63    virtual ~Type();
    6464    /** @returns true if the names match @param resourceName the Name to compare. @brief compare the Type with a Name */
    6565    bool operator==(const std::string& resourceName) const { return this->_typeName == resourceName; };
     
    8282    const std::vector<Resources::StorePointer*>& storedResources() const { return _storedResources; };
    8383
     84    virtual void createFromString(const std::string& loadString) = 0;
     85
    8486    void setID(int id);
    8587    void addResource(Resources::StorePointer* resource);
     
    9597
    9698    std::vector<Resources::StorePointer*> _storedResources;   //!< An array of all the stored Resources.
     99  };
     100
     101  template<class T> class tType : public Type
     102  {
     103  public:
     104    tType(const std::string& typeName) : Type(typeName) {};
     105    virtual void createFromString(const std::string& loadString) { T::createFromString(loadString); }
    97106  };
    98107
Note: See TracChangeset for help on using the changeset viewer.