18 #ifndef ION_BASE_VECTORDATACONTAINER_H_
19 #define ION_BASE_VECTORDATACONTAINER_H_
21 #include "base/macros.h"
57 void InternalWipeData()
override { vector_ =
AllocVector<T>(GetAllocator()); }
61 void* GetDataPtr()
const override {
62 return vector_.empty() ? NULL : &vector_[0];
66 mutable AllocVector<T> vector_;
68 DISALLOW_IMPLICIT_CONSTRUCTORS(VectorDataContainer);
74 #endif // ION_BASE_VECTORDATACONTAINER_H_
AllocVector< T > * GetMutableVector()
Returns a pointer to the vector backing this instance.
const AllocVector< T > & GetVector() const
Returns a const reference to the vector backing this instance.
VectorDataContainer is a special kind of DataContainer that is backed by an AllocVector.
~VectorDataContainer() override
The destructor is protected because all base::Referent classes must have protected or private destruc...
The DataContainer class encapsulates arbitrary user data passed to Ion.
VectorDataContainer(bool is_wipeable)
#define kNullFunction
Copyright 2016 Google Inc.
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory alloca...