Definition of H5Fed C++ interface, class definition and implementation, first material.

This commit is contained in:
Benedikt Oswald
2007-12-17 10:45:21 +00:00
parent 921469eba8
commit dfebe64c73
2 changed files with 198 additions and 0 deletions
+90
View File
@@ -0,0 +1,90 @@
/*
Implementation file for implementing the H5Fed application programming
interface (API) in the C++ language.
Copyright 2006-2007
Paul Scherrer Institut, Villigen, Switzerland;
Benedikt Oswald;
Achim Gsell
All rights reserved.
Authors
Benedikt Oswald, Achim Gsell
Warning
This code is under development.
*/
/*!
Some conventions:
Functions:
Name:
ThisIsAFunction()
Return values:
-1 or NULL signals an error
\note
In function names we use the words \b get and \b store insteed of
\b read and \b write, because no I/O is actually done in these
functions.
*/
/** include proprietary header files */
#include <H5Fed.hh>
/** activate namespaces */
using namespace H5Fed;
using namespace std;
/** \brief implement constructor without arguments */
H5Fed::H5Fed()
{
/** initialize internal variables */
filename_.erase();
}
/** \brief implement constructor without arguments */
H5Fed::H5Fed(std::string filename)
{
/** initialize internal variables */
filename_.erase();
filename_.append(filename);
}
/** \brief Set name of H5Fed file to be accessed */
int H5Fed::filename(std::string filename)
{
/** initialize internal variables */
filename_.erase();
filename_.append(filename);
return(OKCODE);
}
/** \brief retrieve name of H5Fed file to be accessed */
std::string filename()
{
return(filename_);
}
+108
View File
@@ -0,0 +1,108 @@
/*
Header file for declaring the H5Fed application programming
interface (API) in the C++ language. The header files follows
the declaration of the C application programming interface.
Copyright 2006-2007
Paul Scherrer Institut, Villigen, Switzerland;
Benedikt Oswald;
Achim Gsell
All rights reserved.
Authors
Benedikt Oswald, Achim Gsell
Warning
This code is under development.
*/
/*!
Some conventions:
Functions:
Name:
ThisIsAFunction()
Return values:
-1 or NULL signals an error
\note
In function names we use the words \b get and \b store insteed of
\b read and \b write, because no I/O is actually done in these
functions.
*/
/** include standard header files */
#include <iostream>
#include <ostream>
#include <iterator>
#include <fstream>
#include <vector>
#include <iomanip>
#include <string>
#include <complex>
#ifndef H5FED_HH
#define H5FED_HH
namespace H5Fed
{
const int ERRORCODE = -1;
const int OKCODE = 0;
class H5Fed
{
public:
/** \brief infrastructure routines */
H5Fed(); /** \brief Constructor without argument */
H5Fed(std::string filename); /** \brief Constructor without argument */
~H5Fed(); /** \brief Class destructor */
int filename(std::string filename); /** \brief Set name of H5Fed file to be accessed */
std::string filename(); /** \brief retrieve name of H5Fed file to be accessed */
/** \brief book keeping */
protected:
private:
/** book keeping */
std::string filename_;
};
}
#endif /** H5FED_HH */