WIP: doxygen + remove unused code
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Christian Zimmermann 2023-11-03 02:01:01 +01:00
parent 17d40add98
commit c9f7407de8
16 changed files with 242 additions and 62 deletions

View file

@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = "My Project"
PROJECT_NAME = "CNORXZ"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@ -54,7 +54,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF =
PROJECT_BRIEF = "Container with Native Operation Routines (by XZ)"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
@ -1343,7 +1343,7 @@ HTML_COLORSTYLE = AUTO_LIGHT
# Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_HUE = 130
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use gray-scales only. A
@ -1351,7 +1351,7 @@ HTML_COLORSTYLE_HUE = 220
# Minimum value: 0, maximum value: 255, default value: 100.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_SAT = 200
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
# luminance component of the colors in the HTML output. Values below 100
@ -1362,7 +1362,7 @@ HTML_COLORSTYLE_SAT = 100
# Minimum value: 40, maximum value: 240, default value: 80.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
HTML_COLORSTYLE_GAMMA = 140
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that

View file

@ -1,3 +1,14 @@
/**
@file include/base/dtype.cc.h
@brief DType template member function definitions
Definitions of the template member functions of the DType class.
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_dtype_cc_h__
#define __cxz_dtype_cc_h__

View file

@ -1,3 +1,14 @@
/**
@file include/base/dtype.h
@brief DType declaration
DType is a generic type-erasing class that wrapps std::any.
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_dynamic_meta_h__
#define __cxz_dynamic_meta_h__

View file

@ -1,3 +1,14 @@
/**
@file include/base/isq.h
@brief Integer sequence range and creation functions
Declaration of integer sequence range and corresponding creating function templates
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_isq_h__
#define __cxz_isq_h__

View file

@ -1,3 +1,14 @@
/**
@file include/base/iter.h
@brief Static for-loops
Declaration of function templates that can be used to implement a static for-loop
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_iter_h__
#define __cxz_iter_h__

View file

@ -1,3 +1,14 @@
/**
@file include/base/obj_handle.cc.h
@brief ObjHandle function definition
Implementation of the member functions of template ObjHandle
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_obj_handle_cc_h__
#define __cxz_obj_handle_cc_h__

View file

@ -1,3 +1,15 @@
/**
@file include/base/obj_handle.h
@brief ObjHandle template declaration
Pointer wrapper for directly handling objects via abstract base class;
Provides appropriate copy implementation
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_obj_handle_h__
#define __cxz_obj_handle_h__
@ -7,8 +19,6 @@
namespace CNORXZ
{
// Pointer wrapper for directly handling objects via abstract base class;
// Provides appropriate copy implementation
template <typename T>
class ObjHandle
{

View file

@ -1,3 +1,14 @@
/**
@file include/base/to_string.cc.h
@brief String converter implementation
Implementation of functions that convert a given object/type to a string
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_to_string_cc_h__
#define __cxz_to_string_cc_h__

View file

@ -1,3 +1,14 @@
/**
@file include/base/to_string.h
@brief String converter
Declaration of functions that convert a given object/type to a string
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_to_string_h__
#define __cxz_to_string_h__

View file

@ -1,3 +1,12 @@
/**
@file include/base/utils.h
@brief utilities
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_utils_h__
#define __cxz_utils_h__

View file

@ -1,8 +1,16 @@
/**
@file include/base/uuid.h
@brief uuid implementation
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_uuid_h__
#define __cxz_uuid_h__
//#include <cstdlib>
#include <stdint.h>
#include <functional>

View file

@ -1,4 +1,26 @@
// -*- C++ -*-
/**
@file include/cnorxz.h
@brief cnorxz main header
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
/**
@mainpage CNORXZ Documentation
## Library organization
## Ranges and Indices
## Array types
## Expressions and Operations
**/
#ifndef __cxz_cnorxz_h__
#define __cxz_cnorxz_h__

View file

