 |
GridGain C++
|
Go to the documentation of this file.
22 #ifndef _IGNITE_BINARY_BINARY_CONTAINERS
23 #define _IGNITE_BINARY_BINARY_CONTAINERS
27 #include <ignite/common/utils.h>
29 #include "ignite/impl/binary/binary_writer_impl.h"
30 #include "ignite/impl/binary/binary_reader_impl.h"
66 void Write(
const char* val);
76 void Write(
const char* val, int32_t len);
85 void Write(
const std::string& val)
102 impl::binary::BinaryWriterImpl* impl;
145 impl->WriteElement<T>(id, val);
158 impl->CommitContainer(
id);
163 impl::binary::BinaryWriterImpl* impl;
206 impl->WriteElement<T>(id, val);
219 impl->CommitContainer(
id);
223 impl::binary::BinaryWriterImpl* impl;
239 template<
typename K,
typename V>
264 void Write(
const K& key,
const V& val)
266 impl->WriteElement<K, V>(id, key, val);
278 impl->CommitContainer(
id);
282 impl::binary::BinaryWriterImpl* impl;
329 int32_t GetNext(
char* res, int32_t len);
340 int32_t len = GetNext(NULL, 0);
344 ignite::common::FixedSizeArray<char> arr(len + 1);
346 GetNext(arr.GetData(),
static_cast<int32_t
>(arr.GetSize()));
348 return std::string(arr.GetData());
351 return std::string();
359 int32_t GetSize()
const;
370 impl::binary::BinaryReaderImpl* impl;
400 impl(impl), id(id), size(size)
412 return impl->HasNextElement(
id);
424 return impl->ReadElement<T>(id);
448 impl::binary::BinaryReaderImpl* impl;
492 return impl->HasNextElement(
id);
504 return impl->ReadElement<T>(id);
539 impl::binary::BinaryReaderImpl* impl;
559 template<
typename K,
typename V>
573 int32_t size) : impl(impl), id(id), type(type), size(size)
585 return impl->HasNextElement(
id);
600 return impl->ReadElement<K, V>(id, key, val);
635 impl::binary::BinaryReaderImpl* impl;
649 #endif //_IGNITE_BINARY_BINARY_CONTAINERS
void Close()
Close the writer.
Definition: binary_containers.h:217
Ignite API.
Definition: cache.h:47
BinaryMapWriter(impl::binary::BinaryWriterImpl *impl, int32_t id)
Constructor.
Definition: binary_containers.h:250
Binary string array writer.
Definition: binary_containers.h:47
Type
Definition: binary_consts.h:68
void Write(const T &val)
Write a value.
Definition: binary_containers.h:204
void Write(const std::string &val)
Write string.
Definition: binary_containers.h:85
BinaryCollectionReader(impl::binary::BinaryReaderImpl *impl, int32_t id, const CollectionType::Type type, int32_t size)
Constructor.
Definition: binary_containers.h:479
BinaryArrayWriter(impl::binary::BinaryWriterImpl *impl, int32_t id)
Constructor.
Definition: binary_containers.h:130
Binary collection reader.
Definition: binary_containers.h:467
T GetNext()
Read next element.
Definition: binary_containers.h:422
int32_t GetSize()
Get collection size.
Definition: binary_containers.h:523
Binary map reader.
Definition: binary_containers.h:560
void Close()
Close the writer.
Definition: binary_containers.h:276
bool IsNull()
Check whether collection is NULL.
Definition: binary_containers.h:533
BinaryCollectionWriter(impl::binary::BinaryWriterImpl *impl, int32_t id)
Constructor.
Definition: binary_containers.h:191
void Close()
Close the writer.
Definition: binary_containers.h:156
int32_t GetSize()
Get array size.
Definition: binary_containers.h:432
Binary array writer.
Definition: binary_containers.h:120
bool IsNull()
Check whether array is NULL.
Definition: binary_containers.h:442
Binary array reader.
Definition: binary_containers.h:388
bool HasNext()
Check whether next element is available for read.
Definition: binary_containers.h:583
Binary collection writer.
Definition: binary_containers.h:181
void Write(const T &val)
Write a value.
Definition: binary_containers.h:143
bool IsNull()
Check whether map is NULL.
Definition: binary_containers.h:629
Binary string array reader.
Definition: binary_containers.h:296
Binary map writer.
Definition: binary_containers.h:240
Type
Definition: binary_consts.h:34
bool HasNext()
Check whether next element is available for read.
Definition: binary_containers.h:490
BinaryArrayReader(impl::binary::BinaryReaderImpl *impl, int32_t id, int32_t size)
Constructor.
Definition: binary_containers.h:399
std::string GetNext()
Get next element.
Definition: binary_containers.h:338
T GetNext()
Read next element.
Definition: binary_containers.h:502
BinaryMapReader(impl::binary::BinaryReaderImpl *impl, int32_t id, MapType::Type type, int32_t size)
Constructor.
Definition: binary_containers.h:572
void GetNext(K &key, V &val)
Read next element.
Definition: binary_containers.h:598
bool HasNext()
Check whether next element is available for read.
Definition: binary_containers.h:410
int32_t GetSize()
Get map size.
Definition: binary_containers.h:619
MapType::Type GetType()
Get map type.
Definition: binary_containers.h:609
void Write(const K &key, const V &val)
Write a map entry.
Definition: binary_containers.h:264
CollectionType::Type GetType()
Get collection type.
Definition: binary_containers.h:513