src/cdi_analytic/Analytic_Gray_Opacity.cc
Analytic_Gray_Opacity::sf_char Analytic_Gray_Opacity::pack() const {
  Require(analytic_model);

  // make a packer
  rtt_dsxx::Packer packer;

  // first pack up the analytic model
  sf_char anal_model = analytic_model->pack();

  // now add up the total size (in bytes): size of analytic model + 3
  // int--one for reaction type, one for model type, and one for size of
  // analytic model
  Check(anal_model.size() + 3 * sizeof(int) < INT_MAX);
  int size = static_cast<int>(anal_model.size() + 3 * sizeof(int));

  // make a char array
  sf_char packed(size);

  // set the buffer
  packer.set_buffer(size, &packed[0]);

  // pack the anal_model size
  packer << static_cast<int>(anal_model.size());

  // now pack the anal model
  for (auto &am : anal_model)
    packer << am;

  // pack the reaction and model type
  packer << static_cast<int>(reaction) << static_cast<int>(model);

  Ensure(packer.get_ptr() == &packed[0] + size);
  return packed;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Pack an analytic gray opacity.
 *
 * This function will pack up the Analytic_Gray_Opacity into a char array
 * (represented by a vector<char>).  The Analytic_Opacity_Model derived class
 * must have a pack function; this is enforced by the virtual
 * Analytic_Opacity_Model base class.
 */
\brief Pack an analytic gray opacity.
This function will pack up the Analytic_Gray_Opacity into a char array
(represented by a vector).  The Analytic_Opacity_Model derived class
must have a pack function; this is enforced by the virtual
Analytic_Opacity_Model base class.
\ brief Pack an analytic gray opacity . This function will pack up the Analytic_Gray_Opacity into a char array ( represented by a vector ) . The Analytic_Opacity_Model derived class must have a pack function ; this is enforced by the virtual Analytic_Opacity_Model base class .
Analytic_Gray_Opacity::sf_char Analytic_Gray_Opacity::pack() const {
  Require(analytic_model);
  rtt_dsxx::Packer packer;
  sf_char anal_model = analytic_model->pack();
  Check(anal_model.size() + 3 * sizeof(int) < INT_MAX);
  int size = static_cast<int>(anal_model.size() + 3 * sizeof(int));
  sf_char packed(size);
  packer.set_buffer(size, &packed[0]);
  packer << static_cast<int>(anal_model.size());
  for (auto &am : anal_model)
    packer << am;
  packer << static_cast<int>(reaction) << static_cast<int>(model);
  Ensure(packer.get_ptr() == &packed[0] + size);
  return packed;
}
Analytic_Gray_Opacity :: sf_char Analytic_Gray_Opacity :: pack ( ) const { Require ( analytic_model ) ; rtt_dsxx :: Packer packer ; sf_char anal_model = analytic_model -> pack ( ) ; Check ( anal_model . size ( ) + 3 * sizeof ( int ) < INT_MAX ) ; int size = static_cast < int > ( anal_model . size ( ) + 3 * sizeof ( int ) ) ; sf_char packed ( size ) ; packer . set_buffer ( size , & packed [ 0 ] ) ; packer << static_cast < int > ( anal_model . size ( ) ) ; for ( auto & am : anal_model ) packer << am ; packer << static_cast < int > ( reaction ) << static_cast < int > ( model ) ; Ensure ( packer . get_ptr ( ) == & packed [ 0 ] + size ) ; return packed ; }
\brief Pack an analytic gray opacity.
\ brief Pack an analytic gray opacity .
// make a packer // first pack up the analytic model // now add up the total size (in bytes): size of analytic model + 3 // int--one for reaction type, one for model type, and one for size of // analytic model // make a char array // set the buffer // pack the anal_model size // now pack the anal model // pack the reaction and model type