Skip to content

Commit

Permalink
Added copy constructors and = operator for Image and Buffer objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
rickwebiii committed Mar 14, 2012
1 parent a957139 commit a812bd4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Include/clUtilMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ namespace clUtil
initialize();
}

Image(const Image& b) :
Memory(b),
mDimensions(b.mDimensions),
m1DWidth(b.m1DWidth),
mWidth(b.mWidth),
mHeight(b.mHeight),
mDepth(b.mDepth),
mChannelOrder(b.mChannelOrder),
mChannelType(b.mChannelType)
{
}

Image operator=(const Image& b) const
{
return Image(b);
}

virtual void put(const void* const pointer, const size_t len = 0) const;
virtual void get(void* const pointer, const size_t len = 0) const;
virtual bool isImage() const { return true; }
Expand Down Expand Up @@ -141,6 +158,18 @@ namespace clUtil
clUtilCheckError(err);
}

Buffer(const Buffer& b) :
Memory(b),
mParentBuffer(b.mParentBuffer),
mLength(b.mLength)
{
}

Buffer operator=(const Buffer& b) const
{
return Buffer(b);
}

virtual void put(const void* const pointer, const size_t len = 0) const;
virtual void get(void* const pointer, const size_t len = 0) const;
virtual bool isImage() const { return false; }
Expand Down

0 comments on commit a812bd4

Please sign in to comment.