mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Make PtrXXX()
family of functions public
PiperOrigin-RevId: 413616359 Change-Id: I553c17f0668708b00fdb12a21109ed45aeba6c66
This commit is contained in:
parent
a096056263
commit
4a6e005155
|
@ -64,6 +64,8 @@ class Var : public Pointable {
|
|||
Var(const Var&) = delete;
|
||||
Var& operator=(const Var&) = delete;
|
||||
|
||||
virtual ~Var();
|
||||
|
||||
// Returns the address of the storage (remote side).
|
||||
virtual void* GetRemote() const { return remote_; }
|
||||
|
||||
|
@ -85,17 +87,15 @@ class Var : public Pointable {
|
|||
// Returns a string representation of the variable value.
|
||||
virtual std::string ToString() const = 0;
|
||||
|
||||
virtual ~Var();
|
||||
|
||||
protected:
|
||||
Var() = default;
|
||||
|
||||
// Functions to get pointers with certain type of synchronization schemes.
|
||||
Ptr* PtrNone();
|
||||
Ptr* PtrBoth();
|
||||
Ptr* PtrBefore();
|
||||
Ptr* PtrAfter();
|
||||
|
||||
protected:
|
||||
Var() = default;
|
||||
|
||||
// Set pointer to local storage class.
|
||||
void SetLocal(void* local) { local_ = local; }
|
||||
|
||||
|
|
|
@ -35,10 +35,6 @@ namespace sapi::v {
|
|||
template <class T>
|
||||
class Array : public Var {
|
||||
public:
|
||||
using Var::PtrAfter;
|
||||
using Var::PtrBefore;
|
||||
using Var::PtrBoth;
|
||||
|
||||
// The array is not owned by this object.
|
||||
Array(T* arr, size_t nelem)
|
||||
: arr_(arr),
|
||||
|
|
|
@ -28,10 +28,6 @@ namespace sapi::v {
|
|||
template <class T>
|
||||
class IntBase : public Reg<T> {
|
||||
public:
|
||||
using Var::PtrAfter;
|
||||
using Var::PtrBefore;
|
||||
using Var::PtrBoth;
|
||||
|
||||
explicit IntBase(T value = {}) { this->SetValue(value); }
|
||||
};
|
||||
|
||||
|
|
|
@ -37,10 +37,6 @@ class Proto;
|
|||
// use protobufs as they are easier to handle.
|
||||
class LenVal : public Var {
|
||||
public:
|
||||
using Var::PtrAfter;
|
||||
using Var::PtrBefore;
|
||||
using Var::PtrBoth;
|
||||
|
||||
explicit LenVal(const char* data, uint64_t size)
|
||||
: array_(const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(data)),
|
||||
size),
|
||||
|
|
|
@ -38,10 +38,6 @@ class Proto : public Var {
|
|||
static_assert(std::is_base_of<google::protobuf::Message, T>::value,
|
||||
"Template argument must be a proto message");
|
||||
|
||||
using Var::PtrAfter;
|
||||
using Var::PtrBefore;
|
||||
using Var::PtrBoth;
|
||||
|
||||
ABSL_DEPRECATED("Use Proto<>::FromMessage() instead")
|
||||
explicit Proto(const T& proto)
|
||||
: wrapped_var_(SerializeProto(proto).value()) {}
|
||||
|
|
|
@ -27,10 +27,6 @@ namespace sapi::v {
|
|||
template <class T>
|
||||
class Struct : public Var {
|
||||
public:
|
||||
using Var::PtrAfter;
|
||||
using Var::PtrBefore;
|
||||
using Var::PtrBoth;
|
||||
|
||||
// Forwarding constructor to initalize the struct_ field.
|
||||
template <typename... Args>
|
||||
explicit Struct(Args&&... args) : struct_(std::forward<Args>(args)...) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user