ZeroBuf
0.4.0
Zero-copy, zero-serialize, zero-hassle protocol buffers
|
STL-like vector abstraction for dynamic arrays in a zerobuf. More...
#include <Vector.h>
Public Member Functions | |
Vector (Allocator &alloc, size_t index) | |
bool | empty () const |
uint64_t | size () const |
void | clear () |
Empty the vector. More... | |
T * | data () |
const T * | data () const |
bool | operator== (const Vector &rhs) const |
bool | operator!= (const Vector &rhs) const |
template<class Q = T> | |
const std::enable_if<!std::is_base_of< Zerobuf, Q >::value, Q >::type & | operator[] (const size_t index) const |
template<class Q = T> | |
std::enable_if< !std::is_base_of< Zerobuf, Q >::value, Q >::type & | operator[] (const size_t index) |
template<class Q = T> | |
const std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type & | operator[] (const size_t index) const |
template<class Q = T> | |
std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type & | operator[] (const size_t index) |
template<class Q = T> | |
void | push_back (const typename std::enable_if< !std::is_base_of< Zerobuf, Q >::value, Q >::type &) |
Insert a builtin element at the end of the vector. More... | |
template<class Q = T> | |
void | push_back (const typename std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type &) |
Insert a Zerobuf-derived element at the end of the vector. More... | |
void | reset (Allocator &alloc) |
void | compact (float) |
Remove unused memory from vector and all members. More... | |
template<class Q = T> | |
void | fromJSON (const Json::Value &json, const typename std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type *=nullptr) |
Update this vector of ZeroBufs from its JSON representation. More... | |
template<class Q = T> | |
void | fromJSON (const Json::Value &json, const typename std::enable_if< std::is_enum< Q >::value, Q >::type *=nullptr) |
Update this vector of enums from its JSON representation. More... | |
template<class Q = T> | |
void | fromJSON (const Json::Value &json, const typename std::enable_if< std::is_arithmetic< Q >::value, Q >::type *=nullptr) |
Update this vector of arithmetics from its JSON representation. More... | |
template<class Q = T> | |
void | fromJSON (const Json::Value &json, const typename std::enable_if< std::is_same< Q, servus::uint128_t >::value, Q >::type *=nullptr) |
Update this vector of uint128_t from its JSON representation. More... | |
template<class Q = T> | |
void | toJSON (Json::Value &json, const typename std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type *=nullptr) const |
template<class Q = T> | |
void | toJSON (Json::Value &json, const typename std::enable_if< std::is_enum< Q >::value, Q >::type *=nullptr) const |
template<class Q = T> | |
void | toJSON (Json::Value &json, const typename std::enable_if< std::is_arithmetic< Q >::value, Q >::type *=nullptr) const |
template<class Q = T> | |
void | toJSON (Json::Value &json, const typename std::enable_if< std::is_same< Q, servus::uint128_t >::value, Q >::type *=nullptr) const |
template<class Q = T> | |
void | fromJSONBinary (const Json::Value &json, const typename std::enable_if< std::is_pod< Q >::value, Q >::type *=nullptr) |
Update this vector from its JSON, base64-encoded representation. More... | |
template<class Q = T> | |
void | toJSONBinary (Json::Value &json, const typename std::enable_if< std::is_pod< Q >::value, Q >::type *=nullptr) const |
template<class Q > | |
void | push_back (const typename std::enable_if<!std::is_base_of< Zerobuf, Q >::value, Q >::type &value) |
STL-like vector abstraction for dynamic arrays in a zerobuf.
T | element type |
|
inline |
Empty the vector.
Definition at line 179 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
Referenced by zerobuf::Vector< T >::size().
|
inline |
Remove unused memory from vector and all members.
Definition at line 91 of file Vector.h.
References zerobuf::Vector< T >::data(), zerobuf::Vector< T >::fromJSON(), zerobuf::Vector< T >::fromJSONBinary(), zerobuf::Vector< T >::size(), zerobuf::Vector< T >::toJSON(), zerobuf::Vector< T >::toJSONBinary(), and zerobuf::Allocator::updateAllocation().
|
inline |
Definition at line 45 of file Vector.h.
Referenced by zerobuf::Vector< T >::compact(), zerobuf::Vector< T >::operator==(), zerobuf::Vector< T >::operator[](), and zerobuf::Vector< T >::toJSONBinary().
|
inline |
Definition at line 48 of file Vector.h.
References zerobuf::Vector< T >::operator!=(), zerobuf::Vector< T >::operator==(), zerobuf::Vector< T >::operator[](), and zerobuf::Vector< T >::push_back().
|
inline |
|
inline |
Update this vector of ZeroBufs from its JSON representation.
Definition at line 280 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
Referenced by zerobuf::Vector< T >::compact().
|
inline |
Update this vector of enums from its JSON representation.
Definition at line 290 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
|
inline |
Update this vector of arithmetics from its JSON representation.
Definition at line 303 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
|
inline |
Update this vector of uint128_t from its JSON representation.
Definition at line 315 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
|
inline |
Update this vector from its JSON, base64-encoded representation.
Definition at line 370 of file Vector.h.
Referenced by zerobuf::Vector< T >::compact().
|
inline |
Definition at line 203 of file Vector.h.
References zerobuf::Vector< T >::operator==().
Referenced by zerobuf::Vector< T >::data().
|
inline |
Definition at line 186 of file Vector.h.
References zerobuf::Vector< T >::data().
Referenced by zerobuf::Vector< T >::data(), and zerobuf::Vector< T >::operator!=().
|
inline |
Definition at line 210 of file Vector.h.
References zerobuf::Vector< T >::data(), and zerobuf::Vector< T >::size().
Referenced by zerobuf::Vector< T >::data(), and zerobuf::Vector< T >::operator[]().
|
inline |
Definition at line 220 of file Vector.h.
References zerobuf::Vector< T >::data(), zerobuf::Vector< T >::operator[](), zerobuf::Vector< T >::push_back(), zerobuf::Vector< T >::size(), and zerobuf::Allocator::updateAllocation().
const std::enable_if< std::is_base_of<Zerobuf,Q>::value, Q >::type& zerobuf::Vector< T >::operator[] | ( | const size_t | index | ) | const |
std::enable_if< std::is_base_of< Zerobuf, Q >::value, Q >::type& zerobuf::Vector< T >::operator[] | ( | const size_t | index | ) |
void zerobuf::Vector< T >::push_back | ( | const typename std::enable_if< !std::is_base_of< Zerobuf, Q >::value, Q >::type & | ) |
Insert a builtin element at the end of the vector.
Referenced by zerobuf::Vector< T >::data(), and zerobuf::Vector< T >::operator[]().
|
inline |
Insert a Zerobuf-derived element at the end of the vector.
Definition at line 268 of file Vector.h.
References zerobuf::Allocator::updateAllocation().
|
inline |
Definition at line 39 of file Vector.h.
References zerobuf::Vector< T >::clear().
Referenced by zerobuf::Vector< T >::compact(), zerobuf::Vector< T >::operator[](), and zerobuf::Vector< T >::toJSON().
|
inline |
Definition at line 328 of file Vector.h.
References zerobuf::Vector< T >::size().
Referenced by zerobuf::Vector< T >::compact().
|
inline |
Definition at line 339 of file Vector.h.
References zerobuf::Vector< T >::size().
|
inline |
Definition at line 350 of file Vector.h.
References zerobuf::Vector< T >::size().
|
inline |
Definition at line 360 of file Vector.h.
References zerobuf::Vector< T >::size().
|
inline |
Definition at line 378 of file Vector.h.
References zerobuf::Vector< T >::data(), and zerobuf::Allocator::updateAllocation().
Referenced by zerobuf::Vector< T >::compact().