onnxruntime/winml/lib/Api/VectorBackedBuffer.h
Sheil Kumar 84c1340f9b
Refactor implementation of Tensor<T> and underlying buffer stores to improve binary size and maintainability (#5836)
* refactor tensor buffers to make cleaner

* refactor to make tensor backing buffer implementation smaller and cleaner

* missed virtual on destructor

* remove unnecessary static_pointer_cast

* add string vector accessor

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2020-11-18 14:56:47 -08:00

28 lines
No EOL
657 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "robuffer.h"
#include "winrt/Windows.Storage.Streams.h"
namespace _winml {
class vector_backed_buffer : public winrt::implements<
vector_backed_buffer,
wss::IBuffer,
Windows::Storage::Streams::IBufferByteAccess> {
public:
vector_backed_buffer(size_t size);
uint32_t Capacity() const;
uint32_t Length() const;
void Length(uint32_t /*value*/);
STDMETHOD(Buffer)(uint8_t** value);
private:
std::vector<BYTE> buffer_;
};
} // namespace _winml