U++ framework
Do not panic. Ask here before giving up.

Home » Community » Coffee corner » Sharing and Locking
Re: Sharing and Locking [message #25925 is a reply to message #25909] Sat, 20 March 2010 10:21 Go to previous messageGo to previous message
gridem is currently offline  gridem
Messages: 45
Registered: August 2008
Member
luzr wrote on Fri, 19 March 2010 09:59


File objects? Smile

IMO, works quite well as long as only memory is involved....

Mirek

struct FileObject
{
    FileObject() : impl(new Impl) {}
    typedef weak_ptr<Impl> Ref;
    
    bool IsOpened() const { return impl->file; }
    void Close() { impl->file.reset(); }
    void Open(const char* fname) { impl->file.reset(new File(fname)); }
    
private:
    struct Impl
    {
        shared_ptr<File> file;
    };
    
    shared_ptr<Impl> impl;
};

Grigory
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Windows 7 - long wait after app crash
Next Topic: Upp application and CPU on Linux
Goto Forum:
  


Current Time: Fri Apr 24 21:28:49 GMT+2 2026

Total time taken to generate the page: 0.00595 seconds