You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the input! I will try to work on this asap.
Response to your question (no answer but more brainstorming)
I do not follow the DRY principle to 100%. It's more like 90%. A central location means that multiple units like A, B and C would be related to another unit called D for example. The strength of the coupling decides if code duplication is OK for me. If the coupling is low, then code duplication is allowed, otherwise it's a clear dependency of multiple units to one topic.
In general I would like to avoid a "Core Library". On the other hand there is one central unit of course: Processing.cpp
Another question is: Should the base Processing() provide minimal time-related functions?
One argument for yes could be: A process is a function that needs time for creating its output. For me a function has the signature y = f(x) whereas the signature of a process would be y = p(x, t). In this sense, time is tightly coupled to the concept of a process.
But time is considered by the function success() already. At the moment a process has an abstract state for mapping time: Not finished (Pending) and finished (Positive or not).
Important structure info
We have multiple system layers
SystemCore
1.1 Processing.cpp
1.2 Other cpp files
Concrete process libraries
Application / project specific processes
The core is divided into two layers. The file Processing.cpp must be compile-able for all systems. Simple and complex, with standard libraries and without. I have to think about it, how time should be integrated in the sources. At compile time or runtime.
Current situtation
TcpTransfering::millis() is intentionally a private function, which should not be used by external user code. But for some targets this is a problem which must be resolved, because the code still must be compiled.
Same strategy with CONFIG_PROC_LOG_HAVE_CHRONO. This is a private define localized in Log.cpp. User code should not reference it.
Pipe.h is one possible way for Inter-Process-Communication. This file has a public connection to time. At the moment I am wondering if this is a good place for a function / define called nowMs() :|
Activity
beartronix commentedon Aug 3, 2025
related: nowMs() and millis() are ambiguous:
https://github.com/NoOrientationProgramming/SystemCore/blob/5d4128c686e7b42be67950a2216f33d41561af53/Pipe.h#L60
https://github.com/NoOrientationProgramming/SystemCore/blob/5d4128c686e7b42be67950a2216f33d41561af53/TcpTransfering.cpp#L754
question again: why implement millis() everywhere instead of a central location? (or better: don't implement and leave it to the application code)
Naegolus commentedon Aug 12, 2025
Thanks for the input! I will try to work on this asap.
Response to your question (no answer but more brainstorming)
I do not follow the DRY principle to 100%. It's more like 90%. A central location means that multiple units like A, B and C would be related to another unit called D for example. The strength of the coupling decides if code duplication is OK for me. If the coupling is low, then code duplication is allowed, otherwise it's a clear dependency of multiple units to one topic.
In general I would like to avoid a "Core Library". On the other hand there is one central unit of course: Processing.cpp
Another question is: Should the base
Processing()provide minimal time-related functions?One argument for yes could be: A process is a function that needs time for creating its output. For me a function has the signature
y = f(x)whereas the signature of a process would bey = p(x, t). In this sense, time is tightly coupled to the concept of a process.But time is considered by the function
success()already. At the moment a process has an abstract state for mapping time: Not finished (Pending) and finished (Positive or not).Important structure info
We have multiple system layers
1.1 Processing.cpp
1.2 Other cpp files
The core is divided into two layers. The file Processing.cpp must be compile-able for all systems. Simple and complex, with standard libraries and without. I have to think about it, how time should be integrated in the sources. At compile time or runtime.
Current situtation
TcpTransfering::millis() is intentionally a private function, which should not be used by external user code. But for some targets this is a problem which must be resolved, because the code still must be compiled.
Same strategy with
CONFIG_PROC_LOG_HAVE_CHRONO. This is a private define localized in Log.cpp. User code should not reference it.Pipe.h is one possible way for Inter-Process-Communication. This file has a public connection to time. At the moment I am wondering if this is a good place for a function / define called
nowMs():|Result
This issue is important but will take some time.