void
resource::del_map(void *p) {
- erase_if([&](mapping &m) {
+ erase_if([&](const mapping &m) {
return static_cast<void *>(m) == p;
}, maps);
}
mapping::mapping(mapping &&m) :
pctx(m.pctx), pxfer(m.pxfer), p(m.p) {
- m.p = NULL;
+ m.pctx = NULL;
m.pxfer = NULL;
+ m.p = NULL;
}
mapping::~mapping() {
friend class kernel;
protected:
- resource(device &dev, clover::memory_obj &obj);
+ resource(device &dev, memory_obj &obj);
pipe_sampler_view *bind_sampler_view(command_queue &q);
void unbind_sampler_view(command_queue &q,
public:
root_resource(device &dev, memory_obj &obj,
command_queue &q, const std::string &data);
- root_resource(device &dev, memory_obj &obj,
- root_resource &r);
+ root_resource(device &dev, memory_obj &obj, root_resource &r);
virtual ~root_resource();
};
mapping(command_queue &q, resource &r, cl_map_flags flags,
bool blocking, const resource::vector &origin,
const resource::vector ®ion);
- mapping(const mapping &m) = delete;
mapping(mapping &&m);
~mapping();
mapping &
operator=(mapping m);
- operator void *() {
- return p;
- }
+ mapping(const mapping &m) = delete;
- operator char *() {
- return (char *)p;
+ template<typename T>
+ operator T *() const {
+ return (T *)p;
}
private: