Commit 4864cb3f authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Added missing constructor, rule of 3

parent 3e43efa9
......@@ -27,6 +27,7 @@ class VDIFHeaderView
public:
VDIFHeaderView(const uint32_t* data);
void setDataLocation(const uint32_t* _data);
const uint32_t* getDataLocation() const;
uint32_t getVersionNumber() const;
bool isValid() const;
uint32_t getSecondsFromReferenceEpoch() const;
......@@ -54,6 +55,8 @@ class VDIFHeader : public VDIFHeaderView
public:
VDIFHeader();
VDIFHeader(const VDIFHeader &v);
VDIFHeader& operator=(const VDIFHeader& other);
// return pointer to the data block for low level manipulation
uint32_t* getData();
......
......@@ -19,6 +19,10 @@ void VDIFHeaderView::setDataLocation(const uint32_t* _data) {
data = _data;
};
const uint32_t* VDIFHeaderView::getDataLocation() const {
return data;
};
bool VDIFHeaderView::isValid() const {
return (getBitsValue(data[0], 31, 31) == 0);
}
......@@ -91,6 +95,22 @@ VDIFHeader::VDIFHeader() : VDIFHeaderView(data)
setBitsWithValue(data[2], 29, 31, 1);
}
VDIFHeader::VDIFHeader(const VDIFHeader &v): VDIFHeaderView(data)
{
for (int i = 0; i < 8; i++) {
data[i] = v.getDataLocation()[i];
}
setDataLocation(data);
}
VDIFHeader& VDIFHeader::operator=(const VDIFHeader& other)
{
for (int i = 0; i < 8; i++) {
data[i] = other.getDataLocation()[i];
}
return *this;
}
uint32_t *VDIFHeader::getData() { return data; }
void VDIFHeader::setInvalid() { setBitsWithValue(data[0], 31, 31, 1); }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment