service interface stream enhancements #93

Merged
gaisser merged 14 commits from KSat/fsfw:mueller_ServiceStreamEnhancement into master 2020-07-21 12:18:20 +02:00
Owner

replacement for #52 .
Fixes #51 .
Fixes #31 .

replacement for #52 . Fixes #51 . Fixes #31 .
muellerr added the
feature
label 2020-05-29 20:33:09 +02:00
Author
Owner

I made some more improvements:

  1. Printout can be redirected to stderr now optionally (can be used on host environments)
  2. printChar takes additional boolean to specify where to print (stderr or stdout)
  3. if stderr is used, mode is unbuffered. Preamble must be printed manually then, new getter function for this
  4. forward declaration of ServiceINterfaceStreams so the public functions (setActive(), getPreamble()) can be used. otherwise, they can only be used in main().
  5. some simplifications and better documentation.
I made some more improvements: 1. Printout can be redirected to stderr now optionally (can be used on host environments) 2. printChar takes additional boolean to specify where to print (stderr or stdout) 3. if stderr is used, mode is unbuffered. Preamble must be printed manually then, new getter function for this 3. forward declaration of ServiceINterfaceStreams so the public functions (setActive(), getPreamble()) can be used. otherwise, they can only be used in main(). 4. some simplifications and better documentation.
Author
Owner

I have rewritten parts of the code.

The only external definitions are the classes itself now (which are already std::ostream's anyway). These can be instantiated somewhere else, and the extra osstreams are not necessary anymore.

I reworked the getPreamble() function to not use dnymaic memory allocation (at runtime), so sprintf is used again.

THere are optional flags to work in unbuffered mode or pipe output to stderr instead of stdout as well.

Small API change: printChar now takes a second parameter, which specifies whether to use stderr or stdout. Can be used on linux for example.

I have rewritten parts of the code. The only external definitions are the classes itself now (which are already std::ostream's anyway). These can be instantiated somewhere else, and the extra osstreams are not necessary anymore. I reworked the getPreamble() function to not use dnymaic memory allocation (at runtime), so sprintf is used again. THere are optional flags to work in unbuffered mode or pipe output to stderr instead of stdout as well. Small API change: printChar now takes a second parameter, which specifies whether to use stderr or stdout. Can be used on linux for example.
muellerr added the
API Change
label 2020-06-04 19:57:56 +02:00
Author
Owner

Old implementation was using dynamic memory allocaton, space for std::string now allocated at initialization only.

Old implementation was using dynamic memory allocaton, space for std::string now allocated at initialization only.
gaisser self-assigned this 2020-07-21 12:18:01 +02:00
gaisser closed this pull request 2020-07-21 12:18:20 +02:00
gaisser deleted branch mueller_ServiceStreamEnhancement 2020-07-21 12:18:42 +02:00
Sign in to join this conversation.
No description provided.