converted event based queues and particle buffer into SharedArrays

This commit is contained in:
John Tramm 2020-01-23 20:08:28 +00:00
parent 0894b608d1
commit 6bf15297ec
5 changed files with 74 additions and 91 deletions

View file

@ -29,7 +29,6 @@ public:
SharedArray(int64_t capacity) : capacity_(capacity)
{
data_ = std::make_unique<T[]>(capacity);
size_ = 0;
}
//==========================================================================
@ -45,7 +44,7 @@ public:
//! Increases the size of the SharedArray by one and returns an index to the
//! last element of the array.
int64_t append()
int64_t thread_safe_append()
{
// Atomically capture the index we want to write to
int64_t idx;
@ -70,9 +69,13 @@ public:
}
int64_t size() {return size_;}
int64_t resize(int64_t size) {size_ = size;}
int64_t capacity() {return capacity_;}
T* data() {return data_.get();}
};
} // namespace openmc