[glacier] Move Pair to glacier.

This commit is contained in:
Drew Galbraith 2023-06-21 20:47:40 -07:00
parent c2dfe17363
commit 0ec2fa3e76
3 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,7 @@
#pragma once
namespace glcr {
template <typename T, typename U>
class Pair {
public:
@ -11,3 +13,5 @@ class Pair {
T first_;
U second_;
};
} // namespace glcr

View File

@ -3,7 +3,7 @@
#include "include/ztypes.h"
#include "scheduler/scheduler.h"
Pair<glcr::RefPtr<Channel>, glcr::RefPtr<Channel>>
glcr::Pair<glcr::RefPtr<Channel>, glcr::RefPtr<Channel>>
Channel::CreateChannelPair() {
auto c1 = glcr::MakeRefCounted<Channel>();
auto c2 = glcr::MakeRefCounted<Channel>();

View File

@ -1,13 +1,13 @@
#pragma once
#include <glacier/container/intrusive_list.h>
#include <glacier/container/pair.h>
#include <glacier/memory/ref_ptr.h>
#include "capability/capability.h"
#include "include/ztypes.h"
#include "lib/message_queue.h"
#include "lib/mutex.h"
#include "lib/pair.h"
#include "object/kernel_object.h"
#include "usr/zcall_internal.h"
@ -21,7 +21,8 @@ struct KernelObjectTag<Channel> {
class Channel : public KernelObject {
public:
uint64_t TypeTag() override { return KernelObject::CHANNEL; }
static Pair<glcr::RefPtr<Channel>, glcr::RefPtr<Channel>> CreateChannelPair();
static glcr::Pair<glcr::RefPtr<Channel>, glcr::RefPtr<Channel>>
CreateChannelPair();
glcr::RefPtr<Channel> peer() { return peer_; }