Commit 49918f2b authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

improved documentation

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1070
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent fa8e9c28
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: complexio.h,v 1.1 2002-11-20 14:10:05 forbrig Exp $
* $Id: complexio.h,v 1.2 2002-11-20 14:57:49 forbrig Exp $
* \author Thomas Forbriger
* \date 20/11/2002
*
......@@ -23,7 +23,7 @@
#define TF_COMPLEXIO_H_VERSION \
"TF_COMPLEXIO_H V1.0 "
#define TF_COMPLEXIO_H_CVSID \
"$Id: complexio.h,v 1.1 2002-11-20 14:10:05 forbrig Exp $"
"$Id: complexio.h,v 1.2 2002-11-20 14:57:49 forbrig Exp $"
#include<complex>
#include<tfxx/fortranio.h>
......@@ -50,13 +50,16 @@ namespace tfxx {
namespace fortranio {
/*! \brief Output operator template for class FortranBinOutput \ingroup
* group_fortranio
/*! \brief Output operator template for class FortranBinOutput
*
* \ingroup * group_fortranio
*
* It is quite save to present this operator in the global namespace. This
* is just function overloading. The compiler will decide which operator
* we need be the FortranBinOutput object involved. An this way using the
* operator function is most convenient.
*
* \anchor fortranio_opout
*/
template<typename T>
tfxx::fortranio::FortranBinOutput&
......@@ -68,13 +71,16 @@ namespace tfxx {
return(fo);
}
/*! \brief Input operator template for class FortranBinInput \ingroup
* group_fortranio
/*! \brief Input operator template for class FortranBinInput
*
* \ingroup group_fortranio
*
* It is quite save to present this operator in the global namespace. This
* is just function overloading. The compiler will decide which operator
* we need be the FortranBinInput object involved. An this way using the
* operator function is most convenient.
*
* \anchor fortranio_opin
*/
template<typename T>
tfxx::fortranio::FortranBinInput&
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: fortranio.cc,v 1.4 2002-11-19 22:09:37 forbrig Exp $
* $Id: fortranio.cc,v 1.5 2002-11-20 14:57:49 forbrig Exp $
* \author Thomas Forbriger
* \date 13/01/2002
*
......@@ -27,7 +27,7 @@
#define TF_FORTRANIO_CC_VERSION \
"TF_FORTRANIO_CC V1.0 "
#define TF_FORTRANIO_CC_CVSID \
"$Id: fortranio.cc,v 1.4 2002-11-19 22:09:37 forbrig Exp $"
"$Id: fortranio.cc,v 1.5 2002-11-20 14:57:49 forbrig Exp $"
#include <tfxx/fortranio.h>
#include <tfxx/misc.h>
......@@ -51,8 +51,15 @@ namespace fortranio {
// unnamed namespace to hide this function
namespace {
// abort if byte count at end of block does not match the count at the
// beginning
/*! \brief abort if byte count at end of block does not match the count at
* the beginning
*
* \note
* This function is only used internally by
* \c FortranBinInput::read_block_size().
* It will be replaced in future versions by throwing an appropriate
* exception class.
*/
void bytecountmismatch()
{
cerr << "FortranBinInput: Byte count mismatch in file!" << endl;
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: fortranio.h,v 1.9 2002-11-20 14:10:06 forbrig Exp $
* $Id: fortranio.h,v 1.10 2002-11-20 14:57:50 forbrig Exp $
* \author Thomas Forbriger
* \date 13/01/2002
*
......@@ -28,7 +28,7 @@
#define TF_FORTRANIO_H_VERSION \
"TF_ V1.0 "
#define TF_FORTRANIO_H_CVSID \
"$Id: fortranio.h,v 1.9 2002-11-20 14:10:06 forbrig Exp $"
"$Id: fortranio.h,v 1.10 2002-11-20 14:57:50 forbrig Exp $"
#include<tfxx/misc.h>
#include<fstream>
......@@ -39,16 +39,51 @@ namespace tfxx {
/*! \defgroup group_fortranio FORTRAN I/O functions
* \brief FORTRAN file data input and output functions
*
* \since November 2002
*
* The functions in this group serve mainly to read FORTRAN binary data files
* into C++ variables or arrays. There may be also writing functions and
* functions for FORTRAN formatted ASCII files added.
* This module makes extensive use of the \ref group_ioswap
*
* I/O is most easily accomplished by using the overloaded versions of the I/O
* \ref fortranio_opin "input" and \ref fortranio_opout "output"
* operators. For I/O of complex types specialized versions are presented in
* complexio.h. These operators are placed in the global namespace.
*
* \anchor anchor_fortranio_firsttest
* \par Test of I/O-routines
* The I/O routines where testet on 20/11/2002. The test code may be found in
* tests/fortraniotest.cc, which is documented in \ref example_fortraniotest,
* and in tests/fortranF77.f, which is the Fortran 77 part of the test module.
* The Fortran part was compiled and run on two systems:
*
* -# \c AIX \c geo31 \c 3 \c 4 \c 002030455700 (Motorola CPU)
* -# \c Linux \c geo19 \c 2.4.4-64GB-SMP \c #1 \c SMP \c i686 \c unknown
* (Intel CPU)
*
* The C++ part of the test was only compiled on the Linux machine. The test
* was successfully passed for magic numbers, I/O and byteswapping I/O
* (from/to Fortran77/C++ and Motorola/Intel) performed with the following C++
* types:
*
* -# int
* -# long int
* -# long long int
* -# float
* -# double
* -# complex<float>
* -# complex<double>
*
* \sa example_fortraniotest
* \sa tfxx::fortranio::FortranBinInput& operator<<(tfxx::fortranio::FortranBinInput&, T&)
* \sa tfxx::fortranio::FortranBinInput& * operator>>(tfxx::fortranio::FortranBinInput&, const T&)
*/
/*! \brief contains all FORTRAN file data input output functions
* \ingroup group_fortranio
* \sa example_fortraniotest
* \sa group_fortranio
*/
namespace fortranio {
......@@ -207,6 +242,8 @@ template<typename T>
* just function overloading. The compiler will decide which operator we need
* be the FortranBinOutput object involved. An this way using the operator
* function is most convenient.
*
* \anchor fortranio_opout
*/
template<typename T>
tfxx::fortranio::FortranBinOutput&
......@@ -223,6 +260,8 @@ template<typename T>
* just function overloading. The compiler will decide which operator we need
* be the FortranBinInput object involved. An this way using the operator
* function is most convenient.
*
* \anchor fortranio_opin
*/
template<typename T>
tfxx::fortranio::FortranBinInput&
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: misc.h,v 1.7 2002-11-19 22:09:37 forbrig Exp $
* $Id: misc.h,v 1.8 2002-11-20 14:57:50 forbrig Exp $
* \author Thomas Forbriger
* \date 18/11/2002
*
......@@ -24,7 +24,7 @@
#define TF_MISC_H_VERSION \
"TF_MISC_H V1.0 "
#define TF_MISC_H_CVSID \
"$Id: misc.h,v 1.7 2002-11-19 22:09:37 forbrig Exp $"
"$Id: misc.h,v 1.8 2002-11-20 14:57:50 forbrig Exp $"
// we include fstream, because all function are closely related to file I/O
// and file_magic definitely requires fstream
......@@ -35,6 +35,8 @@ namespace tfxx {
/*! \namespace tfxx::ioswap
* \brief All facilities for checking bytesex and swapping input binary data.
*
* \since November 2002
*
* \sa example_fortraniotest
*
* \warning
......@@ -47,14 +49,18 @@ namespace ioswap {
/*! \defgroup group_ioswap I/O byte swapping facility.
* \brief Provides function to check bytesex and swap input bytes.
*
* \sa example_fortraniotest
*
* When working in a multi-CPU-model environment, data written on one host
* (with Intel CPU e.g.) can not easily be read on a different host (with
* Motorola CPU e.g.) when using binary data. In this group we provide
* facilities to check bytesex of datafiles and perform byte-swapping if
* necessary.
*
* \ref anchor_fortranio_firsttest "Tests on this module" were performed
* within tests of the \ref group_fortranio.
*
* \sa example_fortraniotest
* \sa group_fortranio
*
* The components are collected in namespace tfxx::ioswap.
* @{
*/
......
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.5 2002-11-20 14:17:35 forbrig Exp $
# $Id: Makefile,v 1.6 2002-11-20 14:57:51 forbrig Exp $
#
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
#
......@@ -96,6 +96,7 @@ fortraniotestintel: fortranF77.g77 fortraniotest
-./fortraniotest -v -c -s -C -w=junkintelxx -r=junkintelxx
-./fortraniotest -v -r=junkintel
-./fortraniotest -v -r=junkaix
-./fortranF77.g77 -v -r junkintelxx
fortraniotest%.out:
$(MAKE) $(patsubst %.out,%,$@) > $@ 2>&1
......
c this is <fortranF77.f>
c ----------------------------------------------------------------------------
c ($Id: fortranF77.f,v 1.3 2002-11-20 14:10:07 forbrig Exp $)
c ($Id: fortranF77.f,v 1.4 2002-11-20 14:57:51 forbrig Exp $)
c
c Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
c
......@@ -8,6 +8,7 @@ c Fortran part of the Fortran I/O test routines
c
c REVISIONS and CHANGES
c 15/11/2002 V1.0 Thomas Forbriger
c 20/11/2002 V1.1 passed tests on AIX and Intel Linux
c
c ============================================================================
c
......@@ -18,7 +19,7 @@ c
& 'FORTRANF77 V1.0 Fortran I/O test routines')
character*(*) FORTRANF77_CVS_ID
parameter(FORTRANF77_CVS_ID=
& '$Id: fortranF77.f,v 1.3 2002-11-20 14:10:07 forbrig Exp $')
& '$Id: fortranF77.f,v 1.4 2002-11-20 14:57:51 forbrig Exp $')
c
c
logical optread,optwrite
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: fortraniotest.cc,v 1.7 2002-11-20 14:10:07 forbrig Exp $
* $Id: fortraniotest.cc,v 1.8 2002-11-20 14:57:52 forbrig Exp $
* \author Thomas Forbriger
* \date 15/11/2002
*
......@@ -13,13 +13,14 @@
*
* REVISIONS and CHANGES
* - 15/11/2002 V1.0 Thomas Forbriger
* - 20/11/2002 V1.1 passed tests on AIX and Intel Linux
*
* ============================================================================
*/
#define FORTRANIOTEST_VERSION \
"FORTRANIOTEST V1.0 C++ part of the Fortran I/O test routines"
"FORTRANIOTEST V1.1 C++ part of the Fortran I/O test routines"
#define FORTRANIOTEST_CVSID \
"$Id: fortraniotest.cc,v 1.7 2002-11-20 14:10:07 forbrig Exp $"
"$Id: fortraniotest.cc,v 1.8 2002-11-20 14:57:52 forbrig Exp $"
#include <iostream>
#include <cassert>
......@@ -38,6 +39,7 @@ using std::endl;
*/
/*----------------------------------------------------------------------*/
/*! \brief Function template to test dry byte swapping.
* \ingroup example_fortranio
*
* \param T generic type to be used during test
*
......@@ -79,6 +81,7 @@ void test_swap()
}
/*! \brief Macro function to preform easy to use swap check.
* \ingroup example_fortranio
*
* \param T type to be used
*/
......@@ -88,6 +91,7 @@ void test_swap()
test_swap<T>();
/*! \brief Ask for CPU type and print result
* \ingroup example_fortranio
*/
void cpu_type()
{
......@@ -110,7 +114,8 @@ void cpu_type()
const char mymagic[]="ABCD";
/*! write test data
/*! \brief write test data
* \ingroup example_fortranio
*/
void write_data(const std::string& name, const bool& verbose=false)
{
......@@ -146,7 +151,8 @@ void write_data(const std::string& name, const bool& verbose=false)
<< dcplx << ", " << scplx << endl;;
}
/*! read test data
/*! \brief read test data
* \ingroup example_fortranio
*/
void read_data(const std::string& name, const bool& verbose=false)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment