Skip to content

Commit

Permalink
iox-eclipse-iceoryx#982 Add design, class and test skeletons
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Jan 18, 2022
1 parent d8af425 commit 0e80882
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/design/status_port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# StatusPort

## Summary and problem description

* Taco ähnliches Verhalten mit zwei Speicherzellen
* Auf Daten über ein Lambda zugreifen
* Lambda nochmal ausführen, wenn sich die Daten unterdrunter geändert haben (Frankenstein check)

## Terminology

## Design

### Considerations

### Solution

### Code example

## Open issues

* Brauche ich den Custom User Header im Status Port?
* Ja!
* Unterscheidung zwischen Writer/ Reader oder User/RouDi?
* Soll ich vom BasePort ableiten?
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_POSH_POPO_STATUS_PORT_HPP
#define IOX_POSH_POPO_STATUS_PORT_HPP

#include "iceoryx_hoofs/cxx/function_ref.hpp"

namespace iox
{
namespace popo
{
template <typename T, typename H>
class StatusPortReader
{
public:
StatusPortReader() noexcept
{
}

StatusPortReader(StatusPortReader&& rhs) = delete;
StatusPortReader& operator=(StatusPortReader&& rhs) = delete;

StatusPortReader(const StatusPortReader&) = delete;
StatusPortReader& operator=(const StatusPortReader&) = delete;

void takeChunk(cxx::function_ref<void(T&)> callable)
{
}
};

template <typename T, typename H>
class StatusPortWriter
{
public:
StatusPortWriter() noexcept
{
}

StatusPortWriter(StatusPortWriter&& rhs) = delete;
StatusPortWriter& operator=(StatusPortWriter&& rhs) = delete;

StatusPortWriter(const StatusPortWriter&) = delete;
StatusPortWriter& operator=(const StatusPortWriter&) = delete;

void storeChunk(cxx::function_ref<void(T&)> callable)
{
}
};

#endif // IOX_POSH_POPO_STATUS_PORT_HPP

} // namespace popo
} // namespace iox
60 changes: 60 additions & 0 deletions iceoryx_posh/test/moduletests/test_popo_status_port.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#include "iceoryx_posh/internal/popo/ports/status_port.hpp"

#include "test.hpp"


namespace
{
using namespace ::testing;
using namespace iox::popo;

class StatusPort_test : public Test
{
public:

protected:
StatusPort_test()
{
}

~StatusPort_test()
{
}

void SetUp()
{
}

void TearDown()
{
}

/// @todo move to integration tests?
StatusPortReader<uint32_t, uint32_t> sut;
StatusPortWriter<uint32_t, uint32_t> sut2;
};


TEST_F(StatusPort_test, InitialStateIsEmpty)
{

}


} // namespace

0 comments on commit 0e80882

Please sign in to comment.