www.mooseframework.org
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
libMesh::Parallel::Packing< std::basic_string< T > > Class Template Reference

#include <DataIO.h>

Public Types

typedef T buffer_type
 

Static Public Member Functions

static unsigned int get_string_len (typename std::vector< T >::const_iterator in)
 
static unsigned int packed_size (typename std::vector< T >::const_iterator in)
 
static unsigned int packable_size (const std::basic_string< T > &s, const void *)
 
template<typename Iter >
static void pack (const std::basic_string< T > &b, Iter data_out, const void *)
 
static std::basic_string< T > unpack (typename std::vector< T >::const_iterator in, void *)
 

Static Public Attributes

static const unsigned int size_bytes = 4
 

Detailed Description

template<typename T>
class libMesh::Parallel::Packing< std::basic_string< T > >

Definition at line 685 of file DataIO.h.

Member Typedef Documentation

template<typename T >
typedef T libMesh::Parallel::Packing< std::basic_string< T > >::buffer_type

Definition at line 690 of file DataIO.h.

Member Function Documentation

template<typename T >
static unsigned int libMesh::Parallel::Packing< std::basic_string< T > >::get_string_len ( typename std::vector< T >::const_iterator  in)
inlinestatic

Definition at line 692 of file DataIO.h.

693  {
694  unsigned int string_len = reinterpret_cast<const unsigned char &>(in[size_bytes - 1]);
695  for (signed int i = size_bytes - 2; i >= 0; --i)
696  {
697  string_len *= 256;
698  string_len += reinterpret_cast<const unsigned char &>(in[i]);
699  }
700  return string_len;
701  }
template<typename T >
template<typename Iter >
static void libMesh::Parallel::Packing< std::basic_string< T > >::pack ( const std::basic_string< T > &  b,
Iter  data_out,
const void *   
)
inlinestatic

Definition at line 714 of file DataIO.h.

715  {
716  unsigned int string_len = b.size();
717  for (unsigned int i = 0; i != size_bytes; ++i)
718  {
719  *data_out++ = (string_len % 256);
720  string_len /= 256;
721  }
722 
723  std::copy(b.begin(), b.end(), data_out);
724  }
template<typename T >
static unsigned int libMesh::Parallel::Packing< std::basic_string< T > >::packable_size ( const std::basic_string< T > &  s,
const void *   
)
inlinestatic

Definition at line 708 of file DataIO.h.

709  {
710  return s.size() + size_bytes;
711  }
template<typename T >
static unsigned int libMesh::Parallel::Packing< std::basic_string< T > >::packed_size ( typename std::vector< T >::const_iterator  in)
inlinestatic

Definition at line 703 of file DataIO.h.

704  {
705  return get_string_len(in) + size_bytes;
706  }
static unsigned int get_string_len(typename std::vector< T >::const_iterator in)
Definition: DataIO.h:692
template<typename T >
static std::basic_string<T> libMesh::Parallel::Packing< std::basic_string< T > >::unpack ( typename std::vector< T >::const_iterator  in,
void *   
)
inlinestatic

Definition at line 726 of file DataIO.h.

727  {
728  unsigned int string_len = get_string_len(in);
729 
730  std::ostringstream oss;
731  for (unsigned int i = 0; i < string_len; ++i)
732  oss << reinterpret_cast<const unsigned char &>(in[i + size_bytes]);
733 
734  in += size_bytes + string_len;
735 
736  return oss.str();
737  }
static unsigned int get_string_len(typename std::vector< T >::const_iterator in)
Definition: DataIO.h:692

Member Data Documentation

template<typename T >
const unsigned int libMesh::Parallel::Packing< std::basic_string< T > >::size_bytes = 4
static

Definition at line 688 of file DataIO.h.


The documentation for this class was generated from the following file: