21 #define INDI_SHARED_BLOB_SUPPORT
34 static std::mutex attachedBlobMutex;
35 static std::map<std::string, int> receivedFds;
36 static uint64_t idGenerator = rand();
41 std::lock_guard<std::mutex> lock(attachedBlobMutex);
46 std::string
id = ss.str();
56 std::lock_guard<std::mutex> lock(attachedBlobMutex);
57 auto where = receivedFds.find(identifier);
58 if (where == receivedFds.end())
63 receivedFds.erase(where);
71 std::vector<int> toDestroy;
73 std::lock_guard<std::mutex> lock(attachedBlobMutex);
76 auto idPos = receivedFds.find(
id);
77 if (idPos != receivedFds.end())
79 toDestroy.push_back(idPos->second);
80 receivedFds.erase(idPos);
85 for(
auto fd : toDestroy)
Namespace to encapsulate INDI client, drivers, and mediator classes.
void * attachBlobByUid(const std::string &identifier, size_t size)
void releaseBlobUids(const std::vector< std::string > &blobs)
std::string allocateBlobUid(int fd)
void * IDSharedBlobAttach(int fd, size_t size)