libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization Class Reference

This class de-serializes a RBSCMEvaluation object using the Cap'n Proto library. More...

#include <rb_data_deserialization.h>

Public Member Functions

 RBSCMEvaluationDeserialization (RBSCMEvaluation &trans_rb_eval)
 Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp. More...
 
virtual ~RBSCMEvaluationDeserialization ()
 Destructor. More...
 
void read_from_file (const std::string &path)
 Write the Cap'n'Proto buffer to disk. More...
 

Private Attributes

RBSCMEvaluation_rb_scm_eval
 The RBSCMEvaluation object we will read into. More...
 

Detailed Description

This class de-serializes a RBSCMEvaluation object using the Cap'n Proto library.

Definition at line 158 of file rb_data_deserialization.h.

Constructor & Destructor Documentation

libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization::RBSCMEvaluationDeserialization ( RBSCMEvaluation trans_rb_eval)

Initialize a new buffer using the structure from the Cap'n'Proto schema described in rb_data.capnp.

Definition at line 204 of file rb_data_deserialization.C.

Referenced by libMesh::RBDataDeserialization::RBEIMEvaluationDeserialization::read_from_file().

204  :
205  _rb_scm_eval(rb_scm_eval)
206 {}
RBSCMEvaluation & _rb_scm_eval
The RBSCMEvaluation object we will read into.
libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization::~RBSCMEvaluationDeserialization ( )
virtual

Destructor.

Definition at line 208 of file rb_data_deserialization.C.

209 {}

Member Function Documentation

void libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization::read_from_file ( const std::string &  path)

Write the Cap'n'Proto buffer to disk.

Definition at line 211 of file rb_data_deserialization.C.

References _rb_scm_eval, libMesh::RBDataDeserialization::load_rb_scm_evaluation_data(), and std::max().

Referenced by main().

212 {
213  LOG_SCOPE("read_from_file()", "RBSCMEvaluationDeserialization");
214 
215  int fd = open(path.c_str(), O_RDONLY);
216  if (!fd)
217  libmesh_error_msg("Couldn't open the buffer file: " + path);
218 
219  // Turn off the limit to the amount of data we can read in
220  capnp::ReaderOptions reader_options;
221  reader_options.traversalLimitInWords = std::numeric_limits<uint64_t>::max();
222 
223  capnp::StreamFdMessageReader message(fd, reader_options);
224 
225  RBData::RBSCMEvaluation::Reader rb_scm_eval_reader =
226  message.getRoot<RBData::RBSCMEvaluation>();
227 
229  rb_scm_eval_reader);
230 }
RBSCMEvaluation & _rb_scm_eval
The RBSCMEvaluation object we will read into.
void load_rb_scm_evaluation_data(RBSCMEvaluation &rb_scm_eval, RBData::RBSCMEvaluation::Reader &rb_scm_eval_reader)
Load an SCM RB evaluation from a corresponding reader structure in the buffer.
long double max(long double a, double b)

Member Data Documentation

RBSCMEvaluation& libMesh::RBDataDeserialization::RBSCMEvaluationDeserialization::_rb_scm_eval
private

The RBSCMEvaluation object we will read into.

Definition at line 183 of file rb_data_deserialization.h.

Referenced by read_from_file().


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