MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Conv< string > Class Template Reference

#include <Conv.h>

+ Collaboration diagram for Conv< string >:

Static Public Member Functions

static const string buf2val (double **buf)
 
static string rttiType ()
 
static unsigned int size (const string &val)
 
static void str2val (string &val, const string &s)
 
static void val2buf (const string &val, double **buf)
 
static void val2str (string &s, const string &val)
 

Detailed Description

template<>
class Conv< string >

This stores the data as the equivalent of a char* string, terminated with the usual \0, but allocates it as a double[].

Definition at line 113 of file Conv.h.

Member Function Documentation

static const string Conv< string >::buf2val ( double **  buf)
inlinestatic

Definition at line 130 of file Conv.h.

References Conv< T >::size().

130  {
131  static string ret;
132  ret = reinterpret_cast< const char* >( *buf );
133  *buf += size( ret );
134  return ret;
135  }
static unsigned int size(const string &val)
Definition: Conv.h:122

+ Here is the call graph for this function:

static string Conv< string >::rttiType ( )
inlinestatic

Definition at line 157 of file Conv.h.

157  {
158  return "string";
159  }
static unsigned int Conv< string >::size ( const string &  val)
inlinestatic

This is the size used in the serialized form, as a double* Note that we do some ugly stuff to get alignment on 8-byte boundaries. We need to have strlen + 1 as a minimum.

Definition at line 122 of file Conv.h.

123  {
124  // extra char for termination of the string.
125  return 1 + val.length() / sizeof( double );
126  }
static void Conv< string >::str2val ( string &  val,
const string &  s 
)
inlinestatic

Definition at line 149 of file Conv.h.

149  {
150  val = s;
151  }
static void Conv< string >::val2buf ( const string &  val,
double **  buf 
)
inlinestatic

Converts data contents into double* buf. Buf must be allocated ahead of time. Returns size of value. Needs to be specialized for variable size and pointer-containing types T.

Definition at line 143 of file Conv.h.

References Conv< T >::size().

143  {
144  char* temp = reinterpret_cast< char* >( *buf );
145  strcpy( temp, val.c_str() );
146  *buf += size( val );
147  }
static unsigned int size(const string &val)
Definition: Conv.h:122

+ Here is the call graph for this function:

static void Conv< string >::val2str ( string &  s,
const string &  val 
)
inlinestatic

Definition at line 153 of file Conv.h.

153  {
154  s = val;
155  }

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