5 // Created by Louis Gerbarg on 6/16/15.
9 #ifndef MultiCacheBuilder_h
10 #define MultiCacheBuilder_h
12 #include <dispatch/dispatch.h>
16 #include "mega-dylib-utils.h"
19 typedef struct _BOMBom
* BOMBom
;
21 struct MultiCacheBuilder
{
22 dispatch_semaphore_t _concurrencyLimitingSemaphore
;
23 dispatch_semaphore_t _writeLimitingSemaphore
;
24 dispatch_queue_t _writeQueue
;
25 dispatch_group_t _writeGroup
;
26 dispatch_queue_t _buildQueue
;
29 uint64_t _filesWritten
= 0;
30 uint64_t _bytesWritten
= 0;
32 const bool _skipWrites
;
33 const bool _skipBuilds
;
34 const bool _buildRoot
;
35 const bool _enforceRootless
;
37 MultiCacheBuilder(Manifest
& manifest
, bool BNI
= false, bool SW
= false, bool buildRoot
= false, bool skipBuilds
= false, bool enforceRootless
= false);
39 void buildCaches(std::string masterDstRoot
);
43 void buildCache(const std::string cachePath
, const std::set
<std::string
> configurations
, const std::string architecture
, bool development
);
44 void write_cache(std::string cachePath
, const std::set
<std::string
>& configurations
, const std::string
& architecture
, std::shared_ptr
<SharedCache
> cache
, bool developmentCache
);
47 #endif /* MultiCacheBuilder_h */