42#ifndef TEUCHOS_SERIALIZER_HELPERS_HPP
43#define TEUCHOS_SERIALIZER_HELPERS_HPP
45#include "Teuchos_Serializer.hpp"
53template <
typename Ordinal,
typename T>
59 ,
const Ordinal count,
T*
const buffer[]
83template <
typename Ordinal,
typename T>
89 ,
const Ordinal count,
const T*
const buffer[]
102 const T*
const *buffer_;
115template <
typename Ordinal,
typename T>
149template <
typename Ordinal,
typename T>
170 const char *charBuffer_;
186template <
typename Ordinal,
typename T>
189 ,
const Ordinal count,
T*
const buffer[]
193 const Ordinal
bytes = serializer_.getBufferSize(count_);
195 serializer_.serialize(count_,buffer_,
bytes,&charBuffer_[0]);
198template <
typename Ordinal,
typename T>
201 serializer_.deserialize(charBuffer_.size(),&charBuffer_[0],count_,buffer_);
204template <
typename Ordinal,
typename T>
208 return &(
const_cast<this_ptr_t>(
this)->charBuffer_)[0];
213template <
typename Ordinal,
typename T>
216 return charBuffer_.size();
223template <
typename Ordinal,
typename T>
226 ,
const Ordinal count,
const T*
const buffer[]
233 const Ordinal
bytes = serializer_.getBufferSize(count_);
235 serializer_.serialize(count_,buffer_,
bytes,&charBuffer_[0]);
238template <
typename Ordinal,
typename T>
244template <
typename Ordinal,
typename T>
247 return &charBuffer_[0];
250template <
typename Ordinal,
typename T>
253 return charBuffer_.size();
260template <
typename Ordinal,
typename T>
267 const Ordinal
extent = serializer_.getBufferSize(1);
268 const Ordinal count = bytes_ /
extent;
272 buffer_ptr_.
resize(count);
274 for(
int i = 0;
i < count; ++
i ) {
275 buffer_ptr_[
i] = serializer_.createObj();
276 buffer_[
i] = &*buffer_ptr_[
i];
278 serializer_.deserialize(
279 bytes_,charBuffer_,count,&buffer_[0]
283template <
typename Ordinal,
typename T>
286 serializer_.serialize(
287 buffer_.size(),&buffer_[0],bytes_,charBuffer_
291template <
typename Ordinal,
typename T>
295 return &(
const_cast<this_ptr_t>(
this)->buffer_)[0];
300template <
typename Ordinal,
typename T>
303 return buffer_.size();
310template <
typename Ordinal,
typename T>
317 const Ordinal
extent = serializer_.getBufferSize(1);
318 const Ordinal count = bytes_ /
extent;
322 buffer_ptr_.
resize(count);
324 for(
int i = 0;
i < count; ++
i ) {
325 buffer_ptr_[
i] = serializer_.createObj();
326 buffer_[
i] = &*buffer_ptr_[
i];
328 serializer_.deserialize(
329 bytes_,charBuffer_,count,&buffer_[0]
333template <
typename Ordinal,
typename T>
339template <
typename Ordinal,
typename T>
345template <
typename Ordinal,
typename T>
348 return buffer_.size();
Templated array class derived from the STL std::vector.
void resize(size_type new_size, const value_type &x=value_type())
Encapsulate how an array of onst objects with reference sematics is deserialized from a char[] array ...
const T *const * getBuffer() const
~ConstReferenceTypeDeserializationBuffer()
Reserialize back to the char[] buffer from the internal T*[] buffer.
Encapsulate how an array of const objects with reference sematics is serialized into a char[] array.
const char * getCharBuffer() const
~ConstReferenceTypeSerializationBuffer()
Free the internal char[] buffer (no data to be written back).
Smart reference counting pointer class for automatic garbage collection.
RCP(ENull null_arg=null)
Initialize RCP<T> to NULL.
Encapsulate how an array of non-const objects with reference sematics is deserialized from a char[] a...
T *const * getBuffer() const
~ReferenceTypeDeserializationBuffer()
Reserialize back to the char[] buffer from the internal T*[] buffer.
Encapsulate how an array of non-const objects with reference sematics is serialized into a char[] arr...
~ReferenceTypeSerializationBuffer()
Deserialize from the interal char[] buffer back to the original T*[] buffer.
char * getCharBuffer() const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...