You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
498 B
39 lines
498 B
4 years ago
|
#pragma once
|
||
|
|
||
|
#include "cow.h"
|
||
|
|
||
|
#include <memory>
|
||
|
|
||
|
struct Cow {
|
||
|
Cow() = delete;
|
||
|
|
||
|
Cow(size_t size);
|
||
|
Cow(Cow&& m);
|
||
|
virtual ~Cow();
|
||
|
|
||
|
static Cow from_raw(cow_t* owned);
|
||
|
|
||
|
struct Fake;
|
||
|
|
||
|
private:
|
||
|
struct _inner;
|
||
|
Cow(cow_t* raw);
|
||
|
protected:
|
||
|
const std::shared_ptr<_inner> super;
|
||
|
Cow(const Cow& c);
|
||
|
};
|
||
|
|
||
|
struct Cow::Fake : Cow {
|
||
|
Fake() = delete;
|
||
|
|
||
|
Fake(const Fake& c);
|
||
|
Fake(Fake&& m);
|
||
|
|
||
|
~Fake();
|
||
|
static Fake from_parent(const Cow& parent);
|
||
|
private:
|
||
|
Fake(const Cow& parent);
|
||
|
cow_t* fake;
|
||
|
};
|
||
|
|