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

started with operators

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.
rejected Barton and Nackman trick


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1478
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 3074e5eb
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* *
* $Id: README,v 1.23 2003-06-27 18:12:50 tforb Exp $ * $Id: README,v 1.24 2004-02-10 09:33:03 tforb Exp $
* *
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) * Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
* *
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
* - 04/01/2003 V1.4 (thof) * - 04/01/2003 V1.4 (thof)
* - added section about Tcontainer typedef * - added section about Tcontainer typedef
* (\ref sec_design_interface_tcontainer) * (\ref sec_design_interface_tcontainer)
* - 10/02/2004 V1.5 (thof)
* - added section about decision against interface
* base classes
* (\ref sec_design_interface_nobaseclass)
* *
* ============================================================================ * ============================================================================
*/ */
...@@ -68,7 +72,7 @@ namespace aff { ...@@ -68,7 +72,7 @@ namespace aff {
\since December 2002 \since December 2002
\date December 2002 \date December 2002
\version V1.0 \version V1.0
$Id: README,v 1.23 2003-06-27 18:12:50 tforb Exp $ $Id: README,v 1.24 2004-02-10 09:33:03 tforb Exp $
Contents of this page: Contents of this page:
- \ref sec_main_aims - \ref sec_main_aims
...@@ -204,6 +208,7 @@ See also \ref sec_design_multidimensional. ...@@ -204,6 +208,7 @@ See also \ref sec_design_multidimensional.
- \ref sec_design_interface_typedef - \ref sec_design_interface_typedef
- \ref sec_design_interface_tcontainer - \ref sec_design_interface_tcontainer
- \ref sec_design_interface_internals - \ref sec_design_interface_internals
- \ref sec_design_interface_nobaseclass
- \ref sec_design_hierarchy - \ref sec_design_hierarchy
- \ref sec_design_replicated - \ref sec_design_replicated
- \ref sec_design_replicated_fact - \ref sec_design_replicated_fact
...@@ -410,6 +415,27 @@ See also \ref sec_design_multidimensional. ...@@ -410,6 +415,27 @@ See also \ref sec_design_multidimensional.
In return all containers provide a constructor that takes a representation In return all containers provide a constructor that takes a representation
and a shape object and checks for their consistency. and a shape object and checks for their consistency.
\subsection sec_design_interface_nobaseclass Decision against a base class to express common interface
This library contains different classes that provide common interfaces. For
example all aff::ConstArray, aff::Array, aff::Series and aff::ConstSeries
provide the necessary interface to be used together with aff::Iterator or
aff::Browser. A rather elegant way to express this commonality in a template
context is the Barton and Nackman trick. All containers that can work
together with aff::Iterater sould have to inherit from a class
aff::Iteratable. The base class is templated, takes the iteratable class as
template parameter and stores a reference to the instance of the iteratable
class. This way each iteratable class can be converted to aff::Iteratable,
which again returns a reference to the classes iteratable features in the
appropriate context.
This way of expressing common interfaces makes the whole classes more
complicated than necessary to provide their elementary functionality. We
have to store an extra reference to the leaf class object for each feature,
we will express this way. And we have to include a whole bunsch of extra
code for each feature. Since we prefer \ref sec_design_interface_sparse this
method was rejected.
<HR> <HR>
\section sec_design_hierarchy Class hierarchy: member data vs. inheritance \section sec_design_hierarchy Class hierarchy: member data vs. inheritance
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* *
* $Id: README.changelog,v 1.43 2004-02-07 22:14:20 tforb Exp $ * $Id: README.changelog,v 1.44 2004-02-10 09:33:04 tforb Exp $
* *
* Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) * Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
* *
...@@ -21,12 +21,17 @@ ...@@ -21,12 +21,17 @@
/*! \page page_changelog ChangeLog (AFF) /*! \page page_changelog ChangeLog (AFF)
$Id: README.changelog,v 1.43 2004-02-07 22:14:20 tforb Exp $ $Id: README.changelog,v 1.44 2004-02-10 09:33:04 tforb Exp $
\sa \ref page_project_status \sa \ref page_project_status
Major changes in the interface of the library are marked by \b !!. Major changes in the interface of the library are marked by \b !!.
- \b 10/02/2004 (thof)
- removed lib/iteratable.h
- explained this decision:
\ref sec_design_interface_nobaseclass
- \b 07/02/2004 (thof) - \b 07/02/2004 (thof)
- index limit set operations available through aff::Series - index limit set operations available through aff::Series
...@@ -196,7 +201,7 @@ ...@@ -196,7 +201,7 @@
/*! \page page_project_status Project status (AFF) /*! \page page_project_status Project status (AFF)
$Id: README.changelog,v 1.43 2004-02-07 22:14:20 tforb Exp $ $Id: README.changelog,v 1.44 2004-02-10 09:33:04 tforb Exp $
\sa \ref page_changelog \sa \ref page_changelog
......
/*! \file arrayoperators.h
* \brief provide operators for array classes (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: arrayoperators.h,v 1.1 2004-02-10 09:33:05 tforb Exp $
* \author Thomas Forbriger
* \date 10/02/2004
*
* provide operators for array classes (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 10/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_ARRAYOPERATORS_H_VERSION
#define TF_ARRAYOPERATORS_H_VERSION \
"TF_ARRAYOPERATORS_H V1.0 "
#define TF_ARRAYOPERATORS_H_CVSID \
"$Id: arrayoperators.h,v 1.1 2004-02-10 09:33:05 tforb Exp $"
namespace tf {
}
#endif // TF_ARRAYOPERATORS_H_VERSION (includeguard)
/* ----- END OF arrayoperators.h ----- */
/*! \file iteratable.h
* \brief Interface base class template definition
*
* ----------------------------------------------------------------------------
*
* $Id: iteratable.h,v 1.1 2003-06-27 18:12:52 tforb Exp $
* \author Thomas Forbriger
* \date 27/06/2003
*
* Interface base class template definition
*
* Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 27/06/2003 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef AFF_ITERATABLE_H_VERSION
#define AFF_ITERATABLE_H_VERSION \
"AFF_ITERATABLE_H V1.0"
#define AFF_ITERATABLE_H_CVSID \
"$Id: iteratable.h,v 1.1 2003-06-27 18:12:52 tforb Exp $"
namespace aff {
/*! Base class template defining mandatory interface for iteratable containers
*
* This uses the Barton and Nackman trick for class template inheritance. The
* class template aff::Iteratable is a base class to all iteratable
* containers, i.e. containers that may be used together with with the
* aff::Iterator class template. In case you define a function template the
* may take any interatable container class as argument type for browsing
* elements, use a declaration like
* \code
* template<class C>
* void func(const aff::Iteratable<C>& cont);
* \endcode
*
* \todo
* Implement aff::Iteratable
*
* \todo
* Inherit aff::Array and aff::Series from aff::Iteratable
*
* \todo
* explain why this construct is helpful
*/
template<class C>
class Iteratable {
public:
private:
//! reference to leaf
C& Mleaf;
}; // class Iteratable
} // namespace aff
#endif // AFF_ITERATABLE_H_VERSION (includeguard)
/* ----- END OF iteratable.h ----- */
/*! \file operators.h
* \brief provide operators for iteratable objects (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: operators.h,v 1.1 2004-02-10 09:33:06 tforb Exp $
* \author Thomas Forbriger
* \date 10/02/2004
*
* provide operators for iteratable objects (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 10/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_OPERATORS_H_VERSION
#define TF_OPERATORS_H_VERSION \
"TF_OPERATORS_H V1.0 "
#define TF_OPERATORS_H_CVSID \
"$Id: operators.h,v 1.1 2004-02-10 09:33:06 tforb Exp $"
namespace tf {
}
#endif // TF_OPERATORS_H_VERSION (includeguard)
/* ----- END OF operators.h ----- */
/*! \file seriesoperators.h
* \brief provide operators for series classes (prototypes)
*
* ----------------------------------------------------------------------------
*
* $Id: seriesoperators.h,v 1.1 2004-02-10 09:33:05 tforb Exp $
* \author Thomas Forbriger
* \date 10/02/2004
*
* provide operators for series classes (prototypes)
*
* Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
*
* REVISIONS and CHANGES
* - 10/02/2004 V1.0 Thomas Forbriger
*
* ============================================================================
*/
// include guard
#ifndef TF_SERIESOPERATORS_H_VERSION
#define TF_SERIESOPERATORS_H_VERSION \
"TF_SERIESOPERATORS_H V1.0 "
#define TF_SERIESOPERATORS_H_CVSID \
"$Id: seriesoperators.h,v 1.1 2004-02-10 09:33:05 tforb Exp $"
namespace tf {
}
#endif // TF_SERIESOPERATORS_H_VERSION (includeguard)
/* ----- END OF seriesoperators.h ----- */
Markdown is supported
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