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

refactor smart_c to use contract by design and expected #418

Closed
5 tasks
elfenpiff opened this issue Dec 8, 2020 · 0 comments · Fixed by #785
Closed
5 tasks

refactor smart_c to use contract by design and expected #418

elfenpiff opened this issue Dec 8, 2020 · 0 comments · Fixed by #785
Assignees
Labels
enhancement New feature good first issue Good for newcomers
Projects

Comments

@elfenpiff
Copy link
Contributor

elfenpiff commented Dec 8, 2020

Brief feature description

The SmartC class should get the two methods and_then and or_else so that it can be used like the optional or `expected.

Detailed information

  • remove getErrorString from SmartC
  • make all methods in SmartC private (even ctor since makeSmartC is only using this)
  • consider removing the SmartC class and use only free functions
  • It should be possible to use SmartC like
cxx::makeSmartC(sigaction, cxx::ReturnMode::PRE_DEFINED_SUCCESS_CODE, {0}, {}, SIGINT, &act, nullptr)
     .and_then([&](auto sigActionReturnValue){ /* do stuff */ })
     .or_else([&](auto sigActionErrorReturn){ /* report error */ });
  • Find a nicer solution for this use case where ignoring SomeErrorCode:
        if (smartcCall.hasErrors())
        {
            // sad path
        }
        else if (connectCall.getErrNum() == SomeErrorCode)
        {
           // something inbetween happy and sad
        }
        else
        {
            // happy path
        }
@elfenpiff elfenpiff added the enhancement New feature label Dec 8, 2020
@mossmaurice mossmaurice added the good first issue Good for newcomers label Feb 10, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 23, 2021
…an expected later, introduced SmartCResult, cleanup errno handling

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 23, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 26, 2021
…ng when string too long, fixed typos, adjusted copyright headers

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Apr 27, 2021
…sign

Signed-off-by: Christian Eltzschig <me@elchris.org>
@mossmaurice mossmaurice linked a pull request Apr 28, 2021 that will close this issue
19 tasks
@elfenpiff elfenpiff added this to To do in Sprints via automation Apr 29, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
…ded documentation

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 6, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff self-assigned this May 7, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 7, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 7, 2021
…ated code snippet to new API

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 7, 2021
…rted on mac os

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 7, 2021
…test to exclude off by one errors

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 7, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit that referenced this issue May 7, 2021
@elfenpiff elfenpiff changed the title and_then/or_else pattern for smart_c refactoring smart_c to use contract by design and expected May 7, 2021
@elfenpiff elfenpiff changed the title refactoring smart_c to use contract by design and expected refactor smart_c to use contract by design and expected May 7, 2021
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 10, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…ymore

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…dler

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…n socket

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…ory object

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…figuration

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
… posix access rights

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…convert; removed EINTR retry bool for semaphore from watch_dog and periodic task

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…and unit tests

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…duletests and process manager

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
… posix call

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…rn values

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…d early break in uds issue; included all required headers in process_manager; removed error prone nTestCase in roudi memory provider test; always invalidate m_handle in shared_memory; added expressive NULL_TERMINATOR in unix_domain_socket

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…the message was not yet send but the buffer was full

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…ac os

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
… c style function cast

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…ffer slightly under mac os to the rest of the posix world

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…s issue with gcc 5; better variable names; fixed windows issue where static constexpr are not captured

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…ring and member access

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elBoberido added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue May 14, 2021
…' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#418-replace-smart-c-with-posix-call
Sprints automation moved this from To do to Done May 14, 2021
elfenpiff added a commit that referenced this issue May 14, 2021
…ix-call

Iox #418 replace smart c with posix call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature good first issue Good for newcomers
Projects
No open projects
2 participants