Adding ViroKit. Needs AWSCore :(

This commit is contained in:
John Lyon-Smith
2018-03-27 17:46:15 -07:00
parent 2ab15e7dc1
commit 02e06dface
844 changed files with 86921 additions and 21 deletions

View File

@@ -0,0 +1,66 @@
//
// VROData.h
// ViroRenderer
//
// Created by Raj Advani on 11/17/15.
// Copyright © 2015 Viro Media. All rights reserved.
//
#ifndef VROData_h
#define VROData_h
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
Defines how the VROData holds onto its underlying data.
Copy: data is copied on construction, freed on destruction
Move: data is assigned on construction, freed on destruction
Wrap: data is assigned on construction
*/
enum class VRODataOwnership {
Copy,
Move,
Wrap
};
/*
Holds onto an arbitrary block of bytes.
*/
class VROData {
public:
/*
Construct a new VROData. Default ownership semanatics are
Copy.
*/
VROData(void *data, int dataLength, VRODataOwnership ownership = VRODataOwnership::Copy);
/*
Construct a new VROData, copying the bytes into this object.
(allows for const data input).
*/
VROData(const void *data, int dataLength);
~VROData();
void *const getData() {
return _data;
}
int getDataLength() const {
return _dataLength;
}
private:
void *_data;
int _dataLength;
VRODataOwnership _ownership;
};
#endif /* VROData_h */