<commit_before>//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   core/Messenger.hh
 * \author <NAME>
 * \date   Thu May 26 11:02:57 2011
 * \brief  Messenger class definition.
 * \note   Copyright (C) 2011 Oak Ridge National Laboratory, UT-Battelle, LLC.
 */
//---------------------------------------------------------------------------//
// $Id: template.hh,v 1.4 2008/01/02 17:18:47 9te Exp $
//---------------------------------------------------------------------------//

#ifndef core_Messenger_hh
#define core_Messenger_hh

#include <string>
#include <list>

#include "Transfer_Map.hh"
#include "Message_Buffer.hh"
#include "Physics.hh"
#include "utils/SP.hh"
#include "utils/Packing_Utils.hh"
#include "comm/global.hh"

namespace coupler
{

//===========================================================================//
/*!
 * \class Messenger
 * \brief A Messenger class to send and receive field data in a map
 *
 * \sa Messenger.cc for detailed descriptions.
 */
/*! 
 * \example coupler/test/tstMessenger.cc
 *
 * Test of Messenger.
 */
//===========================================================================//

template<class DataType_T>
class Messenger 
{
  public:   
    //@{
    //! Useful Typedefs.
    typedef DataType_T                          DataType;
    typedef int                                 HandleType;
    typedef int                                 OrdinateType;
    typedef Message_Buffer<OrdinateType>        Message_Buffer_t;
    typedef typename Message_Buffer_t::Buffer   Buffer;
    typedef std::list<Message_Buffer_t>         BufferList;
    typedef typename BufferList::iterator       BufferList_Iterator;
    typedef denovo::SP<Physics>                 SP_Physics;
    typedef nemesis::Communicator_t             Communicator;
    //@}
    
  private:

    // Global communicator.
    const Communicator &d_comm_global;

    // Field name.
    const std::string &d_field_name;

    // Source physics.
    SP_Physics d_source;

    // Target physics.
    SP_Physics d_target;

 public:

    // Constructor.
    Messenger(const Communicator &comm_global,
	      const std::string &field_name,
	      SP_Physics source,
	      SP_Physics target);

    // Communicate the field from the source to the target.
    void communicate();

  private:<commit_msg>Finished messenger update. unit test not update.<commit_after>//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   core/Messenger.hh
 * \author <NAME>
 * \date   Thu May 26 11:02:57 2011
 * \brief  Messenger class definition.
 * \note   Copyright (C) 2011 Oak Ridge National Laboratory, UT-Battelle, LLC.
 */
//---------------------------------------------------------------------------//
// $Id: template.hh,v 1.4 2008/01/02 17:18:47 9te Exp $
//---------------------------------------------------------------------------//

#ifndef core_Messenger_hh
#define core_Messenger_hh

#include <string>
#include <list>

#include "Transfer_Map.hh"
#include "Message_Buffer.hh"
#include "Physics.hh"
#include "utils/SP.hh"
#include "utils/Packing_Utils.hh"
#include "comm/global.hh"

namespace coupler
{

//===========================================================================//
/*!
 * \class Messenger
 * \brief A Messenger class to send and receive field data in a map
 *
 * \sa Messenger.cc for detailed descriptions.
 */
/*! 
 * \example coupler/test/tstMessenger.cc
 *
 * Test of Messenger.
 */
//===========================================================================//

template<class DataType_T>
class Messenger 
{
  public:   
    //@{
    //! Useful Typedefs.
    typedef DataType_T                            DataType;
    typedef int                                   HandleType;
    typedef int                                   OrdinateType;
    typedef Message_Buffer<OrdinateType>          Message_Buffer_t;
    typedef typename Message_Buffer_t::Buffer     Buffer;
    typedef std::list<Message_Buffer_t>           BufferList;
    typedef typename BufferList::iterator         BufferList_Iterator;
    typedef denovo::SP<Physics>                   SP_Physics;
    typedef nemesis::Communicator_t               Communicator;
    typedef typename Transfer_Map::Map_Iterator   Map_Iterator;
    typedef typename Transfer_Map::Map_Pair       Map_Pair;
    typedef typename Transfer_Map::Set_Iterator   Set_Iterator;
    typedef typename Transfer_Map::Set_Pair       Set_Pair;
    //@}
    
  private:

    // Global communicator.
    const Communicator &d_comm_global;

    // Field name.
    const std::string &d_field_name;

    // Source physics.
    SP_Physics d_source;

    // Target physics.
    SP_Physics d_target;

 public:

    // Constructor.
    Messenger(const Communicator &comm_global,
	      const std::string &field_name,
	      SP_Physics source,
	      SP_Physics target);

    // Communicate the field from the source to the target.
    void communicate();

  private:
{'fraction_non_alphanumeric': 0.2364255660188339, 'fraction_numerical': 0.013223802845121218, 'mean_word_length': 1.9520993494973389, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '474462', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1292, 'n_words': 337}