42 #ifndef TEUCHOS_SERIALIZER_HELPERS_HPP
43 #define TEUCHOS_SERIALIZER_HELPERS_HPP
53 template <
typename Ordinal,
typename T>
59 ,
const Ordinal count, T*
const buffer[]
83 template <
typename Ordinal,
typename T>
89 ,
const Ordinal count,
const T*
const buffer[]
115 template <
typename Ordinal,
typename T>
121 ,
const Ordinal bytes,
char charBuffer[]
149 template <
typename Ordinal,
typename T>
155 ,
const Ordinal bytes,
const char charBuffer[]
186 template <
typename Ordinal,
typename T>
189 ,
const Ordinal count, T*
const buffer[]
191 :serializer_(serializer), count_(count), buffer_(buffer)
198 template <
typename Ordinal,
typename T>
201 serializer_.deserialize(charBuffer_.size(),&charBuffer_[0],count_,buffer_);
204 template <
typename Ordinal,
typename T>
208 return &(
const_cast<this_ptr_t
>(
this)->charBuffer_)[0];
213 template <
typename Ordinal,
typename T>
216 return charBuffer_.size();
223 template <
typename Ordinal,
typename T>
226 ,
const Ordinal count,
const T*
const buffer[]
228 serializer_(serializer),
238 template <
typename Ordinal,
typename T>
244 template <
typename Ordinal,
typename T>
247 return &charBuffer_[0];
250 template <
typename Ordinal,
typename T>
253 return charBuffer_.size();
260 template <
typename Ordinal,
typename T>
263 ,
const Ordinal bytes,
char charBuffer[]
265 :serializer_(serializer),bytes_(bytes),charBuffer_(charBuffer)
267 const Ordinal extent =
serializer_.getBufferSize(1);
268 const Ordinal count =
bytes_ / extent;
274 for(
int i = 0; i < count; ++i ) {
283 template <
typename Ordinal,
typename T>
286 serializer_.serialize(
287 buffer_.size(),&buffer_[0],bytes_,charBuffer_
291 template <
typename Ordinal,
typename T>
295 return &(
const_cast<this_ptr_t
>(
this)->buffer_)[0];
300 template <
typename Ordinal,
typename T>
303 return buffer_.size();
310 template <
typename Ordinal,
typename T>
313 ,
const Ordinal bytes,
const char charBuffer[]
315 :serializer_(serializer),bytes_(bytes),charBuffer_(charBuffer)
317 const Ordinal extent =
serializer_.getBufferSize(1);
318 const Ordinal count =
bytes_ / extent;
324 for(
int i = 0; i < count; ++i ) {
333 template <
typename Ordinal,
typename T>
339 template <
typename Ordinal,
typename T>
345 template <
typename Ordinal,
typename T>
348 return buffer_.size();
353 #endif // TEUCHOS_SERIALIZER_HELPERS_HPP
Strategy interface for the indirect serializing and deserializing objects of a given type handled usi...
const Serializer< Ordinal, T > & serializer_
Array< RCP< T > > buffer_ptr_t
Encapsulate how an array of non-const objects with reference sematics is deserialized from a char[] a...
ConstReferenceTypeSerializationBuffer()
Encapsulate how an array of non-const objects with reference sematics is serialized into a char[] arr...
Array< char > charBuffer_
Encapsulate how an array of onst objects with reference sematics is deserialized from a char[] array ...
const char * getCharBuffer() const
const T *const * getBuffer() const
ReferenceTypeSerializationBuffer & operator=(const ReferenceTypeSerializationBuffer &)
ReferenceTypeSerializationBuffer()
~ReferenceTypeDeserializationBuffer()
Reserialize back to the char[] buffer from the internal T*[] buffer.
ConstReferenceTypeDeserializationBuffer & operator=(const ConstReferenceTypeDeserializationBuffer &)
Encapsulate how an array of const objects with reference sematics is serialized into a char[] array...
ReferenceTypeDeserializationBuffer()
~ConstReferenceTypeDeserializationBuffer()
Reserialize back to the char[] buffer from the internal T*[] buffer.
~ConstReferenceTypeSerializationBuffer()
Free the internal char[] buffer (no data to be written back).
void resize(size_type new_size, const value_type &x=value_type())
char * getCharBuffer() const
Array< RCP< T > > buffer_ptr_t
ConstReferenceTypeSerializationBuffer & operator=(const ConstReferenceTypeSerializationBuffer &)
Templated array class derived from the STL std::vector.
ReferenceTypeDeserializationBuffer & operator=(const ReferenceTypeDeserializationBuffer &)
Array< char > charBuffer_
T *const * getBuffer() const
const Serializer< Ordinal, T > & serializer_
const Serializer< Ordinal, T > & serializer_
const Serializer< Ordinal, T > & serializer_
#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...
~ReferenceTypeSerializationBuffer()
Deserialize from the interal char[] buffer back to the original T*[] buffer.
ConstReferenceTypeDeserializationBuffer()