-/* Copyright (c) 2008-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2008-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#ifndef SIMGRID_MC_REMOTE_PTR_HPP
#define SIMGRID_MC_REMOTE_PTR_HPP
-#include <cstddef>
-#include <cstdint>
-#include <cstring>
-
-#include <stdexcept>
-#include <type_traits>
+#include "src/simix/smx_private.hpp"
namespace simgrid {
namespace mc {
std::size_t getBufferSize() const { return sizeof(T); }
operator T() const
{
-//FIXME: assert turned off because smpi:Request is not seen as "trivial".
-// static_assert(std::is_trivial<T>::value, "Cannot convert non trivial type");
+ static_assert(std::is_trivial<T>::value, "Cannot convert non trivial type");
return buffer;
}
void clear() { std::memset(static_cast<void*>(&buffer), 0, sizeof(T)); }
explicit RemotePtr(std::nullptr_t) : address_(0) {}
explicit RemotePtr(std::uint64_t address) : address_(address) {}
explicit RemotePtr(T* address) : address_((std::uintptr_t)address) {}
- explicit RemotePtr(Remote<T*> p) : RemotePtr(*p.getBuffer()) {}
+ explicit RemotePtr(Remote<T*> p) : address_((std::uintptr_t)*p.getBuffer()) {}
std::uint64_t address() const { return address_; }
/** Turn into a local pointer