Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 20 #37

Merged
merged 6 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: C/C++ CI

on:
push:
branches: [ "dev" ]
branches: [ "dev_98", "dev_20", "release" ]
pull_request:
branches: [ "dev" ]
branches: [ "dev_98", "dev_20", "release" ]

jobs:
buildAndRunTests:
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ build
bin
obj
lib
.vs
*.vcxproj.*
*.vcxproj
*.sln

# *.make

# gcov
Expand Down Expand Up @@ -66,3 +71,7 @@ tempCodeRunnerFile.py
html
*.cov
_*.*

# depracated gen
transitions_*.md
*_states.md
22 changes: 11 additions & 11 deletions CLOC.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
## total lines of code: 3838
# CLOC
**application**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 20 198 172 685
C++ 13 66 13 623
C++ 15 100 7 919
C/C++ Header 23 239 189 810
-------------------------------------------------------------------------------
SUM: 33 264 185 1308
SUM: 38 339 196 1729
-------------------------------------------------------------------------------
```
**testenv**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 21 185 158 785
C++ 10 57 23 280
C/C++ Header 24 210 170 941
C++ 10 57 23 301
-------------------------------------------------------------------------------
SUM: 31 242 181 1065
SUM: 34 267 193 1242
-------------------------------------------------------------------------------
```
**moduletests**
```
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 12 179 168 1099
C++ 15 212 216 1830
-------------------------------------------------------------------------------
SUM: 12 179 168 1099
SUM: 15 212 216 1830
-------------------------------------------------------------------------------
```
**systemtests**
Expand All @@ -46,8 +46,8 @@ SUM: 2 33 25 107
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C/C++ Header 13 82 92 259
C/C++ Header 17 108 111 339
-------------------------------------------------------------------------------
SUM: 13 82 92 259
SUM: 17 108 111 339
-------------------------------------------------------------------------------
```
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# the #DSTW project
# the DSTW project

## state of implementation
implementation according to [release 2023-11 _Maggie_](releases/release_2023-11.md)
implementation according to [release 2023-12 _Lisa_](releases/release_2023-12.md)

![overview](specification/doc/rel-2023-12_overview.svg)

## testing
read [more about testing](testing/README.md)
70 changes: 18 additions & 52 deletions application/components/BAS/BaseTypes.h
Original file line number Diff line number Diff line change
@@ -1,66 +1,32 @@
// ============================================================
// basic integral types and limits
// basic integral types
// ============================================================
// created by Manfred Sorgo

#pragma once
#ifndef BASETYPES_H
#define BASETYPES_H

typedef unsigned char UINT8;
typedef UINT8 BYTE;
typedef unsigned short UINT16;
typedef unsigned int UINT32;
#include <cstdint>

typedef signed char INT8;
typedef signed short INT16;
typedef signed int INT32;
using UINT8 = uint8_t;
using BYTE = UINT8;
using UINT16 = uint16_t;
using UINT32 = uint32_t;
using UINT64 = uint64_t;

typedef char CHAR;
using INT8 = int8_t;
using INT16 = int16_t;
using INT32 = int32_t;
using INT64 = int64_t;

typedef void* PTR;
typedef const void* CPTR;

typedef CHAR* C_STRING;
typedef const CHAR* CONST_C_STRING;

typedef bool BOOL;

#ifndef UINT8_MAX
#define UINT8_MAX 0xFF
#endif

#ifndef UINT16_MAX
#define UINT16_MAX 0xFFFF
#endif

#ifndef UINT32_MAX
#define UINT32_MAX 0xFFFFFFFF
#endif

#ifndef INT8_MIN
#define INT8_MIN -0x7F
#endif

#ifndef INT8_MAX
#define INT8_MAX 0x7F
#endif

#ifndef INT16_MIN
#define INT16_MIN -0x7FFF
#endif

#ifndef INT16_MAX
#define INT16_MAX 0x7FFF
#endif

#ifndef INT32_MIN
#define INT32_MIN -0x7FFFFFFF
#endif

#ifndef INT32_MAX
#define INT32_MAX 0x7FFFFFFF
#endif
using CHAR = char;
using PTR = void*;
using CPTR = const void*;
using C_STRING = CHAR*;
using CONST_C_STRING = const CHAR*;
using BOOL = bool;

using std::size_t;

#endif // _H
115 changes: 115 additions & 0 deletions application/components/BAS/I_Array.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// ============================================================
// defintion of interface I_Array to apply:
// - bubble sort
// - b-tree search
// - uniqueness check / duplicates count
// ============================================================
// created by Manfred Sorgo

#pragma once
#ifndef I_ARRAY_H
#define I_ARRAY_H

#include <BAS/coding.h>
#include <ifs/PosRes.h>

template <class T, size_t CAP>
class I_Array
{
public:
constexpr inline static size_t capacity()
{
return CAP;
}

// current number of objects
virtual size_t size() const = 0;

// object access by position
virtual const T& at(size_t pos) const = 0;

// object pointer access by position
virtual const T* ptr(size_t pos) const = 0;

// definition object a is greater than object b
inline virtual bool isGreater(const T& a, const T& b) const
{
return false;
}

void sort()
{
bool swapped = true;
for (size_t n = size(); swapped and n > 1; --n)
{
swapped = false;
for (size_t p = 0; p < n - 1; ++p)
{
if (isGreater(at(p), at(p + 1)))
{
swap(p, p + 1);
swapped = true;
}
}
}
}

PosRes find(const T& obj) const
{
PosRes res = { 0, false };

if (size() > 0)
{
size_t pMin = 0;
size_t pMax = size() - 1;

while (pMax >= pMin)
{
const size_t pCur = (pMin + pMax + 1) / 2;

if (isGreater(obj, at(pCur)))
{
pMin = pCur + 1;
}
else if (isGreater(at(pCur), obj))
{
if (pCur > 0)
{
pMax = pCur - 1;
}
else
{
break;
}
}
else
{
res.pos = pCur;
res.valid = true;
break;
}
}
}
return res;
}

size_t dupCnt() const
{
size_t nd = 0;
for (size_t p = 1; p < size(); ++p)
{
if (not isGreater(at(p), at(p - 1)))
{
++nd;
}
}
return nd;
}

protected:
// swap content of position a and b
inline virtual void swap(size_t posA, size_t posB)
{}
};

#endif // H_
93 changes: 0 additions & 93 deletions application/components/BAS/I_Searchable.h

This file was deleted.

Loading
Loading