Demo entry 6627413

cpp

   

Submitted by anthony on Jun 29, 2017 at 03:18
Language: C++. Code size: 642 Bytes.

template< class Asset > class Resource
{
    friend res::ResourceManager< Asset >;
    
public:
    
    Asset * object;
    
    void SetLoaded(bool value){isloaded = value;}
    bool GetLoaded() const {return isloaded;}
    
    ds::astring const& GetName() const {return isloaded;}
    
    int GetReferenceCount() const {return reference_counter;}
    
private:
    
    Resource(ds::astring const& name) 
    : object(nullptr)
    , reference_counter(0)
    , name(name)
    , isloaded(false)
    {}
    ~Resource(){}
    
private:
    
    int reference_counter;
    ds::astring name;
    bool isloaded;
};

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).