@ -1,4 +1,16 @@
// -*- C++ -*-
/**
@file include/range/range_base.h
@brief RangeBase declaration
Include basic headers containing defintions and macros
used throughout this library
Copyright (c) 2022 Christian Zimmermann. All rights reserved.
Mail: chizeta@f3l.de
**/
#ifndef __cxz_range_base_h__
#define __cxz_range_base_h__
@ -15,75 +27,150 @@
namespace CNORXZ
{
/**
Abstract factory base class for creating ranges.
Ranges can exclusively create through range factories.
All ranges that are ever created are stored in a product map
(sCreated). The object type hash and the uuid of all ranges
the created depends on serve as keys. In the case the range does not
depend on any other range, its own uuid is used as key. If the
range is a result of a cast from another range, the latter's uuid is
used as key.
Derived factories are supposed to look for an existing range by
calling fromCreated() and, if nullptr returned, add the new range
to the map by calling addToCreated(). These steps are supposed to be
implemented by overloading the purely virtual function make().
The product is publicly accessible throught the function create().
*/
class RangeFactoryBase
{
public:
/** Default constructor */
RangeFactoryBase() = default;
/** Default destructor */
virtual ~RangeFactoryBase() = default;
/** Return the product */
RangePtr create();
static RangePtr getRegistered(const TypeInfo& info, const RangePtr& r);
// check if range with uuid of r exists; if yes, return existing one, else add r and return it
protected:
/** Abstract method to create the product. */
virtual void make() = 0;
/** access the product map (read-only) */
RangePtr fromCreated(const TypeInfo& info, const Vector<Uuid>& rids) const;
/** add newly created range to the product map */
void addToCreated(const TypeInfo& info, const Vector<Uuid>& rids, const RangePtr& r);
RangePtr mProd;
RangePtr mProd; /**< shared pointer to the product */
private:
// also add single ranges here (PtrId -> own)
// rangeCast: PtrId -> original Range
static Map<SizeT,Map<Vector<Uuid>,RangePtr>> sCreated;
static Map<SizeT,Map<Vector<Uuid>,RangePtr>> sCreated; /**< the product map */
};
/**
Abstract range base class
A range defines a parameter space containers and operations are defined on.
Indices can be used to iterate over that space.
Ranges have to be created though a corresponding factory.
@see RangeFactoryBase
Ranges always exist within a shared pointer and cannot be copied.
*/
class RangeBase
{
public:
typedef DIndex IndexType;
/** default destructor */
virtual ~RangeBase() = default;
// virtual RangePtr sub() const; // Sptr<URange<RangePtr>> ; range of subranges (TODO!!!)
/** Access sub-ranges.
In the case the range is multi-dimensional the num-th
sub-range can be accessed through this function
@param num size type argument
*/
virtual RangePtr sub(SizeT num) const;
/** Access sub-ranges.
In the case the range is multi-dimensional this function returns an
array of all sub-ranges (empty is one-dimensional)
*/
virtual MArray<RangePtr> sub() const;
/** Range size */
virtual SizeT size() const = 0;
/** Range dimension.
Returns the range's dimension, which is equivalent to
the number of sub-ranges. If a sub-range has non-zero dimension
this is NOT taken into account!
*/
virtual SizeT dim() const = 0;
/** Range type */
virtual const TypeInfo& type() const = 0;
/** The type of the range's meta data */
virtual const TypeInfo& metaType() const = 0;
/** Meta data in string format at lexicographic position pos.
@param pos size type argument
*/
virtual String stringMeta(SizeT pos) const = 0;
/** Return DIndex iterating over the range's parameter space.
@param pos index position, size type argument
*/
virtual DIndex index(SizeT pos = 0) const = 0;
/** Create extended range.
Creates a new range consisting of the meta data spaces
of this range and the range r
@param r shared pointer to range used for extension
*/
virtual RangePtr extend(const RangePtr& r) const = 0;
/** check if ranges are the same */
bool operator==(const RangeBase& in) const;
/** check if ranges are not the same */
bool operator!=(const RangeBase& in) const;
/** return the range's uuid */
Uuid id() const;
DIndex begin() const;
DIndex end() const;
RangePtr orig() const;
//virtual Vector<Uuid> key2() const { return Vector<Uuid>(); }
/** return a DIndex pointing to the range's first element */
DIndex begin() const;
/** return a DIndex pointing to the element after the range's last element */
DIndex end() const;
friend RangeFactoryBase;
protected:
RangeBase();
RangeBase(const RangePtr& rel);
/** default constructor */
RangeBase();
virtual Vector<Uuid> key() const = 0;
// delete copy/move???
Uuid mId = {0,0};
Wptr<RangeBase> mThis;
RangePtr mRel; // used, if created from another range, to point on it
Uuid mId = {0,0}; /**< The range's uuid */
Wptr<RangeBase> mThis; /**< weak pointer to this range */
};
template <class Range>

View file

@ -175,26 +175,7 @@ namespace CNORXZ
return UPos(id == this->id() ? 1 : 0);
}
}
/*
template <typename MetaT>
template <class Index>
decltype(auto) UIndex<MetaT>::formatFrom(const Index& ind) const
{
return *this;
}
template <typename MetaT>
template <class Index>
decltype(auto) UIndex<MetaT>::slice(const Sptr<Index>& ind) const
{
if(ind != nullptr){
if(ind->dim() != 0) {
return Sptr<UIndex<MetaT>>();
}
}
return std::make_shared<UIndex<MetaT>>(*this);
}
*/
template <typename MetaT>
template <class Xpr, class F>
decltype(auto) UIndex<MetaT>::ifor(const Xpr& xpr, F&& f) const

View file

@ -56,13 +56,7 @@ namespace CNORXZ
RangePtr prange(const UIndex<MetaType>& last) const;
SizeT deepFormat() const;
/*
template <class Index>
decltype(auto) formatFrom(const Index& ind) const;
template <class Index>
decltype(auto) slice(const Sptr<Index>& ind) const;
*/
template <class Xpr, class F>
decltype(auto) ifor(const Xpr& xpr, F&& f) const;

View file

@ -90,14 +90,6 @@ namespace CNORXZ
{
return this->index(this->size());
}
RangePtr RangeBase::orig() const
{
if(mRel) return mRel;
else return RangePtr(mThis);
}
RangeBase::RangeBase(const RangePtr& rel) : mRel(rel) {}
/****************************
* Non-member functions *