Skip to content

Commit

Permalink
Add a constructor of DoubleArrayKey.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yata committed Jan 7, 2013
1 parent ddb35cd commit 2d450a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/alpha/double_array.cpp
Expand Up @@ -23,6 +23,14 @@ namespace alpha {
DoubleArrayCreate DOUBLE_ARRAY_CREATE;
DoubleArrayOpen DOUBLE_ARRAY_OPEN;

DoubleArrayKey::DoubleArrayKey(uint64_t id, const char *address,
uint64_t length)
: id_low_(static_cast<uint32_t>(id)),
id_high_(static_cast<uint8_t>(id >> 32)),
buf_() {
std::memcpy(buf_, address, length);
}

std::unique_ptr<DoubleArrayImpl> DoubleArrayImpl::create(io::Pool pool) {
// TODO
return nullptr;
Expand Down
2 changes: 2 additions & 0 deletions lib/alpha/double_array.hpp
Expand Up @@ -103,6 +103,8 @@ class DoubleArrayEntry {
// TODO
class DoubleArrayKey {
public:
DoubleArrayKey(uint64_t id, const char *address, uint64_t length);

uint64_t id() const {
return id_low_ | (static_cast<uint64_t>(id_high_) << 32);
}
Expand Down

0 comments on commit 2d450a8

Please sign in to comment.