Skip to content
Snippets Groups Projects
CTransport.h 1.36 KiB
Newer Older
wfg's avatar
wfg committed
/*
 * CTransport.h
 *
 *  Created on: Oct 6, 2016
 *      Author: wfg
 */

#ifndef CTRANSPORT_H_
#define CTRANSPORT_H_

/// \cond EXCLUDE_FROM_DOXYGEN
wfg's avatar
wfg committed
#include <string>

#ifdef HAVE_MPI
    #include <mpi.h>
#else
    #include "public/mpidummy.h"
#endif
#include "core/CVariableBase.h"

wfg's avatar
wfg committed
namespace adios
{

class CTransport
{

public:

    const std::string m_Method;  ///< method name, must be defined in SSupport.h TransportMethods
wfg's avatar
wfg committed
    const unsigned int m_Priority;
    const unsigned int m_Iteration;
    MPI_Comm m_MPIComm;

wfg's avatar
wfg committed
    std::string m_FileName; ///< file name associated with a group that owns the transport
wfg's avatar
wfg committed

    CTransport( const std::string method, const unsigned int priority, const unsigned int iteration,
                MPI_Comm mpiComm ):
wfg's avatar
wfg committed
        m_Method( method ),
        m_Priority( priority ),
        m_Iteration( iteration ),
        m_MPIComm( mpiComm )
wfg's avatar
wfg committed
    { }

    virtual ~CTransport( )
    { }

    /**
     * Open Output file accesing a mode
     * @param fileName name of file
     * @param accessMode r or read, w or write, a or append
     */
    virtual void Open( const std::string fileName, const std::string accessMode ) = 0;
    virtual void Write( const CVariableBase& variable ){ };

    virtual void Close( ) = 0; //here think what needs to be passed
wfg's avatar
wfg committed
};



} //end namespace



#endif /* CTRANSPORT_H_ */