Add support for naming the dataset

This commit is contained in:
Patrick Niklaus
2018-04-04 12:51:46 +00:00
committed by Patrick Niklaus
parent 666ce46d36
commit 2c80f76004
11 changed files with 82 additions and 20 deletions
+12
View File
@@ -221,6 +221,18 @@ struct SharedRegionRegister
}
}
template<typename OutIter>
void List(OutIter out) const
{
for (const auto& region : regions)
{
if (!region.IsEmpty())
{
*out++ = region.name;
}
}
}
void Deregister(const RegionID key) { regions[key] = SharedRegion{}; }
const auto &GetRegion(const RegionID key) const { return regions[key]; }
+4 -3
View File
@@ -126,7 +126,6 @@ template <typename Data> struct SharedMonitor
bi::interprocess_condition condition;
};
#else
// Implement a conditional variable using a queue of semaphores.
// OSX checks the virtual address of a mutex in pthread_cond_wait and fails with EINVAL
@@ -207,8 +206,10 @@ template <typename Data> struct SharedMonitor
static_assert(buffer_size >= 2, "buffer size is too small");
#endif
static constexpr int rounded_internal_size = ((sizeof(InternalData) + alignof(Data) - 1) / alignof(Data)) * alignof(Data);
static_assert(rounded_internal_size < sizeof(InternalData) + sizeof(Data), "Data and internal data need to fit into shared memory");
static constexpr int rounded_internal_size =
((sizeof(InternalData) + alignof(Data) - 1) / alignof(Data)) * alignof(Data);
static_assert(rounded_internal_size < sizeof(InternalData) + sizeof(Data),
"Data and internal data need to fit into shared memory");
InternalData &internal() const
{
+1 -1
View File
@@ -44,7 +44,7 @@ class Storage
public:
Storage(StorageConfig config);
int Run(int max_wait);
int Run(int max_wait, const std::string &name);
void PopulateLayout(DataLayout &layout);
void PopulateData(const DataLayout &layout, char *memory_ptr);