Definition of H5Fed C++ interface, class definition and implementation, first material.
This commit is contained in:
@@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 */
|
||||
Reference in New Issue
Block a user