aboutsummaryrefslogblamecommitdiffstats
path: root/util/system/shmat.h
blob: d9da3c151a8c95af9c24482c03e9f620ed13e377 (plain) (tree)
1
2
3
4
5
6
7
8
9
            

                             
                              
 
                                         
             
                   
             
 
       
                    
                              
 
                          











                                         
  
#pragma once

#include "fhandle.h"

#include <util/generic/ptr.h>
#include <util/generic/guid.h>

class TSharedMemory: public TThrRefBase {
    TGUID Id;
    FHANDLE Handle;
    void* Data;
    int Size;

public:
    TSharedMemory();
    ~TSharedMemory() override;

    bool Create(int Size);
    bool Open(const TGUID& id, int size);

    const TGUID& GetId() {
        return Id;
    }

    void* GetPtr() {
        return Data;
    }

    int GetSize() const {
        return Size;
    }
};